Richard W.M. Jones
2010-Jul-07 14:06 UTC
[Libguestfs] [PATCH] fish: Don't fail if -m and --listen flags are both given (RHBZ#612178).
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://et.redhat.com/~rjones/libguestfs/ See what it can do: http://et.redhat.com/~rjones/libguestfs/recipes.html -------------- next part -------------->From 8161ea9bb046c8450384b5b15e1f4b2f3dca582b Mon Sep 17 00:00:00 2001From: Richard Jones <rjones at redhat.com> Date: Wed, 7 Jul 2010 15:01:38 +0100 Subject: [PATCH] fish: Don't fail if -m and --listen flags are both given (RHBZ#612178). Testing this against a Fedora disk image: $ ./fish/guestfish --ro -a F13.img -m /dev/sda1 --listen export GUESTFISH_PID=6033 $ ./fish/guestfish --remote=6033 -- ping-daemon $ ./fish/guestfish --remote=6033 -- ping-daemon $ ./fish/guestfish --remote=6033 -- exit Without this fix the first remote command would fail because qemu would have already been killed. --- fish/fish.c | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/fish/fish.c b/fish/fish.c index 470c625..4276ae1 100644 --- a/fish/fish.c +++ b/fish/fish.c @@ -476,6 +476,17 @@ main (int argc, char *argv[]) * guest and mount them. */ if (next_prepared_drive > 1 || mps != NULL) { + /* RHBZ#612178: If --listen flag is given, then we will fork into + * the background in rc_listen(). However you can't do this while + * holding a libguestfs handle open because the recovery process + * will think the main program has died and kill qemu. Therefore + * don't use the recovery process for this case. (A better + * solution would be to call launch () etc after the fork, but + * that greatly complicates the code here). + */ + if (remote_control_listen) + guestfs_set_recovery_proc (g, 0); + if (launch () == -1) exit (EXIT_FAILURE); prepare_drives (drvs); mount_mps (mps); -- 1.7.1
Seemingly Similar Threads
- [PATCH] fish: help command return error for non-existent commands (RHBZ#597145).
- [PATCH] daemon: Parse output of old parted which didn't support -m option (RHBZ#598309).
- [PATCH] Don't run new-kernel-pkg or nscd (RHBZ#557262).
- [PATCH] parted: Don't return "loop" for non-partitioned devices (RHBZ#634246).
- [PATCH] supermin: Die with an error if no kernels found (RHBZ#539746).