mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
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>
This commit is contained in:
parent
f4c817e000
commit
5beb8ad503
2 changed files with 5 additions and 1 deletions
3
hw/pci.c
3
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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue