]> git.proxmox.com Git - mirror_qemu.git/commit - tests/rtl8139-test.c
libqos: Track QTestState with QPCIBus
authorEric Blake <eblake@redhat.com>
Mon, 11 Sep 2017 17:19:52 +0000 (12:19 -0500)
committerThomas Huth <thuth@redhat.com>
Wed, 14 Feb 2018 10:43:02 +0000 (11:43 +0100)
commite5d1730d1e5c1f341d2d692ab2ad0d8d2d7f47e1
treeced804356dd9e41b2b6e4c9d64c45a3b66ca69a8
parent50990b162c471a8de992d43a170a3ccf24462720
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>
19 files changed:
tests/ahci-test.c
tests/e1000e-test.c
tests/i440fx-test.c
tests/ide-test.c
tests/libqos/ahci.c
tests/libqos/ahci.h
tests/libqos/libqos.c
tests/libqos/libqos.h
tests/libqos/pci-pc.c
tests/libqos/pci-pc.h
tests/libqos/pci-spapr.c
tests/libqos/pci-spapr.h
tests/libqos/pci.h
tests/q35-test.c
tests/rtl8139-test.c
tests/sdhci-test.c
tests/tco-test.c
tests/usb-hcd-ehci-test.c
tests/vhost-user-test.c