X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=src%2Fguestfs.c;h=a3d27620a3d902715d64567c20af86e7f0074adc;hb=fab4298b6361fa62ac649fb885b62cf4ce84ad1b;hp=7cc09cead39a5fb4fc83cfc7dc2f96fb6fdbd441;hpb=cada248a53858341c91f70392e8f5b6e47d9b4fe;p=libguestfs.git diff --git a/src/guestfs.c b/src/guestfs.c index 7cc09ce..a3d2762 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");