mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
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>
This commit is contained in:
parent
50990b162c
commit
e5d1730d1e
19 changed files with 33 additions and 33 deletions
|
@ -115,11 +115,11 @@ static void qpci_pc_config_writel(QPCIBus *bus, int devfn, uint8_t offset, uint3
|
|||
outl(0xcfc, value);
|
||||
}
|
||||
|
||||
QPCIBus *qpci_init_pc(QGuestAllocator *alloc)
|
||||
QPCIBus *qpci_init_pc(QTestState *qts, QGuestAllocator *alloc)
|
||||
{
|
||||
QPCIBusPC *ret;
|
||||
QPCIBusPC *ret = g_new0(QPCIBusPC, 1);
|
||||
|
||||
ret = g_malloc(sizeof(*ret));
|
||||
assert(qts);
|
||||
|
||||
ret->bus.pio_readb = qpci_pc_pio_readb;
|
||||
ret->bus.pio_readw = qpci_pc_pio_readw;
|
||||
|
@ -142,6 +142,7 @@ QPCIBus *qpci_init_pc(QGuestAllocator *alloc)
|
|||
ret->bus.config_writew = qpci_pc_config_writew;
|
||||
ret->bus.config_writel = qpci_pc_config_writel;
|
||||
|
||||
ret->bus.qts = qts;
|
||||
ret->bus.pio_alloc_ptr = 0xc000;
|
||||
ret->bus.mmio_alloc_ptr = 0xE0000000;
|
||||
ret->bus.mmio_limit = 0x100000000ULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue