X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=fish%2Ffish.c;h=e4dab917d2511b923773c5ea47481ebde177d354;hb=4feaaa4750ce382f5a349449d9c171051dc40a8f;hp=a6db0857db3f2d9f384bce506f623b11aff00638;hpb=4b845ee849632985d7ab5a59ac28184f4c9643e5;p=libguestfs.git diff --git a/fish/fish.c b/fish/fish.c index a6db085..e4dab91 100644 --- a/fish/fish.c +++ b/fish/fish.c @@ -20,6 +20,7 @@ #include #include +#include #include #include #include @@ -126,7 +127,7 @@ usage (int status) " -v|--verbose Verbose messages\n" " -x Echo each command before executing it\n" " -V|--version Display version and exit\n" - "For more information, see the manpage %s(1).\n"), + "For more information, see the manpage %s(1).\n"), program_name, program_name, program_name, program_name, program_name, program_name, program_name, program_name, program_name); @@ -324,9 +325,12 @@ main (int argc, char *argv[]) guestfs_set_verbose (g, verbose); break; - case 'V': - printf ("%s %s\n", program_name, PACKAGE_VERSION); + case 'V': { + struct guestfs_version *v = guestfs_version (g); + printf ("%s %"PRIi64".%"PRIi64".%"PRIi64"%s\n", program_name, + v->major, v->minor, v->release, v->extra); exit (EXIT_SUCCESS); + } case 'x': guestfs_set_trace (g, 1); @@ -405,6 +409,17 @@ main (int argc, char *argv[]) /* If we've got mountpoints, we must launch the guest and mount them. */ if (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 (g) == -1) exit (EXIT_FAILURE); mount_mps (mps); }