]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: process: clear QEMU_CAPS_BLOCKDEV for VMs with SD card
authorPeter Krempa <pkrempa@redhat.com>
Thu, 7 Jun 2018 10:03:00 +0000 (12:03 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 21 Aug 2018 13:46:06 +0000 (15:46 +0200)
SD cards are currently passed by using -drive only which would not be
compatible with using -blockdev fully.

Clear QEMU_CAPS_BLOCKDEV if the VM has such devices.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_process.c

index 5d58031c42b951483fa80f44c4ca301176521599..20d0eecf927e7f9e66bf13a9b8660cd6d4820b5e 100644 (file)
@@ -5885,6 +5885,15 @@ qemuProcessPrepareDomain(virQEMUDriverPtr driver,
 
     qemuProcessPrepareAllowReboot(vm);
 
+    /* clear the 'blockdev' capability for VMs which have disks that need
+     * -drive or which have floppies where we can't reliably get the QOM path */
+    for (i = 0; i < vm->def->ndisks; i++) {
+        if (qemuDiskBusNeedsDriveArg(vm->def->disks[i]->bus)) {
+            virQEMUCapsClear(priv->qemuCaps, QEMU_CAPS_BLOCKDEV);
+            break;
+        }
+    }
+
     /*
      * Normally PCI addresses are assigned in the virDomainCreate
      * or virDomainDefine methods. We might still need to assign