diff options
author | Eric Blake <eblake@redhat.com> | 2017-09-11 12:19:52 -0500 |
---|---|---|
committer | Thomas Huth <thuth@redhat.com> | 2018-02-14 11:43:02 +0100 |
commit | e5d1730d1e5c1f341d2d692ab2ad0d8d2d7f47e1 (patch) | |
tree | ced804356dd9e41b2b6e4c9d64c45a3b66ca69a8 /tests/q35-test.c | |
parent | 50990b162c471a8de992d43a170a3ccf24462720 (diff) | |
download | qemu-e5d1730d1e5c1f341d2d692ab2ad0d8d2d7f47e1.zip |
libqos: Track QTestState with QPCIBus
When initializing a QPCIBus, track which QTestState the bus is
associated with (so that a later patch can then explicitly use
that test state for all communication on the bus, rather than
blindly relying on global_qtest). Update the initialization
functions to take another parameter, and update all callers to
pass in state (for now, most callers get away with passing the
current global_qtest as the current state, although this required
fixing the order of initialization to ensure qtest_start() is
called before qpci_init*() in rtl8139-test, and provided an
opportunity to pass in the allocator in e1000e-test).
Touch up some allocations to use g_new0() rather than g_malloc()
while in the area, and simplify some code (all implementations
of QOSOps provide a .init_allocator() that never fails).
Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
[thuth: Removed hunk from vhost-user-test.c that is not required anymore,
fixed conflict in qtest_vboot() and adjusted qpci_init_pc() in sdhci-test]
Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'tests/q35-test.c')
-rw-r--r-- | tests/q35-test.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/q35-test.c b/tests/q35-test.c index 187d68fb7e..3eaedf4b24 100644 --- a/tests/q35-test.c +++ b/tests/q35-test.c @@ -87,7 +87,7 @@ static void test_smram_lock(void) qtest_start("-M q35"); - pcibus = qpci_init_pc(NULL); + pcibus = qpci_init_pc(global_qtest, NULL); g_assert(pcibus != NULL); pcidev = qpci_device_find(pcibus, 0); @@ -146,7 +146,7 @@ static void test_tseg_size(const void *data) g_free(cmdline); /* locate the DRAM controller */ - pcibus = qpci_init_pc(NULL); + pcibus = qpci_init_pc(global_qtest, NULL); g_assert(pcibus != NULL); pcidev = qpci_device_find(pcibus, 0); g_assert(pcidev != NULL); |