diff options
author | Tang Chen <tangchen@cn.fujitsu.com> | 2015-04-27 16:47:17 +0800 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2015-04-27 21:07:39 +0200 |
commit | 64fec58e8ab62490edd2638e4214d8c9f84518c9 (patch) | |
tree | a48577cda520f091834296d18eaf6ffe0a5fb1ea /hw/acpi/ich9.c | |
parent | 4aae99b63333e71b2097b106bb15a6fde7f9b55b (diff) | |
download | qemu-64fec58e8ab62490edd2638e4214d8c9f84518c9.zip qemu-64fec58e8ab62490edd2638e4214d8c9f84518c9.tar.gz qemu-64fec58e8ab62490edd2638e4214d8c9f84518c9.tar.bz2 |
acpi, mem-hotplug: add unplug request cb for memory device
This patch adds unplug request cb for memory device, and adds the
is_removing boolean field to MemStatus. This field is used to indicate
whether the memory device in slot has been requested to be ejected.
This field is set to true in acpi_memory_unplug_request_cb().
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com>
Signed-off-by: Zhu Guihua <zhugh.fnst@cn.fujitsu.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/acpi/ich9.c')
-rw-r--r-- | hw/acpi/ich9.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c index 5352e19..b85eed4 100644 --- a/hw/acpi/ich9.c +++ b/hw/acpi/ich9.c @@ -400,8 +400,14 @@ void ich9_pm_device_plug_cb(ICH9LPCPMRegs *pm, DeviceState *dev, Error **errp) void ich9_pm_device_unplug_request_cb(ICH9LPCPMRegs *pm, DeviceState *dev, Error **errp) { - error_setg(errp, "acpi: device unplug request for not supported device" - " type: %s", object_get_typename(OBJECT(dev))); + if (pm->acpi_memory_hotplug.is_enabled && + object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM)) { + acpi_memory_unplug_request_cb(&pm->acpi_regs, pm->irq, + &pm->acpi_memory_hotplug, dev, errp); + } else { + error_setg(errp, "acpi: device unplug request for not supported device" + " type: %s", object_get_typename(OBJECT(dev))); + } } void ich9_pm_device_unplug_cb(ICH9LPCPMRegs *pm, DeviceState *dev, |