mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 09:13:55 -06:00
qdev: switch children device list to QTAILQ
SCSI buses will need to read the children list first-to-last. This requires using a QTAILQ, because hell breaks loose if you just try inserting at the tail (thus reversing the order of all existing visits from last-to-first to first-to-tail). Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
afd4030c16
commit
d8bb00d6d7
8 changed files with 28 additions and 28 deletions
6
hw/ssi.c
6
hw/ssi.c
|
@ -25,8 +25,8 @@ static int ssi_slave_init(DeviceState *dev, DeviceInfo *base_info)
|
|||
SSIBus *bus;
|
||||
|
||||
bus = FROM_QBUS(SSIBus, qdev_get_parent_bus(dev));
|
||||
if (QLIST_FIRST(&bus->qbus.children) != dev
|
||||
|| QLIST_NEXT(dev, sibling) != NULL) {
|
||||
if (QTAILQ_FIRST(&bus->qbus.children) != dev
|
||||
|| QTAILQ_NEXT(dev, sibling) != NULL) {
|
||||
hw_error("Too many devices on SSI bus");
|
||||
}
|
||||
|
||||
|
@ -61,7 +61,7 @@ uint32_t ssi_transfer(SSIBus *bus, uint32_t val)
|
|||
{
|
||||
DeviceState *dev;
|
||||
SSISlave *slave;
|
||||
dev = QLIST_FIRST(&bus->qbus.children);
|
||||
dev = QTAILQ_FIRST(&bus->qbus.children);
|
||||
if (!dev) {
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue