diff options
author | Thomas Huth <thuth@redhat.com> | 2019-04-09 14:25:57 +0200 |
---|---|---|
committer | Thomas Huth <thuth@redhat.com> | 2019-05-08 17:45:54 +0200 |
commit | 6ebb8d2a210f21c7d4f168564f812833320a8fc4 (patch) | |
tree | faaa3a01f71d576c78fed1f15c3f7075e96f86dc /tests/ivshmem-test.c | |
parent | a771729cdf450881cbe66261aea740ccbd02b8ff (diff) | |
download | 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/ivshmem-test.c')
-rw-r--r-- | tests/ivshmem-test.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/ivshmem-test.c b/tests/ivshmem-test.c index 227561fbca..a467b8c03d 100644 --- a/tests/ivshmem-test.c +++ b/tests/ivshmem-test.c @@ -383,18 +383,21 @@ static void test_ivshmem_server(void) static void test_ivshmem_hotplug(void) { + QTestState *qts; const char *arch = qtest_get_arch(); - qtest_start("-object memory-backend-ram,size=1M,id=mb1"); + qts = qtest_init("-object memory-backend-ram,size=1M,id=mb1"); + global_qtest = qts; /* TODO: Get rid of global_qtest here */ qtest_qmp_device_add("ivshmem-plain", "iv1", "{'addr': %s, 'memdev': 'mb1'}", stringify(PCI_SLOT_HP)); if (strcmp(arch, "ppc64") != 0) { - qpci_unplug_acpi_device_test("iv1", PCI_SLOT_HP); + qpci_unplug_acpi_device_test(qts, "iv1", PCI_SLOT_HP); } - qtest_end(); + qtest_quit(qts); + global_qtest = NULL; } static void test_ivshmem_memdev(void) |