Help QEMU in deprecation of -drive if=none without the need to refactor
all old boards. Stop masking out -blockdev support when -drive if=sd
needs to be used. We achieve this by forbidding blockjobs and
special-casing all other code paths. Blockjobs are sacrificed in this
case as SD cards are a corner case for some ARM boards and are thus not
used commonly.
https://bugzilla.redhat.com/show_bug.cgi?id=1821692
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_process.c | 9 ---------
.../disk-arm-virtio-sd.aarch64-latest.args | 7 +++++--
2 files changed, 5 insertions(+), 11 deletions(-)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index b1751d4b52..dee3f3fb63 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -5488,7 +5488,6 @@ qemuProcessPrepareQEMUCaps(virDomainObjPtr vm,
unsigned int processStartFlags)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
- size_t i;
virObjectUnref(priv->qemuCaps);
if (!(priv->qemuCaps = virQEMUCapsCacheLookupCopy(qemuCapsCache,
@@ -5497,14 +5496,6 @@ qemuProcessPrepareQEMUCaps(virDomainObjPtr vm,
vm->def->os.machine)))
return -1;
- /* clear the 'blockdev' capability for VMs which have disks that need -drive
*/
- for (i = 0; i < vm->def->ndisks; i++) {
- if (qemuDiskBusIsSD(vm->def->disks[i]->bus)) {
- virQEMUCapsClear(priv->qemuCaps, QEMU_CAPS_BLOCKDEV);
- break;
- }
- }
-
if (processStartFlags & VIR_QEMU_PROCESS_START_STANDALONE)
virQEMUCapsClear(priv->qemuCaps, QEMU_CAPS_CHARDEV_FD_PASS);
diff --git a/tests/qemuxml2argvdata/disk-arm-virtio-sd.aarch64-latest.args
b/tests/qemuxml2argvdata/disk-arm-virtio-sd.aarch64-latest.args
index 7147dfee76..f17dd2157a 100644
--- a/tests/qemuxml2argvdata/disk-arm-virtio-sd.aarch64-latest.args
+++ b/tests/qemuxml2argvdata/disk-arm-virtio-sd.aarch64-latest.args
@@ -33,8 +33,11 @@ file=/tmp/lib/domain--1-armtest/master-key.aes \
-dtb /arm.dtb \
-usb \
-drive file=/arm-sd.qcow2,format=qcow2,if=sd,index=0 \
--drive file=/arm-virtio.qcow2,format=qcow2,if=none,id=drive-virtio-disk0 \
--device virtio-blk-device,scsi=off,drive=drive-virtio-disk0,id=virtio-disk0 \
+-blockdev
'{"driver":"file","filename":"/arm-virtio.qcow2",\
+"node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}'
\
+-blockdev
'{"node-name":"libvirt-1-format","read-only":false,"driver":"qcow2",\
+"file":"libvirt-1-storage"}' \
+-device virtio-blk-device,scsi=off,drive=libvirt-1-format,id=virtio-disk0 \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
resourcecontrol=deny \
-msg timestamp=on
--
2.26.2