aboutsummaryrefslogtreecommitdiff
path: root/hw/pci.c
diff options
context:
space:
mode:
authorIsaku Yamahata <yamahata@valinux.co.jp>2010-09-06 16:46:18 +0900
committerMichael S. Tsirkin <mst@redhat.com>2010-09-07 20:10:04 +0300
commit5beb8ad503c88a76f2b8106c3b74b4ce485a60e1 (patch)
tree4d2a97c57cdf73bb0f04c631330a41c9ad78be31 /hw/pci.c
parentf4c817e000e50e9a0db8f95ce6496628bd70733d (diff)
pci: call hotplug callback even when not hotplug case for later use.
call hotplug callback even when not hotplug case for later use. And move hotplug check into hotplug callback. PCIE slot needs this for card presence detection. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/pci.c')
-rw-r--r--hw/pci.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/pci.c b/hw/pci.c
index 754ffb3c3d..bb9ddea733 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -1514,7 +1514,8 @@ static int pci_qdev_init(DeviceState *qdev, DeviceInfo *base)
pci_dev->romfile = qemu_strdup(info->romfile);
pci_add_option_rom(pci_dev);
- if (qdev->hotplugged) {
+ if (bus->hotplug) {
+ /* lower layer must check qdev->hotplugged */
rc = bus->hotplug(bus->hotplug_qdev, pci_dev, 1);
if (rc != 0) {
int r = pci_unregister_device(&pci_dev->qdev);