[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH 17/55] qemu: process: clear QEMU_CAPS_BLOCKDEV for VMs where we can't support it



SD cards are currently passed by using -drive only which would not be
compatible with using -blockdev fully.

Floppies at least in the case of the i440 machine type don't have a
reasonable qdev ID if -drive is not used and thus would not allow
queries and other operations. Since floppy drives are obsolete anyways
clear blockdev when using them.

Clear QEMU_CAPS_BLOCKDEV if the VM has such devices.

Signed-off-by: Peter Krempa <pkrempa redhat com>
---
 src/qemu/qemu_process.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index c4e33723d1..6b59dbc1c3 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -5884,6 +5884,16 @@ 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) ||
+            vm->def->disks[i]->bus == VIR_DOMAIN_DISK_BUS_FDC) {
+            virQEMUCapsClear(priv->qemuCaps, QEMU_CAPS_BLOCKDEV);
+            break;
+        }
+    }
+
     /*
      * Normally PCI addresses are assigned in the virDomainCreate
      * or virDomainDefine methods. We might still need to assign
-- 
2.16.2


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]