Message ID | 1409550658-5436-4-git-send-email-arei.gonglei@huawei.com |
---|---|
State | New |
Headers | show |
diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c index 1babddf..ab7f8a2 100644 --- a/hw/pci/pcie.c +++ b/hw/pci/pcie.c @@ -254,7 +254,11 @@ void pcie_cap_slot_hotplug_cb(HotplugHandler *hotplug_dev, DeviceState *dev, * Right now, only a device of function = 0 is allowed to be * hot plugged/unplugged. */ - assert(PCI_FUNC(pci_dev->devfn) == 0); + if (PCI_FUNC(pci_dev->devfn) != 0) { + error_setg(errp, "Unsupported device function %d for PCIe hotplugging, " + "only supported function 0", PCI_FUNC(pci_dev->devfn)); + return; + } pci_word_test_and_set_mask(exp_cap + PCI_EXP_SLTSTA, PCI_EXP_SLTSTA_PDS);