Enable it when regular QEMU_CAPS_BLOCKDEV is present.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_capabilities.c | 3 ++
.../caps_4.2.0.aarch64.xml | 1 +
.../qemucapabilitiesdata/caps_4.2.0.s390x.xml | 1 +
.../caps_4.2.0.x86_64.xml | 1 +
.../caps_5.0.0.aarch64.xml | 1 +
.../qemucapabilitiesdata/caps_5.0.0.ppc64.xml | 1 +
.../caps_5.0.0.riscv64.xml | 1 +
.../caps_5.0.0.x86_64.xml | 1 +
.../caps_5.1.0.x86_64.xml | 1 +
.../hostdev-scsi-lsi.x86_64-latest.args | 52 +++++++++++--------
...ostdev-scsi-virtio-scsi.x86_64-latest.args | 46 ++++++++--------
11 files changed, 65 insertions(+), 44 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index cc54ad9283..d6bfec9996 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -5124,6 +5124,9 @@ virQEMUCapsInitProcessCapsInterlock(virQEMUCapsPtr qemuCaps)
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_USB_STORAGE_WERROR)) {
virQEMUCapsClear(qemuCaps, QEMU_CAPS_STORAGE_WERROR);
}
+
+ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV))
+ virQEMUCapsSet(qemuCaps, QEMU_CAPS_BLOCKDEV_HOSTDEV_SCSI);
}
diff --git a/tests/qemucapabilitiesdata/caps_4.2.0.aarch64.xml
b/tests/qemucapabilitiesdata/caps_4.2.0.aarch64.xml
index 98cee36669..11a964ed39 100644
--- a/tests/qemucapabilitiesdata/caps_4.2.0.aarch64.xml
+++ b/tests/qemucapabilitiesdata/caps_4.2.0.aarch64.xml
@@ -188,6 +188,7 @@
<flag name='migration-param.bandwidth'/>
<flag name='migration-param.downtime'/>
<flag name='migration-param.xbzrle-cache-size'/>
+ <flag name='blockdev-hostdev-scsi'/>
<version>4001050</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>61700242</microcodeVersion>
diff --git a/tests/qemucapabilitiesdata/caps_4.2.0.s390x.xml
b/tests/qemucapabilitiesdata/caps_4.2.0.s390x.xml
index 0b174ffeec..76e2747b65 100644
--- a/tests/qemucapabilitiesdata/caps_4.2.0.s390x.xml
+++ b/tests/qemucapabilitiesdata/caps_4.2.0.s390x.xml
@@ -152,6 +152,7 @@
<flag name='migration-param.bandwidth'/>
<flag name='migration-param.downtime'/>
<flag name='migration-param.xbzrle-cache-size'/>
+ <flag name='blockdev-hostdev-scsi'/>
<version>4002000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>39100242</microcodeVersion>
diff --git a/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml
b/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml
index 91ce30ba44..fd63a0ee02 100644
--- a/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml
@@ -235,6 +235,7 @@
<flag name='migration-param.downtime'/>
<flag name='migration-param.xbzrle-cache-size'/>
<flag name='intel-iommu.aw-bits'/>
+ <flag name='blockdev-hostdev-scsi'/>
<version>4002000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>43100242</microcodeVersion>
diff --git a/tests/qemucapabilitiesdata/caps_5.0.0.aarch64.xml
b/tests/qemucapabilitiesdata/caps_5.0.0.aarch64.xml
index 9446ddc22a..928af2a01c 100644
--- a/tests/qemucapabilitiesdata/caps_5.0.0.aarch64.xml
+++ b/tests/qemucapabilitiesdata/caps_5.0.0.aarch64.xml
@@ -198,6 +198,7 @@
<flag name='migration-param.downtime'/>
<flag name='migration-param.xbzrle-cache-size'/>
<flag name='numa.hmat'/>
+ <flag name='blockdev-hostdev-scsi'/>
<version>5000000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>61700241</microcodeVersion>
diff --git a/tests/qemucapabilitiesdata/caps_5.0.0.ppc64.xml
b/tests/qemucapabilitiesdata/caps_5.0.0.ppc64.xml
index 8c371a045b..e8668a25a9 100644
--- a/tests/qemucapabilitiesdata/caps_5.0.0.ppc64.xml
+++ b/tests/qemucapabilitiesdata/caps_5.0.0.ppc64.xml
@@ -207,6 +207,7 @@
<flag name='migration-param.xbzrle-cache-size'/>
<flag name='spapr-tpm-proxy'/>
<flag name='numa.hmat'/>
+ <flag name='blockdev-hostdev-scsi'/>
<version>5000000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>42900241</microcodeVersion>
diff --git a/tests/qemucapabilitiesdata/caps_5.0.0.riscv64.xml
b/tests/qemucapabilitiesdata/caps_5.0.0.riscv64.xml
index 15c9d54332..85a8a46dac 100644
--- a/tests/qemucapabilitiesdata/caps_5.0.0.riscv64.xml
+++ b/tests/qemucapabilitiesdata/caps_5.0.0.riscv64.xml
@@ -194,6 +194,7 @@
<flag name='migration-param.downtime'/>
<flag name='migration-param.xbzrle-cache-size'/>
<flag name='numa.hmat'/>
+ <flag name='blockdev-hostdev-scsi'/>
<version>5000000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>0</microcodeVersion>
diff --git a/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml
b/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml
index dafca26b89..546b9b0422 100644
--- a/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml
@@ -242,6 +242,7 @@
<flag name='migration-param.xbzrle-cache-size'/>
<flag name='intel-iommu.aw-bits'/>
<flag name='numa.hmat'/>
+ <flag name='blockdev-hostdev-scsi'/>
<version>5000000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>43100241</microcodeVersion>
diff --git a/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml
b/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml
index bd6e83ccaf..e05290fcfe 100644
--- a/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml
@@ -242,6 +242,7 @@
<flag name='migration-param.xbzrle-cache-size'/>
<flag name='intel-iommu.aw-bits'/>
<flag name='numa.hmat'/>
+ <flag name='blockdev-hostdev-scsi'/>
<version>5000050</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>43100242</microcodeVersion>
diff --git a/tests/qemuxml2argvdata/hostdev-scsi-lsi.x86_64-latest.args
b/tests/qemuxml2argvdata/hostdev-scsi-lsi.x86_64-latest.args
index 76a0708336..d4599f6002 100644
--- a/tests/qemuxml2argvdata/hostdev-scsi-lsi.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/hostdev-scsi-lsi.x86_64-latest.args
@@ -34,34 +34,42 @@ file=/tmp/lib/domain--1-QEMUGuest2/master-key.aes \
-blockdev
'{"node-name":"libvirt-1-format","read-only":false,"driver":"raw",\
"file":"libvirt-1-storage"}' \
-device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \
--drive file=/dev/sg0,if=none,format=raw,id=drive-hostdev0 \
--device scsi-generic,bus=scsi0.0,scsi-id=7,drive=drive-hostdev0,id=hostdev0 \
--drive file=/dev/sg0,if=none,format=raw,id=drive-hostdev1,readonly=on \
--device scsi-generic,bus=scsi0.0,scsi-id=6,drive=drive-hostdev1,id=hostdev1 \
--drive file.driver=iscsi,file.portal=example.org:3260,\
-file.target=iqn.1992-01.com.example,file.lun=0,file.transport=tcp,if=none,\
-format=raw,id=drive-hostdev2 \
--device scsi-generic,bus=scsi0.0,scsi-id=4,drive=drive-hostdev2,id=hostdev2 \
--drive file.driver=iscsi,file.portal=example.org:3260,\
-file.target=iqn.1992-01.com.example,file.lun=1,file.transport=tcp,if=none,\
-format=raw,id=drive-hostdev3 \
--device scsi-generic,bus=scsi0.0,scsi-id=5,drive=drive-hostdev3,id=hostdev3 \
+-blockdev
'{"driver":"host_device","filename":"/dev/sg0",\
+"node-name":"libvirt-hostdev0-backend","read-only":false}'
\
+-device scsi-generic,bus=scsi0.0,scsi-id=7,drive=libvirt-hostdev0-backend,\
+id=hostdev0 \
+-blockdev
'{"driver":"host_device","filename":"/dev/sg0",\
+"node-name":"libvirt-hostdev1-backend","read-only":true}'
\
+-device scsi-generic,bus=scsi0.0,scsi-id=6,drive=libvirt-hostdev1-backend,\
+id=hostdev1 \
+-blockdev
'{"driver":"iscsi","portal":"example.org:3260",\
+"target":"iqn.1992-01.com.example","lun":0,"transport":"tcp",\
+"node-name":"libvirt-hostdev2-backend","read-only":false}'
\
+-device scsi-generic,bus=scsi0.0,scsi-id=4,drive=libvirt-hostdev2-backend,\
+id=hostdev2 \
+-blockdev
'{"driver":"iscsi","portal":"example.org:3260",\
+"target":"iqn.1992-01.com.example","lun":1,"transport":"tcp",\
+"node-name":"libvirt-hostdev3-backend","read-only":false}'
\
+-device scsi-generic,bus=scsi0.0,scsi-id=5,drive=libvirt-hostdev3-backend,\
+id=hostdev3 \
-object secret,id=hostdev4-secret0,\
data=9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,\
keyid=masterKey0,iv=AAECAwQFBgcICQoLDA0ODw==,format=base64 \
--drive file.driver=iscsi,file.portal=example.org:3260,\
-file.target=iqn.1992-01.com.example:storage,file.lun=1,file.transport=tcp,\
-file.user=myname,file.password-secret=hostdev4-secret0,if=none,format=raw,\
-id=drive-hostdev4 \
--device scsi-generic,bus=scsi0.0,scsi-id=3,drive=drive-hostdev4,id=hostdev4 \
+-blockdev
'{"driver":"iscsi","portal":"example.org:3260",\
+"target":"iqn.1992-01.com.example:storage","lun":1,"transport":"tcp",\
+"user":"myname","password-secret":"hostdev4-secret0",\
+"node-name":"libvirt-hostdev4-backend","read-only":false}'
\
+-device scsi-generic,bus=scsi0.0,scsi-id=3,drive=libvirt-hostdev4-backend,\
+id=hostdev4 \
-object secret,id=hostdev5-secret0,\
data=9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,\
keyid=masterKey0,iv=AAECAwQFBgcICQoLDA0ODw==,format=base64 \
--drive file.driver=iscsi,file.portal=example.org:3260,\
-file.target=iqn.1992-01.com.example:storage,file.lun=2,file.transport=tcp,\
-file.user=myname,file.password-secret=hostdev5-secret0,if=none,format=raw,\
-id=drive-hostdev5 \
--device scsi-generic,bus=scsi0.0,scsi-id=2,drive=drive-hostdev5,id=hostdev5 \
+-blockdev
'{"driver":"iscsi","portal":"example.org:3260",\
+"target":"iqn.1992-01.com.example:storage","lun":2,"transport":"tcp",\
+"user":"myname","password-secret":"hostdev5-secret0",\
+"node-name":"libvirt-hostdev5-backend","read-only":false}'
\
+-device scsi-generic,bus=scsi0.0,scsi-id=2,drive=libvirt-hostdev5-backend,\
+id=hostdev5 \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
resourcecontrol=deny \
diff --git a/tests/qemuxml2argvdata/hostdev-scsi-virtio-scsi.x86_64-latest.args
b/tests/qemuxml2argvdata/hostdev-scsi-virtio-scsi.x86_64-latest.args
index 99b0117447..72980d58b8 100644
--- a/tests/qemuxml2argvdata/hostdev-scsi-virtio-scsi.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/hostdev-scsi-virtio-scsi.x86_64-latest.args
@@ -34,40 +34,42 @@ file=/tmp/lib/domain--1-QEMUGuest2/master-key.aes \
-blockdev
'{"node-name":"libvirt-1-format","read-only":false,"driver":"raw",\
"file":"libvirt-1-storage"}' \
-device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \
--drive file=/dev/sg0,if=none,format=raw,id=drive-hostdev0 \
+-blockdev
'{"driver":"host_device","filename":"/dev/sg0",\
+"node-name":"libvirt-hostdev0-backend","read-only":false}'
\
-device scsi-generic,bus=scsi0.0,channel=0,scsi-id=4,lun=8,\
-drive=drive-hostdev0,id=hostdev0 \
--drive file=/dev/sg0,if=none,format=raw,id=drive-hostdev1,readonly=on \
+drive=libvirt-hostdev0-backend,id=hostdev0 \
+-blockdev
'{"driver":"host_device","filename":"/dev/sg0",\
+"node-name":"libvirt-hostdev1-backend","read-only":true}'
\
-device scsi-generic,bus=scsi0.0,channel=0,scsi-id=4,lun=7,\
-drive=drive-hostdev1,id=hostdev1 \
--drive file.driver=iscsi,file.portal=example.org:3260,\
-file.target=iqn.1992-01.com.example,file.lun=0,file.transport=tcp,if=none,\
-format=raw,id=drive-hostdev2 \
+drive=libvirt-hostdev1-backend,id=hostdev1 \
+-blockdev
'{"driver":"iscsi","portal":"example.org:3260",\
+"target":"iqn.1992-01.com.example","lun":0,"transport":"tcp",\
+"node-name":"libvirt-hostdev2-backend","read-only":false}'
\
-device scsi-generic,bus=scsi0.0,channel=0,scsi-id=2,lun=4,\
-drive=drive-hostdev2,id=hostdev2 \
--drive file.driver=iscsi,file.portal=example.org:3260,\
-file.target=iqn.1992-01.com.example,file.lun=1,file.transport=tcp,if=none,\
-format=raw,id=drive-hostdev3 \
+drive=libvirt-hostdev2-backend,id=hostdev2 \
+-blockdev
'{"driver":"iscsi","portal":"example.org:3260",\
+"target":"iqn.1992-01.com.example","lun":1,"transport":"tcp",\
+"node-name":"libvirt-hostdev3-backend","read-only":false}'
\
-device scsi-generic,bus=scsi0.0,channel=0,scsi-id=2,lun=5,\
-drive=drive-hostdev3,id=hostdev3 \
+drive=libvirt-hostdev3-backend,id=hostdev3 \
-object secret,id=hostdev4-secret0,\
data=9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,\
keyid=masterKey0,iv=AAECAwQFBgcICQoLDA0ODw==,format=base64 \
--drive file.driver=iscsi,file.portal=example.org:3260,\
-file.target=iqn.1992-01.com.example:storage,file.lun=1,file.transport=tcp,\
-file.user=myname,file.password-secret=hostdev4-secret0,if=none,format=raw,\
-id=drive-hostdev4 \
+-blockdev
'{"driver":"iscsi","portal":"example.org:3260",\
+"target":"iqn.1992-01.com.example:storage","lun":1,"transport":"tcp",\
+"user":"myname","password-secret":"hostdev4-secret0",\
+"node-name":"libvirt-hostdev4-backend","read-only":false}'
\
-device scsi-generic,bus=scsi0.0,channel=0,scsi-id=3,lun=4,\
-drive=drive-hostdev4,id=hostdev4 \
+drive=libvirt-hostdev4-backend,id=hostdev4 \
-object secret,id=hostdev5-secret0,\
data=9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,\
keyid=masterKey0,iv=AAECAwQFBgcICQoLDA0ODw==,format=base64 \
--drive file.driver=iscsi,file.portal=example.org:3260,\
-file.target=iqn.1992-01.com.example:storage,file.lun=2,file.transport=tcp,\
-file.user=myname,file.password-secret=hostdev5-secret0,if=none,format=raw,\
-id=drive-hostdev5 \
+-blockdev
'{"driver":"iscsi","portal":"example.org:3260",\
+"target":"iqn.1992-01.com.example:storage","lun":2,"transport":"tcp",\
+"user":"myname","password-secret":"hostdev5-secret0",\
+"node-name":"libvirt-hostdev5-backend","read-only":false}'
\
-device scsi-generic,bus=scsi0.0,channel=0,scsi-id=3,lun=5,\
-drive=drive-hostdev5,id=hostdev5 \
+drive=libvirt-hostdev5-backend,id=hostdev5 \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
resourcecontrol=deny \
--
2.26.2