diff options
author | David Hildenbrand <david@redhat.com> | 2018-12-12 10:16:16 +0100 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2019-01-14 19:31:04 -0500 |
commit | b9731850d746e528d317097f907f27116798d7fe (patch) | |
tree | a040d7485f4ba35dc03b5de0a9378f1cd25e5a21 /include/hw | |
parent | 89bd861c2b470e3fb45596945509079c72af3ac2 (diff) |
pci/pcie: stop plug/unplug if the slot is locked
We better stop right away. For now, errors would be partially ignored
(so the guest might get informed or the device might get unplugged),
although actual plug/unplug will be reported as failed to the user.
While at it, properly move the check to the pre_plug handler for the plug
case, as we can test the slot state before the device will be realized.
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'include/hw')
-rw-r--r-- | include/hw/pci/pcie.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/hw/pci/pcie.h b/include/hw/pci/pcie.h index cd318646a2..5b82a0d244 100644 --- a/include/hw/pci/pcie.h +++ b/include/hw/pci/pcie.h @@ -132,6 +132,8 @@ void pcie_ari_init(PCIDevice *dev, uint16_t offset, uint16_t nextfn); void pcie_dev_ser_num_init(PCIDevice *dev, uint16_t offset, uint64_t ser_num); void pcie_ats_init(PCIDevice *dev, uint16_t offset); +void pcie_cap_slot_pre_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev, + Error **errp); void pcie_cap_slot_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp); void pcie_cap_slot_unplug_cb(HotplugHandler *hotplug_dev, DeviceState *dev, |