summaryrefslogtreecommitdiffstats
path: root/src/guestfs.c
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2011-07-15 10:43:36 +0100
committerRichard W.M. Jones <rjones@redhat.com>2011-07-15 14:11:46 +0100
commit9ec9c97ce2ba46e56b304d3a367c86adc703160d (patch)
tree69c7ea6ab8a6664d95c8573863536f54284931c7 /src/guestfs.c
parentf173543fd207bdc254a5eb75180d82ef25eacae9 (diff)
downloadlibguestfs-9ec9c97ce2ba46e56b304d3a367c86adc703160d.tar.gz
libguestfs-9ec9c97ce2ba46e56b304d3a367c86adc703160d.tar.xz
libguestfs-9ec9c97ce2ba46e56b304d3a367c86adc703160d.zip
Add user cancellation to the C API.
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.
Diffstat (limited to 'src/guestfs.c')
-rw-r--r--src/guestfs.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/guestfs.c b/src/guestfs.c
index e2b71594..1fa3c0ae 100644
--- a/src/guestfs.c
+++ b/src/guestfs.c
@@ -578,6 +578,12 @@ guestfs_get_error_handler (guestfs_h *g, void **data_rtn)
return g->error_cb;
}
+void
+guestfs_user_cancel (guestfs_h *g)
+{
+ g->user_cancel = 1;
+}
+
int
guestfs__set_verbose (guestfs_h *g, int v)
{