From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33964) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W5Eer-0002Gz-H1 for qemu-devel@nongnu.org; Mon, 20 Jan 2014 08:12:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W5Eel-0003FX-3F for qemu-devel@nongnu.org; Mon, 20 Jan 2014 08:12:53 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58160) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W5Eek-0003FT-Qz for qemu-devel@nongnu.org; Mon, 20 Jan 2014 08:12:47 -0500 From: Markus Armbruster References: <1388624531-13439-1-git-send-email-akong@redhat.com> Date: Mon, 20 Jan 2014 14:12:37 +0100 In-Reply-To: <1388624531-13439-1-git-send-email-akong@redhat.com> (Amos Kong's message of "Thu, 2 Jan 2014 09:02:11 +0800") Message-ID: <87ob36u796.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v2] qdev: add the device to the QOM tree before using it to set a link List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amos Kong Cc: pbonzini@redhat.com, hutao@cn.fujitsu.com, qemu-devel@nongnu.org, aliguori@amazon.com, afaerber@suse.de Amos Kong writes: > Test steps: > (qemu) device_add e1000,addr=adsf > 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 qdev_set_parent_bus() back to object_property_add_child(), > we only needs to unref the object if setting properties fails. > > Signed-off-by: Amos Kong Broken in commit e0a83fc. Could be mentioned in commit message. Tested-by: Markus Armbruster