summary refs log tree commit diff stats
path: root/tests/virtio-net-test.c
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2019-04-09 14:25:57 +0200
committerThomas Huth <thuth@redhat.com>2019-05-08 17:45:54 +0200
commit6ebb8d2a210f21c7d4f168564f812833320a8fc4 (patch)
treefaaa3a01f71d576c78fed1f15c3f7075e96f86dc /tests/virtio-net-test.c
parenta771729cdf450881cbe66261aea740ccbd02b8ff (diff)
downloadfocaccia-qemu-6ebb8d2a210f21c7d4f168564f812833320a8fc4.tar.gz
focaccia-qemu-6ebb8d2a210f21c7d4f168564f812833320a8fc4.zip
tests: qpci_unplug_acpi_device_test() should not rely on global_qtest
libqos functions should not use functions that require global_qtest to
be set, since such library functions could also be used by tests that
deal with multiple test states. Add a parameter to this function to
explicitly specify the test state.

Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20190508143209.24350-1-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'tests/virtio-net-test.c')
-rw-r--r--tests/virtio-net-test.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/virtio-net-test.c b/tests/virtio-net-test.c
index 0d956f36fe..163126cf07 100644
--- a/tests/virtio-net-test.c
+++ b/tests/virtio-net-test.c
@@ -162,13 +162,15 @@ static void stop_cont_test(void *obj, void *data, QGuestAllocator *t_alloc)
 
 static void hotplug(void *obj, void *data, QGuestAllocator *t_alloc)
 {
+    QVirtioPCIDevice *dev = obj;
+    QTestState *qts = dev->pdev->bus->qts;
     const char *arch = qtest_get_arch();
 
     qtest_qmp_device_add("virtio-net-pci", "net1",
                          "{'addr': %s}", stringify(PCI_SLOT_HP));
 
     if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
-        qpci_unplug_acpi_device_test("net1", PCI_SLOT_HP);
+        qpci_unplug_acpi_device_test(qts, "net1", PCI_SLOT_HP);
     }
 }