From 8d5f5333c26951c8a87346b14a2e29e7897105b8 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Thu, 7 Jun 2018 12:03:00 +0200 Subject: [PATCH] qemu: process: clear QEMU_CAPS_BLOCKDEV for VMs with SD card MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Ján Tomko --- src/qemu/qemu_process.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 5d58031c42..20d0eecf92 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -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 -- GitLab