search for: user_cancel

Displaying 20 results from an estimated 31 matches for "user_cancel".

2011 Dec 28
1
[PATCH] fish: fix the Ctrl-\ causes guestfish to abort bug(RHBZ#596761)
...nlong Gao <gaowanlong at cn.fujitsu.com> --- fish/fish.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/fish/fish.c b/fish/fish.c index efd6b0b..b782b7c 100644 --- a/fish/fish.c +++ b/fish/fish.c @@ -402,6 +402,7 @@ main (int argc, char *argv[]) sa.sa_handler = user_cancel; sa.sa_flags = SA_RESTART; sigaction (SIGINT, &sa, NULL); + sigaction (SIGQUIT, &sa, NULL); guestfs_set_pgroup (g, 1); } -- 1.7.8
2015 Oct 16
2
[PATCH v6 0/2] RFE: journal reader in guestfish
Output is configurable, it's the same format as virt-log has, since both uses same code. First patch moves get_journal_field around and renames it to journal_view and the next one reimplements it a bit and brings it to guestfish. Maros Zatko (2): cat: move get_journal_field to fish/journal.c fish: add journal-view command (RHBZ#988100) .gnulib | 2 +-
2015 May 26
2
[PATCH] api: Don't truncate /dev/stdout or /dev/stderr when used as FileOut.
...xn -> warning (f_"log file %s: %s (ignored)") logfile (Printexc.to_string exn) in diff --git a/src/proto.c b/src/proto.c index a019625..a46a382 100644 --- a/src/proto.c +++ b/src/proto.c @@ -756,9 +756,18 @@ guestfs_int_recv_file (guestfs_h *g, const char *filename) g->user_cancel = 0; - fd = open (filename, O_WRONLY|O_CREAT|O_TRUNC|O_NOCTTY|O_CLOEXEC, 0666); + /* If downloading to /dev/stdout or /dev/stderr, dup the file + * descriptor instead of reopening the file, so that redirected + * stdout/stderr work properly. + */ + if (STREQ (filename, "/dev/stdout&...
2014 Feb 13
3
Libguestfs (1.22.6) driver/changes for mingw/win32
Hi, I attached the changes I made to a vanilla libguestfs-1.22.6 in order to make it work in mingw/win32. Added is also the patch required to make QEMU compatible (add a command to QMP that lists the supported devices (the regilat way you do it print it to stderr, which is difficult to redirect in win32)). This is done on behalf of Intel Corp. Thanks, Or (oberon in irc)
2016 Apr 14
0
[PATCH 1/2] utils, builder: Add wrappers for posix_fadvise.
...*buf, size_t len); static int send_file_cancellation (guestfs_h *g); @@ -372,7 +359,7 @@ guestfs_int_send_file (guestfs_h *g, const char *filename) return -1; } - fadvise_sequential (fd); + guestfs_int_fadvise_sequential (fd); /* Send file in chunked encoding. */ while (!g->user_cancel) { @@ -829,7 +816,7 @@ guestfs_int_recv_file (guestfs_h *g, const char *filename) goto cancel; } - fadvise_sequential (fd); + guestfs_int_fadvise_sequential (fd); /* Receive the file in chunked encoding. */ while ((r = receive_file_data (g, &buf)) > 0) { diff --git a/src/...
2015 Jan 07
2
Re: [PATCH 1/5] New API: btrfs_scrub
In data venerdì 26 dicembre 2014 16:17:45, Hu Tao ha scritto: > Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> > --- > daemon/btrfs.c | 32 ++++++++++++++++++++++++++++++++ > generator/actions.ml | 17 +++++++++++++++++ > src/MAX_PROC_NR | 2 +- > 3 files changed, 50 insertions(+), 1 deletion(-) > > diff --git a/daemon/btrfs.c b/daemon/btrfs.c > index
2016 Apr 14
3
builder: posix_fadvise fixes.
The way we used posix_fadvise was wrong, and yet right! Rich.
2013 Feb 04
1
[PATCH] generator: Add visibility to action struct
..._except_generated "gobject/include/guestfs-gobject/optargs-*.h"; delete_except_generated "gobject/src/optargs-*.c"; diff --git a/generator/ocaml.ml b/generator/ocaml.ml index 0b1f96b..d922c0f 100644 --- a/generator/ocaml.ml +++ b/generator/ocaml.ml @@ -130,12 +130,12 @@ val user_cancel : t -> unit (* The actions. *) List.iter ( - fun { name = name; style = style; deprecated_by = deprecated_by; + fun ({ name = name; style = style; deprecated_by = deprecated_by; non_c_aliases = non_c_aliases; - in_docs = in_docs; shortdesc = shortdesc } -> +...
2016 Sep 19
0
[PATCH 3/3] OCaml tools: add crypto support (RHBZ#1362649)
...sparsify/copying.ml +++ b/sparsify/copying.ml @@ -182,6 +182,9 @@ You can ignore this warning or change it to a hard failure using the g in + (* Decrypt the disks. *) + inspect_decrypt g; + (* Modify SIGINT handler (set first above) to cancel the handle. *) let do_sigint _ = g#user_cancel (); diff --git a/sparsify/in_place.ml b/sparsify/in_place.ml index e2ee9d9..5411892 100644 --- a/sparsify/in_place.ml +++ b/sparsify/in_place.ml @@ -57,6 +57,9 @@ let run disk format ignores machine_readable zeroes = if not (g#feature_available [|"fstrim"|]) then error ~exit_code:...
2016 Oct 03
3
[PATCH v2 0/2] New tool: virt-tail.
Nothing new in the virt-tail command itself, but the second commit includes a simple test. Rich.
2016 Oct 03
0
[PATCH v2 1/2] New tool: virt-tail.
...s (drvs); + free_mps (mps); + + guestfs_close (g); + + exit (r == 0 ? EXIT_SUCCESS : EXIT_FAILURE); +} + +struct follow { + int64_t mtime; /* For each file, last mtime. */ + int64_t size; /* For each file, last size. */ +}; + +static int quit = 0; + +static void +user_cancel (int sig) +{ + quit = 1; + ignore_value (guestfs_user_cancel (g)); +} + +static int +do_tail (int argc, char *argv[], /* list of files in the guest */ + struct drv *drvs, struct mp *mps) +{ + struct sigaction sa; + time_t drvt; + int first_iteration = 1; + int prev_file_displayed = -1...
2016 Oct 01
1
[PATCH] New tool: virt-tail.
This adds a new tool which does a follow operation (ie. tail -f) on one or more log/text files inside the guest. I've only done limited testing, but it works for me for tailing various long-running builds inside guests which I'm doing at the moment. There are no tests at present. Rich.
2016 Oct 03
0
[PATCH v3 1/2] New tool: virt-tail.
...+ free_mps (mps); + + guestfs_close (g); + + exit (r == 0 ? EXIT_SUCCESS : EXIT_FAILURE); +} + +struct follow { + int64_t mtime; /* For each file, last mtime. */ + int64_t size; /* For each file, last size. */ +}; + +static sig_atomic_t quit = 0; + +static void +user_cancel (int sig) +{ + quit = 1; + ignore_value (guestfs_user_cancel (g)); +} + +static int +do_tail (int argc, char *argv[], /* list of files in the guest */ + struct drv *drvs, struct mp *mps) +{ + struct sigaction sa; + time_t drvt; + int first_iteration = 1; + int prev_file_displayed = -1...
2016 Oct 03
1
Re: [PATCH v2 1/2] New tool: virt-tail.
...LURE); > +} > + > +struct follow { > + int64_t mtime; /* For each file, last mtime. */ > + int64_t size; /* For each file, last size. */ > +}; > + > +static int quit = 0; I guess this could be better as sig_atomic_t. > +static void > +user_cancel (int sig) > +{ > + quit = 1; > + ignore_value (guestfs_user_cancel (g)); > +} > + > +static int > +do_tail (int argc, char *argv[], /* list of files in the guest */ > + struct drv *drvs, struct mp *mps) > +{ > + struct sigaction sa; > + time_t drvt; >...
2016 Oct 03
3
[PATCH v3 0/2] New tool: virt-tail.
Since v2: - Fix the things that Pino mentioned, except the recursion. - Implement Windows support. For Windows support to be sane, I had to inline the add_and_mount code. Rich.
2016 Sep 19
6
[PATCH 0/3] add crypto/LUKS support in some OCaml-based tools
Hi, this series refactors some guestfish code (not much), and exposes it via Common_utils, so it is possible to decrypt LUKS partitions when using virt-customize, virt-get-kernel, virt-sparsify, and virt-sysprep. This brings them closer in features with C tools. Most probably a couple more of other OCaml-based tools (virt-v2v to convert encrypted guests, and virt-builder to use encrypted
2013 Jan 24
3
[REVIEW ONLY] Mountable patches
These 3 patches implement support for APIs which must accept a mountable, but don't update apis which must return mountables. Matt
2013 Feb 07
12
[PATCH 01/12] generator: Add new Mountable argument type
...;string option -> " | StringList _ | DeviceList _ -> pr "string array -> " | Bool _ -> pr "bool -> " diff --git a/generator/perl.ml b/generator/perl.ml index db11cb6..3b4108a 100644 --- a/generator/perl.ml +++ b/generator/perl.ml @@ -342,7 +342,7 @@ user_cancel (g) iteri ( fun i -> function - | Pathname n | Device n | Dev_or_Path n | String n + | Pathname n | Device n | Mountable n | Dev_or_Path n | String n | FileIn n | FileOut n | Key n -> pr " char *%s;\n" n...
2016 Mar 06
8
[PATCH 0/5] Use less stack.
Various changes/fixes to use smaller stack frames. Rich.
2016 Mar 07
2
[PATCH v2] Use less stack.
...proto.c +++ b/src/proto.c @@ -316,7 +316,7 @@ static int send_file_complete (guestfs_h *g); int guestfs_int_send_file (guestfs_h *g, const char *filename) { - char buf[GUESTFS_MAX_CHUNK_SIZE]; + CLEANUP_FREE char *buf = safe_malloc (g, GUESTFS_MAX_CHUNK_SIZE); int fd, r = 0, err; g->user_cancel = 0; @@ -332,7 +332,7 @@ guestfs_int_send_file (guestfs_h *g, const char *filename) /* Send file in chunked encoding. */ while (!g->user_cancel) { - r = read (fd, buf, sizeof buf); + r = read (fd, buf, GUESTFS_MAX_CHUNK_SIZE); if (r == -1 && (errno == EINTR || errno ==...