[libvirt] [PATCH v3 09/10] tests: Introduce basic vhost-scsi test

John Ferlan jferlan at redhat.com
Fri Nov 11 21:55:48 UTC 2016



On 11/08/2016 01:26 PM, Eric Farman wrote:
> These tests were cloned from hostdev-scsi-virtio-scsi in both
> xml2argv and xml2xml
> 
> Signed-off-by: Eric Farman <farman at linux.vnet.ibm.com>
> Reviewed-by: Boris Fiuczynski <fiuczy at linux.vnet.ibm.com>
> ---
>  .../qemuxml2argv-hostdev-scsi-vhost-scsi.args      | 24 +++++++++++++
>  .../qemuxml2argv-hostdev-scsi-vhost-scsi.xml       | 41 ++++++++++++++++++++++
>  tests/qemuxml2argvtest.c                           |  3 ++
>  .../qemuxml2xmlout-hostdev-scsi-vhost-scsi.xml     |  1 +
>  tests/qemuxml2xmltest.c                            |  3 ++
>  5 files changed, 72 insertions(+)
>  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-vhost-scsi.args
>  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-vhost-scsi.xml
>  create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-hostdev-scsi-vhost-scsi.xml
> 

Although nice to have the separation now - this would certainly be
merged with patch7...

Probably should add a CCW output test too.

John

> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-vhost-scsi.args b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-vhost-scsi.args
> new file mode 100644
> index 0000000..5cd2939
> --- /dev/null
> +++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-vhost-scsi.args
> @@ -0,0 +1,24 @@
> +LC_ALL=C \
> +PATH=/bin \
> +HOME=/home/test \
> +USER=test \
> +LOGNAME=test \
> +QEMU_AUDIO_DRV=none \
> +/usr/bin/qemu \
> +-name QEMUGuest2 \
> +-S \
> +-M pc \
> +-m 214 \
> +-smp 1,sockets=1,cores=1,threads=1 \
> +-uuid c7a5fdbd-edaf-9466-926a-d65c16db1809 \
> +-nographic \
> +-nodefaults \
> +-monitor unix:/tmp/lib/domain--1-QEMUGuest2/monitor.sock,server,nowait \
> +-no-acpi \
> +-boot c \
> +-device virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x3 \
> +-usb \
> +-drive file=/dev/HostVG/QEMUGuest2,format=raw,if=none,id=drive-ide0-0-0 \
> +-device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
> +-device vhost-scsi-pci,wwpn=naa.5123456789abcde0,vhostfd=3,id=hostdev0 \

Note: lack of address...

> +-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4
> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-vhost-scsi.xml b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-vhost-scsi.xml
> new file mode 100644
> index 0000000..4d57fb8
> --- /dev/null
> +++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-vhost-scsi.xml
> @@ -0,0 +1,41 @@
> +<domain type='qemu'>
> +  <name>QEMUGuest2</name>
> +  <uuid>c7a5fdbd-edaf-9466-926a-d65c16db1809</uuid>
> +  <memory unit='KiB'>219100</memory>
> +  <currentMemory unit='KiB'>219100</currentMemory>
> +  <vcpu placement='static'>1</vcpu>
> +  <os>
> +    <type arch='i686' machine='pc'>hvm</type>
> +    <boot dev='hd'/>
> +  </os>
> +  <clock offset='utc'/>
> +  <on_poweroff>destroy</on_poweroff>
> +  <on_reboot>restart</on_reboot>
> +  <on_crash>destroy</on_crash>
> +  <devices>
> +    <emulator>/usr/bin/qemu</emulator>
> +    <disk type='block' device='disk'>
> +      <source dev='/dev/HostVG/QEMUGuest2'/>
> +      <target dev='hda' bus='ide'/>
> +      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
> +    </disk>
> +    <controller type='scsi' index='0' model='virtio-scsi'>
> +      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
> +    </controller>
> +    <controller type='usb' index='0'>
> +      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
> +    </controller>
> +    <controller type='ide' index='0'>
> +      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
> +    </controller>
> +    <controller type='pci' index='0' model='pci-root'/>
> +    <input type='mouse' bus='ps2'/>
> +    <input type='keyboard' bus='ps2'/>
> +    <hostdev mode='subsystem' type='scsi_host' managed='no'>
> +      <source protocol='vhost' wwpn='naa.5123456789abcde0'/>
> +    </hostdev>
> +    <memballoon model='virtio'>
> +      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
> +    </memballoon>
> +  </devices>
> +</domain>
> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
> index d025930..cfa1c85 100644
> --- a/tests/qemuxml2argvtest.c
> +++ b/tests/qemuxml2argvtest.c
> @@ -1886,6 +1886,9 @@ mymain(void)
>      DO_TEST("hostdev-scsi-virtio-iscsi-auth",
>              QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_VIRTIO_SCSI,
>              QEMU_CAPS_DEVICE_SCSI_GENERIC);
> +    DO_TEST("hostdev-scsi-vhost-scsi",
> +            QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_DEVICE_VHOST_SCSI,
> +            QEMU_CAPS_DEVICE_SCSI_GENERIC);

Still not clear why SCSI_GENERIC is necessary, but I suppose it could
be... It's just not obvious.

>  
>      DO_TEST("mlock-on", QEMU_CAPS_REALTIME_MLOCK);
>      DO_TEST_FAILURE("mlock-on", NONE);
> diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-hostdev-scsi-vhost-scsi.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-hostdev-scsi-vhost-scsi.xml
> new file mode 120000
> index 0000000..76ebe4c
> --- /dev/null
> +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-hostdev-scsi-vhost-scsi.xml
> @@ -0,0 +1 @@
> +../qemuxml2argvdata/qemuxml2argv-hostdev-scsi-vhost-scsi.xml
> \ No newline at end of file
> diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
> index 8a2b5ff..98c3523 100644
> --- a/tests/qemuxml2xmltest.c
> +++ b/tests/qemuxml2xmltest.c
> @@ -737,6 +737,9 @@ mymain(void)
>              QEMU_CAPS_DEVICE_IOH3420,
>              QEMU_CAPS_HDA_DUPLEX);
>  
> +    DO_TEST("hostdev-scsi-vhost-scsi",
> +            QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_DEVICE_VHOST_SCSI,
> +            QEMU_CAPS_DEVICE_SCSI_GENERIC);

similar here too.

John
>      DO_TEST("hostdev-scsi-lsi",
>              QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_SCSI_LSI,
>              QEMU_CAPS_DEVICE_SCSI_GENERIC);
> 




More information about the libvir-list mailing list