X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=fish%2Ffish.c;h=3dc380a2bd32e38540f978e832fb115dcbd21ce4;hb=5222be29f81fb98f0448d6e289c2c486fbc56883;hp=a6db0857db3f2d9f384bce506f623b11aff00638;hpb=4b845ee849632985d7ab5a59ac28184f4c9643e5;p=libguestfs.git diff --git a/fish/fish.c b/fish/fish.c index a6db085..3dc380a 100644 --- a/fish/fish.c +++ b/fish/fish.c @@ -20,6 +20,7 @@ #include #include +#include #include #include #include @@ -98,7 +99,7 @@ usage (int status) fprintf (stdout, _("%s: guest filesystem shell\n" "%s lets you edit virtual machine filesystems\n" - "Copyright (C) 2009 Red Hat Inc.\n" + "Copyright (C) 2009-2010 Red Hat Inc.\n" "Usage:\n" " %s [--options] cmd [: cmd : cmd ...]\n" " %s -i libvirt-domain\n" @@ -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); } @@ -1005,10 +1020,7 @@ display_builtin_command (const char *cmd) " running \"cat\", editing locally, and then \"write-file\".\n" "\n" " Normally it uses $EDITOR, but if you use the aliases\n" - " \"vi\" or \"emacs\" you will get those editors.\n" - "\n" - " NOTE: This will not work reliably for large files\n" - " (> 2 MB) or binary files containing \\0 bytes.\n")); + " \"vi\" or \"emacs\" you will get those editors.\n")); return 0; } else if (STRCASEEQ (cmd, "lcd")) { @@ -1046,10 +1058,7 @@ display_builtin_command (const char *cmd) " running \"cat\" and using the pager.\n" "\n" " Normally it uses $PAGER, but if you use the alias\n" - " \"less\" then it always uses \"less\".\n" - "\n" - " NOTE: This will not work reliably for large files\n" - " (> 2 MB) or binary files containing \\0 bytes.\n")); + " \"less\" then it always uses \"less\".\n")); return 0; } else if (STRCASEEQ (cmd, "quit") ||