summaryrefslogtreecommitdiffstats
path: root/generator
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 /generator
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 'generator')
-rw-r--r--generator/generator_c.ml5
1 files changed, 5 insertions, 0 deletions
diff --git a/generator/generator_c.ml b/generator/generator_c.ml
index 45374757..fa9c0ff9 100644
--- a/generator/generator_c.ml
+++ b/generator/generator_c.ml
@@ -483,6 +483,10 @@ extern void guestfs_set_close_callback (guestfs_h *g, guestfs_close_cb cb, void
extern void guestfs_set_progress_callback (guestfs_h *g, guestfs_progress_cb cb, void *opaque)
GUESTFS_DEPRECATED_BY(\"set_event_callback\");
+/* User cancellation. */
+#define LIBGUESTFS_HAVE_USER_CANCEL 1
+extern void guestfs_user_cancel (guestfs_h *g);
+
/* Private data area. */
#define LIBGUESTFS_HAVE_SET_PRIVATE 1
extern void guestfs_set_private (guestfs_h *g, const char *key, void *data);
@@ -1488,6 +1492,7 @@ and generate_linker_script () =
"guestfs_set_private";
"guestfs_set_progress_callback";
"guestfs_set_subprocess_quit_callback";
+ "guestfs_user_cancel";
(* Unofficial parts of the API: the bindings code use these
* functions, so it is useful to export them.