From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54057) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XecvV-0000xy-6s for qemu-devel@nongnu.org; Thu, 16 Oct 2014 00:44:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XecvQ-0002KB-J7 for qemu-devel@nongnu.org; Thu, 16 Oct 2014 00:44:37 -0400 Received: from [59.151.112.132] (port=34269 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XecvQ-0002IZ-2R for qemu-devel@nongnu.org; Thu, 16 Oct 2014 00:44:32 -0400 From: Tang Chen Date: Thu, 16 Oct 2014 12:44:19 +0800 Message-ID: <1413434666-22732-6-git-send-email-tangchen@cn.fujitsu.com> In-Reply-To: <1413434666-22732-1-git-send-email-tangchen@cn.fujitsu.com> References: <1413434666-22732-1-git-send-email-tangchen@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [PATCH v4 05/12] acpi, piix4: Add memory hot unplug support for piix4. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, imammedo@redhat.com, mst@redhat.com, pbonzini@redhat.com Cc: hutao@cn.fujitsu.com, isimatu.yasuaki@jp.fujitsu.com, zhugh.fnst@cn.fujitsu.com, tangchen@cn.fujitsu.com From: Hu Tao 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 Signed-off-by: Tang Chen --- 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 48a0174..f12bb9d 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -359,7 +359,11 @@ static void piix4_device_unplug_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