[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 07/11] migration: allow unplug during migration for failover devi
From: |
Jens Freimann |
Subject: |
[PATCH 07/11] migration: allow unplug during migration for failover devices |
Date: |
Fri, 18 Oct 2019 22:20:36 +0200 |
In "b06424de62 migration: Disable hotplug/unplug during migration" we
added a check to disable unplug for all devices until we have figured
out what works. For failover primary devices qdev_unplug() is called
from the migration handler, i.e. during migration.
This patch adds a flag to DeviceState which is set to false for all
devices and makes an exception for vfio-pci devices that are also
primary devices in a failover pair.
Signed-off-by: Jens Freimann <address@hidden>
---
hw/core/qdev.c | 1 +
include/hw/qdev-core.h | 1 +
qdev-monitor.c | 2 +-
3 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index 89c134ec53..b1be568af3 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -995,6 +995,7 @@ static void device_initfn(Object *obj)
dev->instance_id_alias = -1;
dev->realized = false;
+ dev->allow_unplug_during_migration = false;
object_property_add_bool(obj, "realized",
device_get_realized, device_set_realized, NULL);
diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
index 28f594a47d..6b690e85b1 100644
--- a/include/hw/qdev-core.h
+++ b/include/hw/qdev-core.h
@@ -143,6 +143,7 @@ struct DeviceState {
bool pending_deleted_event;
QemuOpts *opts;
int hotplugged;
+ bool allow_unplug_during_migration;
BusState *parent_bus;
QLIST_HEAD(, NamedGPIOList) gpios;
QLIST_HEAD(, BusState) child_bus;
diff --git a/qdev-monitor.c b/qdev-monitor.c
index 508d85df87..265ab4f0d5 100644
--- a/qdev-monitor.c
+++ b/qdev-monitor.c
@@ -848,7 +848,7 @@ void qdev_unplug(DeviceState *dev, Error **errp)
return;
}
- if (!migration_is_idle()) {
+ if (!migration_is_idle() && !dev->allow_unplug_during_migration) {
error_setg(errp, "device_del not allowed while migrating");
return;
}
--
2.21.0
- [PATCH 02/11] pci: add option for net failover, (continued)
- [PATCH 03/11] pci: mark devices partially unplugged, Jens Freimann, 2019/10/18
- [PATCH 04/11] pci: mark device having guest unplug request pending, Jens Freimann, 2019/10/18
- [PATCH 05/11] qapi: add unplug primary event, Jens Freimann, 2019/10/18
- [PATCH 06/11] qapi: add failover negotiated event, Jens Freimann, 2019/10/18
- [PATCH 07/11] migration: allow unplug during migration for failover devices,
Jens Freimann <=
- [PATCH 08/11] migration: add new migration state wait-unplug, Jens Freimann, 2019/10/18
- [PATCH 09/11] libqos: tolerate wait-unplug migration state, Jens Freimann, 2019/10/18
- [PATCH 10/11] net/virtio: add failover support, Jens Freimann, 2019/10/18
- [PATCH 11/11] vfio: unplug failover primary device before migration, Jens Freimann, 2019/10/18
- Re: [PATCH v4 0/11] add failover feature for assigned network devices, no-reply, 2019/10/19