[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 5/6] tests: Add qvirtio_(un)plug_device_test wra
From: |
Cornelia Huck |
Subject: |
Re: [Qemu-devel] [PATCH 5/6] tests: Add qvirtio_(un)plug_device_test wrapper functions |
Date: |
Thu, 17 Aug 2017 11:04:49 +0200 |
On Thu, 17 Aug 2017 08:25:12 +0200
Thomas Huth <address@hidden> wrote:
> To support hot-plugging tests with virtio-ccw later, the current
> tests should become independent from PCI specific functions. Thus
> let's add some proper wrapper function for virtio device hot-plugging
> and -unplugging first.
> It also seems like device unplugging works fine on ppc64 when using
> the generic qtest_hot_unplug_device() function, so hot-unplugging
> is now tested on ppc64, too.
Yeah for more coverage!
>
> Signed-off-by: Thomas Huth <address@hidden>
> ---
> tests/Makefile.include | 4 ++--
> tests/libqos/virtio.c | 27 +++++++++++++++++++++++++++
> tests/libqos/virtio.h | 5 +++++
> tests/virtio-net-test.c | 8 ++------
> tests/virtio-rng-test.c | 9 +++------
> 5 files changed, 39 insertions(+), 14 deletions(-)
> diff --git a/tests/virtio-net-test.c b/tests/virtio-net-test.c
> index 635b942..49e733d 100644
> --- a/tests/virtio-net-test.c
> +++ b/tests/virtio-net-test.c
> @@ -241,15 +241,11 @@ static void pci_basic(gconstpointer data)
>
> static void hotplug(void)
> {
> - const char *arch = qtest_get_arch();
> -
> qtest_start("-device virtio-net-pci");
>
> - qpci_plug_device_test("virtio-net-pci", "net1", PCI_SLOT_HP, NULL);
> + qvirtio_plug_device_test("virtio-net", "net1", PCI_SLOT_HP, NULL);
Same comment as for a previous patch regarding implicit aliasing.
Also, 'PCI_SLOT_HP' sounds a bit pci-y to me?
>
> - if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
> - qpci_unplug_acpi_device_test("net1", PCI_SLOT_HP);
> - }
> + qvirtio_unplug_device_test("net1", PCI_SLOT_HP);
>
> test_end();
> }
> diff --git a/tests/virtio-rng-test.c b/tests/virtio-rng-test.c
> index dcecf77..04c4279 100644
> --- a/tests/virtio-rng-test.c
> +++ b/tests/virtio-rng-test.c
> @@ -10,6 +10,7 @@
> #include "qemu/osdep.h"
> #include "libqtest.h"
> #include "libqos/pci.h"
> +#include "libqos/virtio.h"
>
> #define PCI_SLOT_HP 0x06
>
> @@ -20,13 +21,9 @@ static void pci_nop(void)
>
> static void hotplug(void)
> {
> - const char *arch = qtest_get_arch();
> + qvirtio_plug_device_test("virtio-rng-pci", "rng1", PCI_SLOT_HP, NULL);
Dito.
>
> - qpci_plug_device_test("virtio-rng-pci", "rng1", PCI_SLOT_HP, NULL);
> -
> - if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
> - qpci_unplug_acpi_device_test("rng1", PCI_SLOT_HP);
> - }
> + qvirtio_unplug_device_test("rng1", PCI_SLOT_HP);
> }
>
> int main(int argc, char **argv)
- Re: [Qemu-devel] [PATCH 3/6] tests: Enable the drive_del test also on s390x, (continued)
[Qemu-devel] [PATCH 4/6] tests: Introduce generic device hot-plug/hot-unplug functions, Thomas Huth, 2017/08/17
[Qemu-devel] [PATCH 5/6] tests: Add qvirtio_(un)plug_device_test wrapper functions, Thomas Huth, 2017/08/17
- Re: [Qemu-devel] [PATCH 5/6] tests: Add qvirtio_(un)plug_device_test wrapper functions,
Cornelia Huck <=
[Qemu-devel] [PATCH 6/6] tests: Enable the simple virtio tests on s390x, too, Thomas Huth, 2017/08/17
Re: [Qemu-devel] [PATCH for-2.11 0/6] Enable more qtests for s390x, Cornelia Huck, 2017/08/17