From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51264) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKVEB-00009h-Hv for qemu-devel@nongnu.org; Mon, 03 Mar 2014 10:56:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WKVE4-0006uM-VT for qemu-devel@nongnu.org; Mon, 03 Mar 2014 10:56:27 -0500 Received: from cantor2.suse.de ([195.135.220.15]:40619 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKVE4-0006uD-Q0 for qemu-devel@nongnu.org; Mon, 03 Mar 2014 10:56:20 -0500 Message-ID: <5314A623.8040908@suse.de> Date: Mon, 03 Mar 2014 16:56:19 +0100 From: =?ISO-8859-1?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1393833475-10179-1-git-send-email-akong@redhat.com> <20140303143423.26ec1879@nial.usersys.redhat.com> In-Reply-To: <20140303143423.26ec1879@nial.usersys.redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v3] qdev: move the code adding the device out of realize List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov , Amos Kong Cc: hutao@cn.fujitsu.com, pbonzini@redhat.com, qemu-devel@nongnu.org, aliguori@amazon.com, armbru@redhat.com Am 03.03.2014 14:34, schrieb Igor Mammedov: > On Mon, 3 Mar 2014 15:57:55 +0800 > Amos Kong wrote: >=20 > s/subj/qdev: set properties after device's parent is assigned/ >=20 >> Test steps: >> (qemu) device_add e1000,addr=3Dadsf >> Property 'e1000.addr' doesn't take value 'adsf' >> (qemu) info qtree >> Then qemu crashed. >> >> Currently we set a link to the new device for qdev parent bus, but the >> device hasn't been added to QOM tree. When it fails to set properties, >> object_unparent() can't cleanup the device. >> >> This patch moves the code adding the device output realize, when it fa= ils >> to set properties, the device can be cleaned successfully. > Suggest rephrase as: > Delay device property setting until device's parent is assigned. This w= ay > when property setting fails, object_unparent() can cleanup failed devic= e > properly. >=20 > with above correction: > Reviewed-By: Igor Mammedov >=20 >> >> Signed-off-by: Amos Kong >> --- >> V2: fix bz by adjust the initialization order (Paolo) >> V3: fix bug without making it differs with legacy devices >> creation (Andreas) Perfect, I've tweaked the commit message along the lines of Igor's suggestion - please take a look if you want it changed differently: https://github.com/afaerber/qemu-cpu/commits/qom-next Thanks, 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