Received: from eggs.gnu.org ([2001:4830:134:3::10]:45507) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKWcG-0000sV-Rq for qemu-devel@nongnu.org; Mon, 03 Mar 2014 12:25:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WKWcC-00053y-5w for qemu-devel@nongnu.org; Mon, 03 Mar 2014 12:25:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:23398) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKWcB-00053r-TA for qemu-devel@nongnu.org; Mon, 03 Mar 2014 12:25:20 -0500 Date: Mon, 3 Mar 2014 18:25:12 +0100 From: Igor Mammedov Message-ID: <20140303182512.2468bb1d@nial.usersys.redhat.com> In-Reply-To: <5314A623.8040908@suse.de> References: <1393833475-10179-1-git-send-email-akong@redhat.com> <20140303143423.26ec1879@nial.usersys.redhat.com> <5314A623.8040908@suse.de> MIME-Version: 1.0 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: Andreas =?ISO-8859-1?B?RuRyYmVy?= Cc: hutao@cn.fujitsu.com, qemu-devel@nongnu.org, armbru@redhat.com, aliguori@amazon.com, pbonzini@redhat.com, Amos Kong On Mon, 03 Mar 2014 16:56:19 +0100 Andreas F=E4rber wrote: > 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 device > > 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) >=20 > 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 I'm ok with it. Thanks! >=20 > Thanks, > Andreas >=20