pci/pcie: stop plug/unplug if the slot is locked
authorDavid Hildenbrand <david@redhat.com>
Wed, 12 Dec 2018 09:16:16 +0000 (10:16 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 15 Jan 2019 00:31:04 +0000 (19:31 -0500)
commitb9731850d746e528d317097f907f27116798d7fe
treea040d7485f4ba35dc03b5de0a9378f1cd25e5a21
parent89bd861c2b470e3fb45596945509079c72af3ac2
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>
hw/pci/pcie.c
hw/pci/pcie_port.c
include/hw/pci/pcie.h