1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-22 17:34:18 +03:00

qemu: process: Don't clear QEMU_CAPS_BLOCKDEV when SD card is present

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@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Peter Krempa 2020-05-06 13:50:03 +02:00
parent e664abb62e
commit 3bcbdc51da
2 changed files with 5 additions and 11 deletions

View File

@ -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);

View File

@ -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