summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard Jones <rjones@redhat.com>2010-01-07 12:21:42 +0000
committerRichard Jones <rjones@redhat.com>2010-01-07 13:31:19 +0000
commitb4a4db522fed542f48aa60717e65061c5e83c919 (patch)
treeda6b1ef13150ffec12341d70c1a12095a942aa94 /src
parentce68503d5c74585f7f4df8a9ad3d54f927dfbcad (diff)
downloadlibguestfs-b4a4db522fed542f48aa60717e65061c5e83c919.tar.gz
libguestfs-b4a4db522fed542f48aa60717e65061c5e83c919.tar.xz
libguestfs-b4a4db522fed542f48aa60717e65061c5e83c919.zip
qemu: Upstream regression of -stdio serial option.
Best explained by the comment in the code: /* Newer versions of qemu (from around 2009/12) changed the * behaviour of monitors so that an implicit '-monitor stdio' is * assumed if we are in -nographic mode and there is no other * -monitor option. Only a single stdio device is allowed, so * this broke the '-serial stdio' option. There is a new flag * called -nodefaults which gets rid of all this default crud, so * let's use that to avoid this and any future surprises. */
Diffstat (limited to 'src')
-rw-r--r--src/guestfs.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/guestfs.c b/src/guestfs.c
index 7cc09cea..a3d27620 100644
--- a/src/guestfs.c
+++ b/src/guestfs.c
@@ -1091,15 +1091,28 @@ guestfs__launch (guestfs_h *g)
*/
g->cmdline[0] = g->qemu;
- snprintf (buf, sizeof buf, "%d", g->memsize);
- add_cmdline (g, "-m");
- add_cmdline (g, buf);
+ /* Newer versions of qemu (from around 2009/12) changed the
+ * behaviour of monitors so that an implicit '-monitor stdio' is
+ * assumed if we are in -nographic mode and there is no other
+ * -monitor option. Only a single stdio device is allowed, so
+ * this broke the '-serial stdio' option. There is a new flag
+ * called -nodefaults which gets rid of all this default crud, so
+ * let's use that to avoid this and any future surprises.
+ */
+ if (qemu_supports (g, "-nodefaults"))
+ add_cmdline (g, "-nodefaults");
- add_cmdline (g, "-no-reboot"); /* Force exit instead of reboot on panic */
add_cmdline (g, "-nographic");
add_cmdline (g, "-serial");
add_cmdline (g, "stdio");
+ snprintf (buf, sizeof buf, "%d", g->memsize);
+ add_cmdline (g, "-m");
+ add_cmdline (g, buf);
+
+ /* Force exit instead of reboot on panic */
+ add_cmdline (g, "-no-reboot");
+
/* These options recommended by KVM developers to improve reliability. */
if (qemu_supports (g, "-no-hpet"))
add_cmdline (g, "-no-hpet");