[PATCH RFC 10/39] qemu: process: clear QEMU_CAPS_BLOCKDEV for VMs where we can't support it

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

 



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@xxxxxxxxxx>
---
 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 27bd8b9465..8dd25e2736 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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux