[libvirt] [PATCH 16/18] qemuxml2argvtest: Switch to modern vfio backend

Daniel Henrique Barboza danielhb413 at gmail.com
Fri Aug 16 21:10:59 UTC 2019


Reviewed-by: Daniel Henrique Barboza <danielhb413 at gmail.com>

On 8/14/19 8:57 AM, Michal Privoznik wrote:
> The pci-assign device is so old school that no one uses it. All
> modern systems have adapted VFIO. Switch our xml2argv test too.
>
> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
> ---
>   .../hostdev-pci-address-device.args                |  2 +-
>   tests/qemuxml2argvdata/hostdev-pci-address.args    |  2 +-
>   tests/qemuxml2argvdata/net-hostdev-bootorder.args  |  3 +--
>   .../qemuxml2argvdata/net-hostdev-multidomain.args  |  2 +-
>   tests/qemuxml2argvdata/net-hostdev.args            |  2 +-
>   tests/qemuxml2argvdata/pci-rom.args                |  4 ++--
>   tests/qemuxml2argvtest.c                           | 14 +++++++-------
>   7 files changed, 14 insertions(+), 15 deletions(-)
>
> diff --git a/tests/qemuxml2argvdata/hostdev-pci-address-device.args b/tests/qemuxml2argvdata/hostdev-pci-address-device.args
> index 5159b00ef1..79654f44bb 100644
> --- a/tests/qemuxml2argvdata/hostdev-pci-address-device.args
> +++ b/tests/qemuxml2argvdata/hostdev-pci-address-device.args
> @@ -27,5 +27,5 @@ server,nowait \
>   -usb \
>   -drive file=/dev/HostVG/QEMUGuest2,format=raw,if=none,id=drive-ide0-0-0 \
>   -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \
> --device pci-assign,host=0000:06:12.5,id=hostdev0,bus=pci.0,addr=0x3 \
> +-device vfio-pci,host=0000:06:12.5,id=hostdev0,bus=pci.0,addr=0x3 \
>   -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4
> diff --git a/tests/qemuxml2argvdata/hostdev-pci-address.args b/tests/qemuxml2argvdata/hostdev-pci-address.args
> index fe6acaaf62..0a57a8f29e 100644
> --- a/tests/qemuxml2argvdata/hostdev-pci-address.args
> +++ b/tests/qemuxml2argvdata/hostdev-pci-address.args
> @@ -27,4 +27,4 @@ server,nowait \
>   -usb \
>   -drive file=/dev/HostVG/QEMUGuest2,format=raw,if=none,id=drive-ide0-0-0 \
>   -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \
> --device pci-assign,host=0000:06:12.5,id=hostdev0,bus=pci.0,addr=0x3
> +-device vfio-pci,host=0000:06:12.5,id=hostdev0,bus=pci.0,addr=0x3
> diff --git a/tests/qemuxml2argvdata/net-hostdev-bootorder.args b/tests/qemuxml2argvdata/net-hostdev-bootorder.args
> index eefc247eed..515b0c58d3 100644
> --- a/tests/qemuxml2argvdata/net-hostdev-bootorder.args
> +++ b/tests/qemuxml2argvdata/net-hostdev-bootorder.args
> @@ -27,5 +27,4 @@ server,nowait \
>   -usb \
>   -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
>   -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=2 \
> --device pci-assign,host=0000:03:07.1,id=hostdev0,bootindex=1,bus=pci.0,\
> -addr=0x3
> +-device vfio-pci,host=0000:03:07.1,id=hostdev0,bootindex=1,bus=pci.0,addr=0x3
> diff --git a/tests/qemuxml2argvdata/net-hostdev-multidomain.args b/tests/qemuxml2argvdata/net-hostdev-multidomain.args
> index bf7686f49c..18c5e98188 100644
> --- a/tests/qemuxml2argvdata/net-hostdev-multidomain.args
> +++ b/tests/qemuxml2argvdata/net-hostdev-multidomain.args
> @@ -27,5 +27,5 @@ server,nowait \
>   -usb \
>   -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
>   -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \
> --device pci-assign,host=2424:21:1c.6,id=hostdev0,bus=pci.0,addr=0x3 \
> +-device vfio-pci,host=2424:21:1c.6,id=hostdev0,bus=pci.0,addr=0x3 \
>   -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4
> diff --git a/tests/qemuxml2argvdata/net-hostdev.args b/tests/qemuxml2argvdata/net-hostdev.args
> index 94eac176f3..aa9e91db82 100644
> --- a/tests/qemuxml2argvdata/net-hostdev.args
> +++ b/tests/qemuxml2argvdata/net-hostdev.args
> @@ -27,5 +27,5 @@ server,nowait \
>   -usb \
>   -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
>   -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \
> --device pci-assign,host=0000:03:07.1,id=hostdev0,bus=pci.0,addr=0x3 \
> +-device vfio-pci,host=0000:03:07.1,id=hostdev0,bus=pci.0,addr=0x3 \
>   -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4
> diff --git a/tests/qemuxml2argvdata/pci-rom.args b/tests/qemuxml2argvdata/pci-rom.args
> index 7235642ee8..4a5dc4161a 100644
> --- a/tests/qemuxml2argvdata/pci-rom.args
> +++ b/tests/qemuxml2argvdata/pci-rom.args
> @@ -33,7 +33,7 @@ addr=0x3,rombar=1 \
>   -netdev user,id=hostnet1 \
>   -device virtio-net-pci,netdev=hostnet1,id=net1,mac=52:54:00:24:a5:9e,bus=pci.0,\
>   addr=0x4,romfile=/etc/fake/bootrom.bin \
> --device pci-assign,host=0000:06:12.5,id=hostdev0,bus=pci.0,addr=0x5,rombar=0 \
> --device pci-assign,host=0000:06:12.6,id=hostdev1,bus=pci.0,addr=0x6,rombar=1,\
> +-device vfio-pci,host=0000:06:12.5,id=hostdev0,bus=pci.0,addr=0x5,rombar=0 \
> +-device vfio-pci,host=0000:06:12.6,id=hostdev1,bus=pci.0,addr=0x6,rombar=1,\
>   romfile=/etc/fake/bootrom.bin \
>   -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x7
> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
> index c166fd18d6..26b512d246 100644
> --- a/tests/qemuxml2argvtest.c
> +++ b/tests/qemuxml2argvtest.c
> @@ -496,7 +496,7 @@ testCompareXMLToArgv(const void *data)
>           if (hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS &&
>               hostdev->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI &&
>               hostdev->source.subsys.u.pci.backend == VIR_DOMAIN_HOSTDEV_PCI_BACKEND_DEFAULT) {
> -            hostdev->source.subsys.u.pci.backend = VIR_DOMAIN_HOSTDEV_PCI_BACKEND_KVM;
> +            hostdev->source.subsys.u.pci.backend = VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO;
>           }
>       }
>   
> @@ -1303,9 +1303,9 @@ mymain(void)
>       DO_TEST("net-many-models", NONE);
>       DO_TEST("net-mcast", NONE);
>       DO_TEST("net-udp", NONE);
> -    DO_TEST("net-hostdev", NONE);
> -    DO_TEST("net-hostdev-bootorder", NONE);
> -    DO_TEST("net-hostdev-multidomain", NONE);
> +    DO_TEST("net-hostdev", QEMU_CAPS_DEVICE_VFIO_PCI);
> +    DO_TEST("net-hostdev-bootorder", QEMU_CAPS_DEVICE_VFIO_PCI);
> +    DO_TEST("net-hostdev-multidomain", QEMU_CAPS_DEVICE_VFIO_PCI);
>       DO_TEST("net-hostdev-vfio",
>               QEMU_CAPS_DEVICE_VFIO_PCI);
>       DO_TEST("net-hostdev-vfio-multidomain",
> @@ -1576,8 +1576,8 @@ mymain(void)
>       DO_TEST("hostdev-usb-address", NONE);
>       DO_TEST("hostdev-usb-address-device", NONE);
>       DO_TEST("hostdev-usb-address-device-boot", NONE);
> -    DO_TEST("hostdev-pci-address", NONE);
> -    DO_TEST("hostdev-pci-address-device", NONE);
> +    DO_TEST("hostdev-pci-address", QEMU_CAPS_DEVICE_VFIO_PCI);
> +    DO_TEST("hostdev-pci-address-device", QEMU_CAPS_DEVICE_VFIO_PCI);
>       DO_TEST("hostdev-vfio",
>               QEMU_CAPS_DEVICE_VFIO_PCI);
>       DO_TEST("hostdev-vfio-multidomain",
> @@ -1613,7 +1613,7 @@ mymain(void)
>               QEMU_CAPS_DEVICE_ZPCI);
>       DO_TEST_PARSE_ERROR("hostdev-vfio-zpci",
>                           QEMU_CAPS_DEVICE_VFIO_PCI);
> -    DO_TEST("pci-rom", NONE);
> +    DO_TEST("pci-rom", QEMU_CAPS_DEVICE_VFIO_PCI);
>       DO_TEST("pci-rom-disabled", NONE);
>       DO_TEST("pci-rom-disabled-invalid", NONE);
>   




More information about the libvir-list mailing list