[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 03/11] pci: mark devices partially unplugged
From: |
Jens Freimann |
Subject: |
[PATCH v5 03/11] pci: mark devices partially unplugged |
Date: |
Wed, 23 Oct 2019 10:27:03 +0200 |
Only the guest unplug request was triggered. This is needed for
the failover feature. In case of a failed migration we need to
plug the device back to the guest.
Signed-off-by: Jens Freimann <address@hidden>
---
hw/pci/pcie.c | 3 +++
include/hw/pci/pci.h | 1 +
2 files changed, 4 insertions(+)
diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c
index a6beb567bd..19363ff8ce 100644
--- a/hw/pci/pcie.c
+++ b/hw/pci/pcie.c
@@ -456,6 +456,9 @@ static void pcie_unplug_device(PCIBus *bus, PCIDevice *dev,
void *opaque)
{
HotplugHandler *hotplug_ctrl = qdev_get_hotplug_handler(DEVICE(dev));
+ if (dev->partially_hotplugged) {
+ return;
+ }
hotplug_handler_unplug(hotplug_ctrl, DEVICE(dev), &error_abort);
object_unparent(OBJECT(dev));
}
diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h
index def5435685..7b7eac845c 100644
--- a/include/hw/pci/pci.h
+++ b/include/hw/pci/pci.h
@@ -265,6 +265,7 @@ typedef struct PCIReqIDCache PCIReqIDCache;
struct PCIDevice {
DeviceState qdev;
+ bool partially_hotplugged;
/* PCI config space */
uint8_t *config;
--
2.21.0
- Re: [PATCH v5 02/11] pci: add option for net failover, (continued)
RE: [PATCH v5 02/11] pci: add option for net failover, Parav Pandit, 2019/10/24
RE: [PATCH v5 02/11] pci: add option for net failover, Parav Pandit, 2019/10/24
Re: [PATCH v5 02/11] pci: add option for net failover, Alex Williamson, 2019/10/24
Re: [PATCH v5 02/11] pci: add option for net failover, Dr. David Alan Gilbert, 2019/10/24
[PATCH v5 03/11] pci: mark devices partially unplugged,
Jens Freimann <=
[PATCH v5 04/11] pci: mark device having guest unplug request pending, Jens Freimann, 2019/10/23
[PATCH v5 05/11] qapi: add unplug primary event, Jens Freimann, 2019/10/23
[PATCH v5 06/11] qapi: add failover negotiated event, Jens Freimann, 2019/10/23
[PATCH v5 07/11] migration: allow unplug during migration for failover devices, Jens Freimann, 2019/10/23
[PATCH v5 08/11] migration: add new migration state wait-unplug, Jens Freimann, 2019/10/23