s390x/pci: refactor s390_pci_find_dev_by_idx
authorYi Min Zhao <zyimin@linux.vnet.ibm.com>
Fri, 3 Jun 2016 06:17:59 +0000 (14:17 +0800)
committerCornelia Huck <cornelia.huck@de.ibm.com>
Mon, 11 Jul 2016 07:48:05 +0000 (09:48 +0200)
commitab9746570ab375f3f2a3d5ec0c95d2621aca5493
tree9a00b7880819ee9a56782c47a18a8e0d537f56a3
parentbd4976838d1f2b79d4db68a70ddf8d46e0f8b054
s390x/pci: refactor s390_pci_find_dev_by_idx

s390_find_dev_by_idx() only indexes usable zpci devices. It implies
that the index value of each zpci device is dynamic and may change if
a new zpci device is plugged. So we have to use a constant index to
look up the device.

Signed-off-by: Yi Min Zhao <zyimin@linux.vnet.ibm.com>
Reviewed-by: Pierre Morel <pmorel@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
hw/s390x/s390-pci-bus.c