From 6ebb8d2a210f21c7d4f168564f812833320a8fc4 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Tue, 9 Apr 2019 14:25:57 +0200 Subject: 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 Message-Id: <20190508143209.24350-1-thuth@redhat.com> Signed-off-by: Thomas Huth --- tests/virtio-rng-test.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tests/virtio-rng-test.c') diff --git a/tests/virtio-rng-test.c b/tests/virtio-rng-test.c index 5309c7c..fcb2248 100644 --- a/tests/virtio-rng-test.c +++ b/tests/virtio-rng-test.c @@ -16,13 +16,16 @@ static void rng_hotplug(void *obj, void *data, QGuestAllocator *alloc) { + QVirtioPCIDevice *dev = obj; + QTestState *qts = dev->pdev->bus->qts; + const char *arch = qtest_get_arch(); qtest_qmp_device_add("virtio-rng-pci", "rng1", "{'addr': %s}", stringify(PCI_SLOT_HP)); if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) { - qpci_unplug_acpi_device_test("rng1", PCI_SLOT_HP); + qpci_unplug_acpi_device_test(qts, "rng1", PCI_SLOT_HP); } } -- cgit v1.1