From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:47946) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TjXCY-0007RE-Bg for qemu-devel@nongnu.org; Fri, 14 Dec 2012 10:29:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TjXCX-0000CP-7W for qemu-devel@nongnu.org; Fri, 14 Dec 2012 10:29:26 -0500 Received: from cantor2.suse.de ([195.135.220.15]:46479 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TjXCW-0000CJ-Tl for qemu-devel@nongnu.org; Fri, 14 Dec 2012 10:29:25 -0500 Message-ID: <50CB45CF.5000709@suse.de> Date: Fri, 14 Dec 2012 16:29:19 +0100 From: =?ISO-8859-1?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1354726153-30264-1-git-send-email-ehabkost@redhat.com> <1354726153-30264-9-git-send-email-ehabkost@redhat.com> <50C887D0.7050704@suse.de> <20121212135901.GD3236@otherpad.lan.raisama.net> <20121212152724.7693d277@nial.usersys.redhat.com> In-Reply-To: <20121212152724.7693d277@nial.usersys.redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 8/8] qom: Make CPU a child of DeviceState List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov , Paolo Bonzini , Anthony Liguori Cc: Don Slutz , Eduardo Habkost , qemu-devel@nongnu.org Am 12.12.2012 15:27, schrieb Igor Mammedov: > On Wed, 12 Dec 2012 11:59:01 -0200 > Eduardo Habkost wrote: >> On Wed, Dec 12, 2012 at 02:34:08PM +0100, Andreas F=E4rber wrote: >>> This patch makes the CPU a device and looks good so far but does not >>> initialize the devices in cpu_*_init() like Anthony did in his previo= us >>> patch. I am unsure whether you forgot to do so or whether you wanted = to >>> help keep our new CPU code clean of old-style qdev_init_nofail() call= s? >>> Since you don't add a qdev initfn here the main difference will be th= e >>> devices internally staying in "created" rather than "initialized" sta= te. >> >> I think I used a version without the qdev_init_nofail() as base for th= is >> series (we had multiple proposals being sent in parallel, in the >> beginning), and in the end I forgot that we had a version with those >> calls being added. >> >> The CPU classes don't set any DeviceClass.init() method, so in theory >> the missing qdev_init() calls wouldn't make any difference by now. On >> the other hand, keeping the device in "created" state sounds bad... bu= t >> maybe this acceptable while we are still converting the CPU realize() >> functions to fit inside the DeviceState initialization abstraction? > Testing shows that lack of qdev_create()/init() doesn't break anything = so > far. The latest motivation for making the CPU a device was to have the static properties infrastructure for machine/CPU versioning. The global property defaults are set in qdev's instance_init, so object_new() seems fine for that. qdev_[try_]create() would further set the parent bus to SysBus if NULL. The CPU is not a SysBusDevice so I think not using qdev_create() may be safer... Maybe Anthony or Paolo can confirm? Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg