From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41732) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vkvnu-0000pr-Dr for qemu-devel@nongnu.org; Mon, 25 Nov 2013 08:02:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vkvno-0006Nk-GF for qemu-devel@nongnu.org; Mon, 25 Nov 2013 08:02:18 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42751) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vkvno-0006Na-74 for qemu-devel@nongnu.org; Mon, 25 Nov 2013 08:02:12 -0500 Message-ID: <52934A3F.9010807@redhat.com> Date: Mon, 25 Nov 2013 14:01:51 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1385001528-12003-1-git-send-email-imammedo@redhat.com> <1385001528-12003-13-git-send-email-imammedo@redhat.com> In-Reply-To: <1385001528-12003-13-git-send-email-imammedo@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 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: Igor Mammedov 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 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. Paolo