[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 57/59] qdev: Move qdev_unplug() to qdev-monitor.c
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PATCH 57/59] qdev: Move qdev_unplug() to qdev-monitor.c |
Date: |
Wed, 19 Apr 2017 22:59:21 +0200 |
It is not used by linux-user, otherwise I need to to create one stub
for migration_is_idle() on following patch.
Signed-off-by: Juan Quintela <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: zhanghailiang <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
---
hw/core/qdev.c | 34 ----------------------------------
qdev-monitor.c | 34 ++++++++++++++++++++++++++++++++++
2 files changed, 34 insertions(+), 34 deletions(-)
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index c26cf84..0df0050 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -271,40 +271,6 @@ HotplugHandler *qdev_get_hotplug_handler(DeviceState *dev)
return hotplug_ctrl;
}
-void qdev_unplug(DeviceState *dev, Error **errp)
-{
- DeviceClass *dc = DEVICE_GET_CLASS(dev);
- HotplugHandler *hotplug_ctrl;
- HotplugHandlerClass *hdc;
-
- if (dev->parent_bus && !qbus_is_hotpluggable(dev->parent_bus)) {
- error_setg(errp, QERR_BUS_NO_HOTPLUG, dev->parent_bus->name);
- return;
- }
-
- if (!dc->hotpluggable) {
- error_setg(errp, QERR_DEVICE_NO_HOTPLUG,
- object_get_typename(OBJECT(dev)));
- return;
- }
-
- qdev_hot_removed = true;
-
- hotplug_ctrl = qdev_get_hotplug_handler(dev);
- /* hotpluggable device MUST have HotplugHandler, if it doesn't
- * then something is very wrong with it */
- g_assert(hotplug_ctrl);
-
- /* If device supports async unplug just request it to be done,
- * otherwise just remove it synchronously */
- hdc = HOTPLUG_HANDLER_GET_CLASS(hotplug_ctrl);
- if (hdc->unplug_request) {
- hotplug_handler_unplug_request(hotplug_ctrl, dev, errp);
- } else {
- hotplug_handler_unplug(hotplug_ctrl, dev, errp);
- }
-}
-
static int qdev_reset_one(DeviceState *dev, void *opaque)
{
device_reset(dev);
diff --git a/qdev-monitor.c b/qdev-monitor.c
index 5f2fcdf..bb3d8ba 100644
--- a/qdev-monitor.c
+++ b/qdev-monitor.c
@@ -836,6 +836,40 @@ static DeviceState *find_device_state(const char *id,
Error **errp)
return DEVICE(obj);
}
+void qdev_unplug(DeviceState *dev, Error **errp)
+{
+ DeviceClass *dc = DEVICE_GET_CLASS(dev);
+ HotplugHandler *hotplug_ctrl;
+ HotplugHandlerClass *hdc;
+
+ if (dev->parent_bus && !qbus_is_hotpluggable(dev->parent_bus)) {
+ error_setg(errp, QERR_BUS_NO_HOTPLUG, dev->parent_bus->name);
+ return;
+ }
+
+ if (!dc->hotpluggable) {
+ error_setg(errp, QERR_DEVICE_NO_HOTPLUG,
+ object_get_typename(OBJECT(dev)));
+ return;
+ }
+
+ qdev_hot_removed = true;
+
+ hotplug_ctrl = qdev_get_hotplug_handler(dev);
+ /* hotpluggable device MUST have HotplugHandler, if it doesn't
+ * then something is very wrong with it */
+ g_assert(hotplug_ctrl);
+
+ /* If device supports async unplug just request it to be done,
+ * otherwise just remove it synchronously */
+ hdc = HOTPLUG_HANDLER_GET_CLASS(hotplug_ctrl);
+ if (hdc->unplug_request) {
+ hotplug_handler_unplug_request(hotplug_ctrl, dev, errp);
+ } else {
+ hotplug_handler_unplug(hotplug_ctrl, dev, errp);
+ }
+}
+
void qmp_device_del(const char *id, Error **errp)
{
DeviceState *dev = find_device_state(id, errp);
--
2.9.3
- [Qemu-devel] [PATCH 47/59] ram: reorganize last_sent_block, (continued)
- [Qemu-devel] [PATCH 47/59] ram: reorganize last_sent_block, Juan Quintela, 2017/04/19
- [Qemu-devel] [PATCH 48/59] ram: Use page number instead of an address for the bitmap operations, Juan Quintela, 2017/04/19
- [Qemu-devel] [PATCH 49/59] ram: Remember last_page instead of last_offset, Juan Quintela, 2017/04/19
- [Qemu-devel] [PATCH 50/59] ram: Change offset field in PageSearchStatus to page, Juan Quintela, 2017/04/19
- [Qemu-devel] [PATCH 51/59] ram: Use ramblock and page offset instead of absolute offset, Juan Quintela, 2017/04/19
- [Qemu-devel] [PATCH 53/59] ram: Use RAMBitmap type for coherence, Juan Quintela, 2017/04/19
- [Qemu-devel] [PATCH 52/59] ram: rename last_ram_offset() last_ram_pages(), Juan Quintela, 2017/04/19
- [Qemu-devel] [PATCH 54/59] migration: Remove MigrationState parameter from migration_is_idle(), Juan Quintela, 2017/04/19
- [Qemu-devel] [PATCH 55/59] qdev: qdev_hotplug is really a bool, Juan Quintela, 2017/04/19
- [Qemu-devel] [PATCH 57/59] qdev: Move qdev_unplug() to qdev-monitor.c,
Juan Quintela <=
- [Qemu-devel] [PATCH 59/59] ram: Remove migration_bitmap_extend(), Juan Quintela, 2017/04/19
- [Qemu-devel] [PATCH 56/59] qdev: Export qdev_hot_removed, Juan Quintela, 2017/04/19
- [Qemu-devel] [PATCH 58/59] migration: Disable hotplug/unplug during migration, Juan Quintela, 2017/04/19
- Re: [Qemu-devel] [PATCH 00/59] RAMState + qdev, no-reply, 2017/04/19