mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23: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
|
@ -274,7 +274,7 @@ VirtIOS390Device *s390_virtio_bus_find_vring(VirtIOS390Bus *bus,
|
|||
DeviceState *dev;
|
||||
int i;
|
||||
|
||||
QLIST_FOREACH(dev, &bus->bus.children, sibling) {
|
||||
QTAILQ_FOREACH(dev, &bus->bus.children, sibling) {
|
||||
_dev = (VirtIOS390Device *)dev;
|
||||
for(i = 0; i < VIRTIO_PCI_QUEUE_MAX; i++) {
|
||||
if (!virtio_queue_get_addr(_dev->vdev, i))
|
||||
|
@ -297,7 +297,7 @@ VirtIOS390Device *s390_virtio_bus_find_mem(VirtIOS390Bus *bus, ram_addr_t mem)
|
|||
VirtIOS390Device *_dev;
|
||||
DeviceState *dev;
|
||||
|
||||
QLIST_FOREACH(dev, &bus->bus.children, sibling) {
|
||||
QTAILQ_FOREACH(dev, &bus->bus.children, sibling) {
|
||||
_dev = (VirtIOS390Device *)dev;
|
||||
if (_dev->dev_offs == mem) {
|
||||
return _dev;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue