[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RESEND PATCH v3 4/8] qdev: Add memory hot unplug support f
From: |
Tang Chen |
Subject: |
[Qemu-devel] [RESEND PATCH v3 4/8] qdev: Add memory hot unplug support for bus-less devices. |
Date: |
Wed, 27 Aug 2014 16:08:35 +0800 |
From: Hu Tao <address@hidden>
Implement bus-less device hot-remove in qdev_unplug(). It will call PCMachine
callback introduced in previous patch.
Signed-off-by: Hu Tao <address@hidden>
Signed-off-by: Tang Chen <address@hidden>
---
hw/core/qdev.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index da1ba48..e365a74 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -228,6 +228,14 @@ void qdev_unplug(DeviceState *dev, Error **errp)
if (dev->parent_bus && dev->parent_bus->hotplug_handler) {
hotplug_handler_unplug(dev->parent_bus->hotplug_handler, dev, errp);
+ } else if (*errp == NULL) {
+ HotplugHandler *hotplug_ctrl;
+ MachineState *machine = MACHINE(qdev_get_machine());
+ MachineClass *mc = MACHINE_GET_CLASS(machine);
+
+ hotplug_ctrl = mc->get_hotplug_handler(machine, dev);
+ if (hotplug_ctrl)
+ hotplug_handler_unplug(hotplug_ctrl, dev, errp);
} else {
assert(dc->unplug != NULL);
if (dc->unplug(dev) < 0) { /* legacy handler */
--
1.8.4.2
- [Qemu-devel] [RESEND PATCH v3 0/8] QEmu memory hot unplug support., Tang Chen, 2014/08/27
- [Qemu-devel] [RESEND PATCH v3 1/8] acpi, piix4: Add memory hot unplug support for piix4., Tang Chen, 2014/08/27
- [Qemu-devel] [RESEND PATCH v3 2/8] acpi, ich9: Add memory hot unplug support for ich9., Tang Chen, 2014/08/27
- [Qemu-devel] [RESEND PATCH v3 3/8] pc: Add memory hot unplug support for pc machine., Tang Chen, 2014/08/27
- [Qemu-devel] [RESEND PATCH v3 4/8] qdev: Add memory hot unplug support for bus-less devices.,
Tang Chen <=
- [Qemu-devel] [RESEND PATCH v3 5/8] pc-dimm: Add pc_dimm_unrealize() for memory hot unplug support., Tang Chen, 2014/08/27
- [Qemu-devel] [RESEND PATCH v3 6/8] acpi: Add hardware implementation for memory hot unplug., Tang Chen, 2014/08/27
- [Qemu-devel] [RESEND PATCH v3 7/8] pc, acpi bios: Add memory hot unplug interface., Tang Chen, 2014/08/27
- [Qemu-devel] [RESEND PATCH v3 8/8] monitor: Add memory hot unplug support for device_del command., Tang Chen, 2014/08/27