Am 10.07.2020 um 16:44 hat Peter Krempa geschrieben:
On Fri, Jul 10, 2020 at 16:33:38 +0200, Peter Krempa wrote:
> 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(-)
>
Kevin, Markus, could you please check, that he change from -drive
if=none to -blockdev is equivalent/makes sense in these cases.
Usage of SCSI hostdevs is finnicky as it tends to be used with weird
devices such as tape libraries. I've tested it only with scsi_debug.
Apart from the obvious differences shared with other cases (like
differences in QMP for using node names instead of -drive IDs), it looks
equivalent to me.
Kevin
> 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