]> git.proxmox.com Git - qemu.git/commit - hw/spapr_vio.c
pseries: Emit device tree nodes in reg order
authorDavid Gibson <david@gibson.dropbear.id.au>
Mon, 12 Dec 2011 18:24:32 +0000 (18:24 +0000)
committerAlexander Graf <agraf@suse.de>
Tue, 3 Jan 2012 14:49:11 +0000 (15:49 +0100)
commit05c194384f836240ea4c2da5fa3be43a54bff021
treed2f2d5f7bc1538f122fa3a23d6062465c48b3038
parent6e806cc38bb1a79ec52d7d86da4aca11cdc302c8
pseries: Emit device tree nodes in reg order

Although in theory the device tree has no inherent ordering, in practice
the order of nodes in the device tree does effect the order that devices
are detected by software.

Currently the ordering is determined by the order the devices appear on
the QEMU command line. Although that does give the user control over the
ordering, it is fragile, especially when the user does not generate the
command line manually - eg. when using libvirt etc.

So order the device tree based on the reg value, ie. the address of on
the VIO bus of the devices. This gives us a sane and stable ordering.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
[agraf] add braces
hw/spapr_vio.c