qbus: add functions to walk both devices and busses
commit81699d8a90deac361e9e14fd853f8341f40b2fad
authorAnthony Liguori <anthony@codemonkey.ws>
Fri, 19 Nov 2010 09:55:58 +0000 (19 18:55 +0900)
committerMichael S. Tsirkin <mst@redhat.com>
Mon, 22 Nov 2010 08:00:07 +0000 (22 10:00 +0200)
tree3fbe622d48bafdee3494efaa83c9ad56087569de
parent0389ced419d249d8742c69e177731b5d18ef3f2f
qbus: add functions to walk both devices and busses

There are some cases where you want to walk the busses, in particular, when
searching for a bus either by name or DeviceInfo.
Paolo suggested that we model the return values on how GCC's walkers work which
allows an actor to skip child transversal, or terminate walking with a positive
value that's returned as the qbus_walk_children's result.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/qdev.c
hw/qdev.h