diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2011-07-15 10:43:36 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2011-07-15 14:11:46 +0100 |
commit | 9ec9c97ce2ba46e56b304d3a367c86adc703160d (patch) | |
tree | 69c7ea6ab8a6664d95c8573863536f54284931c7 /src/guestfs-internal.h | |
parent | f173543fd207bdc254a5eb75180d82ef25eacae9 (diff) | |
download | libguestfs-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-internal.h')
-rw-r--r-- | src/guestfs-internal.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/guestfs-internal.h b/src/guestfs-internal.h index e2ffdf30..99a04045 100644 --- a/src/guestfs-internal.h +++ b/src/guestfs-internal.h @@ -200,6 +200,11 @@ struct guestfs_h FILE *trace_fp; char *trace_buf; size_t trace_len; + + /* User cancelled transfer. Not signal-atomic, but it doesn't + * matter for this case because we only care if it is != 0. + */ + int user_cancel; }; /* Per-filesystem data stored for inspect_os. */ |