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/libqos/pci-pc.c | |
parent | a771729cdf450881cbe66261aea740ccbd02b8ff (diff) | |
download | qemu-6ebb8d2a210f21c7d4f168564f812833320a8fc4.zip qemu-6ebb8d2a210f21c7d4f168564f812833320a8fc4.tar.gz qemu-6ebb8d2a210f21c7d4f168564f812833320a8fc4.tar.bz2 |
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/libqos/pci-pc.c')
-rw-r--r-- | tests/libqos/pci-pc.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/libqos/pci-pc.c b/tests/libqos/pci-pc.c index 407d8af..634fedd 100644 --- a/tests/libqos/pci-pc.c +++ b/tests/libqos/pci-pc.c @@ -176,19 +176,19 @@ void qpci_free_pc(QPCIBus *bus) g_free(s); } -void qpci_unplug_acpi_device_test(const char *id, uint8_t slot) +void qpci_unplug_acpi_device_test(QTestState *qts, const char *id, uint8_t slot) { QDict *response; - response = qmp("{'execute': 'device_del', 'arguments': {'id': %s}}", - id); + response = qtest_qmp(qts, "{'execute': 'device_del'," + " 'arguments': {'id': %s}}", id); g_assert(response); g_assert(!qdict_haskey(response, "error")); qobject_unref(response); - outb(ACPI_PCIHP_ADDR + PCI_EJ_BASE, 1 << slot); + qtest_outb(qts, ACPI_PCIHP_ADDR + PCI_EJ_BASE, 1 << slot); - qmp_eventwait("DEVICE_DELETED"); + qtest_qmp_eventwait(qts, "DEVICE_DELETED"); } static void qpci_pc_register_nodes(void) |