summaryrefslogtreecommitdiffstats
path: root/hw/acpi/piix4.c
diff options
context:
space:
mode:
authorTang Chen <tangchen@cn.fujitsu.com>2015-04-27 16:47:17 +0800
committerMichael S. Tsirkin <mst@redhat.com>2015-04-27 21:07:39 +0200
commit64fec58e8ab62490edd2638e4214d8c9f84518c9 (patch)
treea48577cda520f091834296d18eaf6ffe0a5fb1ea /hw/acpi/piix4.c
parent4aae99b63333e71b2097b106bb15a6fde7f9b55b (diff)
downloadhqemu-64fec58e8ab62490edd2638e4214d8c9f84518c9.zip
hqemu-64fec58e8ab62490edd2638e4214d8c9f84518c9.tar.gz
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/piix4.c')
-rw-r--r--hw/acpi/piix4.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
index d1f1179..f716e91 100644
--- a/hw/acpi/piix4.c
+++ b/hw/acpi/piix4.c
@@ -361,7 +361,11 @@ static void piix4_device_unplug_request_cb(HotplugHandler *hotplug_dev,
{
PIIX4PMState *s = PIIX4_PM(hotplug_dev);
- if (object_dynamic_cast(OBJECT(dev), TYPE_PCI_DEVICE)) {
+ if (s->acpi_memory_hotplug.is_enabled &&
+ object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM)) {
+ acpi_memory_unplug_request_cb(&s->ar, s->irq, &s->acpi_memory_hotplug,
+ dev, errp);
+ } else if (object_dynamic_cast(OBJECT(dev), TYPE_PCI_DEVICE)) {
acpi_pcihp_device_unplug_cb(&s->ar, s->irq, &s->acpi_pci_hotplug, dev,
errp);
} else {
OpenPOWER on IntegriCloud