Received: from eggs.gnu.org ([2001:4830:134:3::10]:60190) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGod2-0001Ts-4V for qemu-devel@nongnu.org; Thu, 29 Jan 2015 07:55:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YGocv-0001fx-7t for qemu-devel@nongnu.org; Thu, 29 Jan 2015 07:55:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:32797) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGocu-0001fU-WB for qemu-devel@nongnu.org; Thu, 29 Jan 2015 07:55:17 -0500 Date: Thu, 29 Jan 2015 13:55:04 +0100 From: Igor Mammedov Message-ID: <20150129135504.7ca0c1ed@nial.brq.redhat.com> In-Reply-To: <1420679180-14883-10-git-send-email-tangchen@cn.fujitsu.com> References: <1420679180-14883-1-git-send-email-tangchen@cn.fujitsu.com> <1420679180-14883-10-git-send-email-tangchen@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RESEND PATCH v1 09/13] acpi, piix4: Add memory hot unplug support for piix4. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Tang Chen Cc: zhugh.fnst@cn.fujitsu.com, mst@redhat.com, hutao@cn.fujitsu.com, qemu-devel@nongnu.org, isimatu.yasuaki@jp.fujitsu.com, guz.fnst@cn.fujitsu.com, pbonzini@redhat.com On Thu, 8 Jan 2015 09:06:16 +0800 Tang Chen wrote: > Call memory unplug cb in piix4_device_unplug_cb(). > --- > hw/acpi/piix4.c | 12 ++++++++++-- > 1 file changed, 10 insertions(+), 2 deletions(-) > > diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c > index f809c3a..4ae4867 100644 > --- a/hw/acpi/piix4.c > +++ b/hw/acpi/piix4.c > @@ -377,8 +377,16 @@ static void piix4_device_unplug_request_cb(HotplugHandler *hotplug_dev, > static void piix4_device_unplug_cb(HotplugHandler *hotplug_dev, > DeviceState *dev, Error **errp) > { > - error_setg(errp, "acpi: device unplug for not supported device" > - " type: %s", object_get_typename(OBJECT(dev))); > + PIIX4PMState *s = PIIX4_PM(hotplug_dev); > + > + if (s->acpi_memory_hotplug.is_enabled && is above check really necessary? If yes, do it inside common acpi_memory_unplug_cb() > + object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM)) { > + acpi_memory_unplug_cb(&s->ar, s->irq, &s->acpi_memory_hotplug, > + dev, errp); > + } else { > + error_setg(errp, "acpi: device unplug for not supported device" > + " type: %s", object_get_typename(OBJECT(dev))); > + } > } > > static void piix4_update_bus_hotplug(PCIBus *pci_bus, void *opaque)