From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56364) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKVXy-0006ee-Ju for qemu-devel@nongnu.org; Mon, 03 Mar 2014 11:16:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WKVXt-0005gC-Ht for qemu-devel@nongnu.org; Mon, 03 Mar 2014 11:16:54 -0500 Received: from mx1.redhat.com ([209.132.183.28]:14859) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKVXt-0005fz-9F for qemu-devel@nongnu.org; Mon, 03 Mar 2014 11:16:49 -0500 Date: Tue, 4 Mar 2014 00:15:39 +0800 From: Amos Kong Message-ID: <20140303161539.GB23745@amosk.info> References: <1393862124-26806-1-git-send-email-akong@redhat.com> <5314A75E.6030007@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <5314A75E.6030007@suse.de> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PCTCH v4] qdev: set properties after device's parent is assigned List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?iso-8859-1?Q?F=E4rber?= Cc: hutao@cn.fujitsu.com, pbonzini@redhat.com, qemu-devel@nongnu.org, aliguori@amazon.com, armbru@redhat.com On Mon, Mar 03, 2014 at 05:01:34PM +0100, Andreas F=E4rber wrote: > Hi, >=20 > Am 03.03.2014 16:55, schrieb Amos Kong: > > Test steps: > > (qemu) device_add e1000,addr=3Dadsf > > Property 'e1000.addr' doesn't take value 'adsf' > > (qemu) info qtree > > Then qemu crashed. > >=20 > > Currently we set a link to the new device for qdev parent bus, but th= e > > device hasn't been added to QOM tree. When it fails to set properties= , > > object_unparent() can't cleanup the device. > >=20 > > Delay device property setting until device's parent is assigned. This > > way when property setting fails, object_unparent() can cleanup failed > > device properly. > >=20 > > Signed-off-by: Amos Kong > > Reviewed-By: Igor Mammedov > > --- > > V2: fix bz by adjust the initialization order (Paolo) > > V3: fix bug without making it differs with legacy devices > > creation (Andreas) > > V4: update subject and commitlog >=20 > I already applied a variation of v3. In particular I used qdev-monitor > for consistency and clarified that it is about device_add. >=20 > https://github.com/afaerber/qemu-cpu/commits/qom-next =20 Your change's fine. I saw your comment on V3 thread after sent out V4 :-) Thanks. > If you don't like something in there, can you please just suggest an > alternative sentence/paragraph for me to update? >=20 > Thanks, > Andreas >=20 > --=20 > SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany > GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrn= berg --=20 Amos.