pci: fix migration path for devices behind bridges
authorMichael S. Tsirkin <mst@redhat.com>
Mon, 27 Dec 2010 09:21:38 +0000 (11:21 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Mon, 27 Dec 2010 09:21:38 +0000 (11:21 +0200)
commit3622f736cdfa824d68ac8b0a0f1a3725149eb1df
tree484e7cc06e35a9f6e49e180d86cc6420b1e5a705
parenteb8759fd13654528d27503d6c6dfec40a194745b
pci: fix migration path for devices behind bridges

The device path used for migration is currently broken for
for all devices behind a nested bridge.

Replace this by a hierarchical list of slot/function numbers, walking
the path from root down to device. Add :00 after the domain number
so that if there are no nested bridges, this is compatible
with what we have now.

Note: as pointed out by Gleb, using openfirmware paths
might be cleaner, doing this would break compatibility though,
and the IDs used are not guest or user visible at all,
so breaking the compatibility is probably not worth it.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/pci.c