X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=src%2Flaunch.c;h=a93ef0bd49053370421f405bac84351740b1a0a1;hb=3f54bd02fcf540f9b4b6edc93f3b6b9c7ba136bd;hp=ae1e10031c190b5c32428fe1c125df719a62e4c5;hpb=a8245283df4864ca1cc68127240b2f652aff972d;p=libguestfs.git diff --git a/src/launch.c b/src/launch.c index ae1e100..a93ef0b 100644 --- a/src/launch.c +++ b/src/launch.c @@ -521,6 +521,16 @@ launch_appliance (guestfs_h *g) alloc_cmdline (g); g->cmdline[0] = g->qemu; + /* CVE-2011-4127 mitigation: Disable SCSI ioctls on virtio-blk + * devices. The -global option must exist, but you can pass any + * strings to it so we don't need to check for the specific virtio + * feature. + */ + if (qemu_supports (g, "-global")) { + add_cmdline (g, "-global"); + add_cmdline (g, "virtio-blk-pci.scsi=off"); + } + if (qemu_supports (g, "-nodefconfig")) add_cmdline (g, "-nodefconfig"); @@ -530,7 +540,19 @@ launch_appliance (guestfs_h *g) */ if (qemu_supports (g, "-machine")) { add_cmdline (g, "-machine"); +#if QEMU_MACHINE_TYPE_IS_BROKEN + /* Workaround for qemu 0.15: We have to add the '[type=]pc' + * since there is no default. This is not a permanent solution + * because this only works on PC-like hardware. Other platforms + * like ppc would need a different machine type. + * + * This bug is fixed in qemu commit 2645c6dcaf6ea2a51a, and was + * not a problem in qemu < 0.15. + */ + add_cmdline (g, "pc,accel=kvm:tcg"); +#else add_cmdline (g, "accel=kvm:tcg"); +#endif } else { /* qemu sometimes needs this option to enable hardware * virtualization, but some versions of 'qemu-kvm' will use KVM