提交 3bcbdc51 编写于 作者: P Peter Krempa

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=1821692Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
上级 e664abb6
......@@ -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);
......
......@@ -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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册