]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Assume QEMU_CAPS_DISK_SHARE_RW
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 8 Nov 2022 07:36:08 +0000 (08:36 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 8 Nov 2022 11:10:50 +0000 (12:10 +0100)
Introduced in QEMU's commit of v2.9.0-rc0~48^2~25 the .share-rw
attribute of virtio-blk device is always available for all QEMU
versions we support (4.2.0, currently). Therefore, we can assume
the capability is always set and thus doesn't need to be checked
for.

The change in controller-order.args is justified, because the
qemuxml2argvdatatest runs the test case with very minimalistic
set of capabilities, that's nowhere near real life scenario.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_command.c
tests/qemuxml2argvdata/controller-order.args

index b0c9fb70591c8fb97494fc7fe6c1bc1c4c57d351..f775170e32ce14d788a0a02f3ab40a60882faf5c 100644 (file)
@@ -1871,8 +1871,7 @@ qemuBuildDiskDeviceProps(const virDomainDef *def,
     if (qemuBuildDeviceAddressProps(props, def, &disk->info) < 0)
         return NULL;
 
-    if (disk->src->shared &&
-        virQEMUCapsGet(qemuCaps, QEMU_CAPS_DISK_SHARE_RW))
+    if (disk->src->shared)
         shareRW = VIR_TRISTATE_SWITCH_ON;
 
     if (virStorageSourceGetActualType(disk->src) == VIR_STORAGE_TYPE_VHOST_USER) {
index fd9eba459a2e6a7fc1830792e5db6cc601ed0878..c0ba064becf9709fb4f1db880d9e6178a325cd94 100644 (file)
@@ -29,7 +29,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-fdr/.config \
 -device usb-ccid,id=ccid0,bus=usb.0,port=1.1 \
 -blockdev '{"driver":"file","filename":"/tmp/fdr.img","aio":"native","node-name":"libvirt-2-storage","cache":{"direct":true,"no-flush":false},"auto-read-only":true,"discard":"unmap"}' \
 -blockdev '{"node-name":"libvirt-2-format","read-only":false,"cache":{"direct":true,"no-flush":false},"driver":"raw","file":"libvirt-2-storage"}' \
--device virtio-blk-pci,bus=pci.0,addr=0x5,drive=libvirt-2-format,id=virtio-disk0,bootindex=1 \
+-device virtio-blk-pci,bus=pci.0,addr=0x5,share-rw=on,drive=libvirt-2-format,id=virtio-disk0,bootindex=1 \
 -blockdev '{"driver":"file","filename":"/tmp/Fedora-17-x86_64-Live-Desktop.iso","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \
 -blockdev '{"node-name":"libvirt-1-format","read-only":true,"driver":"raw","file":"libvirt-1-storage"}' \
 -device ide-cd,bus=ide.1,unit=0,drive=libvirt-1-format,id=ide0-1-0 \