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 /hw/pci/pcie_port.c | |
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 'hw/pci/pcie_port.c')
-rw-r--r-- | hw/pci/pcie_port.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/pci/pcie_port.c b/hw/pci/pcie_port.c index bc07abc31b..a30291ef54 100644 --- a/hw/pci/pcie_port.c +++ b/hw/pci/pcie_port.c @@ -154,6 +154,7 @@ static void pcie_slot_class_init(ObjectClass *oc, void *data) HotplugHandlerClass *hc = HOTPLUG_HANDLER_CLASS(oc); dc->props = pcie_slot_props; + hc->pre_plug = pcie_cap_slot_pre_plug_cb; hc->plug = pcie_cap_slot_plug_cb; hc->unplug = pcie_cap_slot_unplug_cb; hc->unplug_request = pcie_cap_slot_unplug_request_cb; |