From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39130) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VkxL3-0004AH-4x for qemu-devel@nongnu.org; Mon, 25 Nov 2013 09:40:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VkxKw-0002yT-SJ for qemu-devel@nongnu.org; Mon, 25 Nov 2013 09:40:37 -0500 Received: from mx1.redhat.com ([209.132.183.28]:19486) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VkxKw-0002yP-Hs for qemu-devel@nongnu.org; Mon, 25 Nov 2013 09:40:30 -0500 Date: Mon, 25 Nov 2013 15:40:04 +0100 From: Igor Mammedov Message-ID: <20131125154004.5d2251f6@nial.usersys.redhat.com> In-Reply-To: <52934A3F.9010807@redhat.com> References: <1385001528-12003-1-git-send-email-imammedo@redhat.com> <1385001528-12003-13-git-send-email-imammedo@redhat.com> <52934A3F.9010807@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 12/27] dimm: add hotplug callback to DimmBus List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: peter.maydell@linaro.org, mdroth@linux.vnet.ibm.com, mst@redhat.com, mjt@tls.msk.ru, stefanb@linux.vnet.ibm.com, stefanha@redhat.com, armbru@redhat.com, qemu-devel@nongnu.org, vasilis.liaskovitis@profitbricks.com, quintela@redhat.com, chegu_vinod@hp.com, kraxel@redhat.com, aliguori@amazon.com, hutao@cn.fujitsu.com, marcel.a@redhat.com, lcapitulino@redhat.com, afaerber@suse.de On Mon, 25 Nov 2013 14:01:51 +0100 Paolo Bonzini wrote: > Il 21/11/2013 03:38, Igor Mammedov ha scritto: > > diff --git a/include/hw/mem/dimm.h b/include/hw/mem/dimm.h > > index abedae2..b655006 100644 > > --- a/include/hw/mem/dimm.h > > +++ b/include/hw/mem/dimm.h > > @@ -65,11 +65,15 @@ typedef struct DimmDeviceClass { > > * @parent_obj: opaque parent object container > > * @base: address from which to start mapping @DimmDevice > > * @as: hot-plugabble memory area where @DimmDevice-s are attached > > + * @hotplug_dev: device that hotplugs realized DimmDevice > > + * @hotplug: hotplug callback set by the board > > */ > > typedef struct DimmBus { > > BusState parent_obj; > > hwaddr base; > > MemoryRegion as; > > + DeviceState *hotplug_dev; > > + hotplug_fn hotplug; > > } DimmBus; > > > > /** > > > > So the alternatives here would be: > > (1) have DimmDevice call hotplug/hot_unplug in DimmBus; add a > ACPIHotplugDimmBus subclass that connects to ACPI. > > (2) have DeviceState call hotplug/hot_unplug in BusState; DimmBus does > nothing with it, and a ACPIHotplugDimmBus subclass implements it. Thanks, I'll try to implement it this way. > Paolo