qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [RESEND PATCH v4 05/10] acpi, piix4: Add memory hot unplug


From: Tang Chen
Subject: [Qemu-devel] [RESEND PATCH v4 05/10] acpi, piix4: Add memory hot unplug support for piix4.
Date: Wed, 22 Oct 2014 18:00:07 +0800

From: Hu Tao <address@hidden>

Implement acpi_memory_unplug_cb(), sending an sci to guest to trigger
memory hot-remove, and call it in piix4_device_unplug_cb().

Signed-off-by: Hu Tao <address@hidden>
Signed-off-by: Tang Chen <address@hidden>
---
 hw/acpi/piix4.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
index 1aa156b..d27fa5f 100644
--- a/hw/acpi/piix4.c
+++ b/hw/acpi/piix4.c
@@ -359,7 +359,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_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 {
-- 
1.8.4.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]