From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41262) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agCDR-0000Rn-UA for qemu-devel@nongnu.org; Wed, 16 Mar 2016 10:14:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1agCDO-00054q-Ny for qemu-devel@nongnu.org; Wed, 16 Mar 2016 10:14:25 -0400 Received: from mx2.suse.de ([195.135.220.15]:44783) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agCDO-00054k-HT for qemu-devel@nongnu.org; Wed, 16 Mar 2016 10:14:22 -0400 References: <1458137462-30587-1-git-send-email-peter.maydell@linaro.org> From: =?UTF-8?Q?Andreas_F=c3=a4rber?= Message-ID: <56E96A3C.4020707@suse.de> Date: Wed, 16 Mar 2016 15:14:20 +0100 MIME-Version: 1.0 In-Reply-To: <1458137462-30587-1-git-send-email-peter.maydell@linaro.org> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] qdev_try_create(): Assert that devices we put onto the system bus are SysBusDevices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell , qemu-devel@nongnu.org Cc: Thomas Hanson Am 16.03.2016 um 15:11 schrieb Peter Maydell: > If qdev_try_create() is passed NULL for the bus, it will automatically > put the newly created device onto the default system bus. However > if the device is not actually a SysBusDevice then this will result > in later crashes (for instance when running the monitor "info qtree" > command) because code reasonably assumes that all devices on the system > bus are system bus devices. >=20 > Generally the mistake is that the calling code should create the > object with object_new(TYPE_FOO) rather than qdev_create(NULL, TYPE_FOO= ); > see commit 6749695eaaf346c1 for an example of fixing this bug. >=20 > Assert in qdev_try_create() if the device isn't suitable to put on > the system bus, so that this mistake results in failure earlier > and more reliably. >=20 > Signed-off-by: Peter Maydell > --- > This needs to go in after http://patchwork.ozlabs.org/patch/597716/ > as otherwise the bug fixed by that patch will become a 'make check' > failure. Looks strange, but okay, Reviewed-by: Andreas F=E4rber Through whose queue? Thanks, Andreas --=20 SUSE Linux GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Felix Imend=F6rffer, Jane Smithard, Graham Norton; HRB 21284 (AG N=FC= rnberg)