From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40588) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGKdc-0002Km-G2 for qemu-devel@nongnu.org; Tue, 27 Jan 2015 23:54:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YGKdX-0002UV-Hk for qemu-devel@nongnu.org; Tue, 27 Jan 2015 23:54:00 -0500 Received: from e28smtp08.in.ibm.com ([122.248.162.8]:45218) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGKdW-0002Sp-TB for qemu-devel@nongnu.org; Tue, 27 Jan 2015 23:53:55 -0500 Received: from /spool/local by e28smtp08.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 28 Jan 2015 10:23:50 +0530 Received: from d28relay05.in.ibm.com (d28relay05.in.ibm.com [9.184.220.62]) by d28dlp03.in.ibm.com (Postfix) with ESMTP id 9DD421258DA4 for ; Wed, 28 Jan 2015 09:51:07 +0530 (IST) Received: from d28av01.in.ibm.com (d28av01.in.ibm.com [9.184.220.63]) by d28relay05.in.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t0S4K1Hh6095296 for ; Wed, 28 Jan 2015 09:50:04 +0530 Received: from d28av01.in.ibm.com (localhost [127.0.0.1]) by d28av01.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t0S4K0Gd023100 for ; Wed, 28 Jan 2015 09:50:00 +0530 Date: Wed, 28 Jan 2015 09:49:56 +0530 From: Bharata B Rao Message-ID: <20150128041956.GA3393@in.ibm.com> References: <1420697420-16053-1-git-send-email-bharata@linux.vnet.ibm.com> <1420697420-16053-7-git-send-email-bharata@linux.vnet.ibm.com> <20150122221601.30063.38097@loki> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150122221601.30063.38097@loki> Subject: Re: [Qemu-devel] [RFC PATCH v1 06/13] spapr: CPU hotplug support Reply-To: bharata@linux.vnet.ibm.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Roth Cc: imammedo@redhat.com, qemu-devel@nongnu.org, agraf@suse.de On Thu, Jan 22, 2015 at 04:16:01PM -0600, Michael Roth wrote: > Quoting Bharata B Rao (2015-01-08 00:10:13) > > +static void spapr_machine_device_plug(HotplugHandler *hotplug_dev, > > + DeviceState *dev, Error **errp) > > +{ > > + if (object_dynamic_cast(OBJECT(dev), TYPE_CPU)) { > > + if (dev->hotplugged) { > > Maybe just > > if (dev->hotplugged && spapr->dr_cpu_enabled) { > ... > > Would do it This is a common ->plug() handler and would be used for memory too. Hence there is a need to identify the type of object (CPU or memory) and handle it differently. Regards, Bharata.