summaryrefslogtreecommitdiffstats
path: root/capitests/test-user-cancel.c
Commit message (Collapse)AuthorAgeFilesLines
* test-user-cancel: Make this test choose smaller cancellation numbers.Richard W.M. Jones2011-10-311-6/+50
| | | | | | | | | | | | | | | | Use a Gaussian distribution for random numbers so that smaller numbers are chosen more frequently. This also exposes a bug in this test which only happens when small numbers are chosen: If the test thread starts up quickly, it can get to guestfs_user_cancel before the guestfs_upload command has happened in the main thread. This causes the cancel to be ignored (correctly) and we end up in the second loop writing data until the disk runs out of space. Fix this by repeatedly asserting the cancel flag in the second loop. (cherry picked from commit 62909197d120c01cc86095518aacca9d4ad268dd)
* Add user cancellation to the C API.Richard W.M. Jones2011-07-151-0/+327
This allows long transfers (FileIn and FileOut operations) to be cancelled by calling the signal and thread safe guestfs_user_cancel function. Most of this commit consists of a multithreaded program that tests user cancellation of uploads and downloads.