From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60274) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V5yBv-0002BK-3r for qemu-devel@nongnu.org; Sun, 04 Aug 2013 09:17:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V5yBn-0003Ql-8x for qemu-devel@nongnu.org; Sun, 04 Aug 2013 09:17:47 -0400 Received: from cantor2.suse.de ([195.135.220.15]:47052 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V5yBm-0003QR-W1 for qemu-devel@nongnu.org; Sun, 04 Aug 2013 09:17:39 -0400 Message-ID: <51FE546B.1070300@suse.de> Date: Sun, 04 Aug 2013 15:17:31 +0200 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <1375621501-5564-1-git-send-email-afaerber@suse.de> In-Reply-To: <1375621501-5564-1-git-send-email-afaerber@suse.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH for-1.6] pxa2xx: Avoid object_get_link_property() assertion for "parent_bus" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Paul Brook , Anthony Liguori Am 04.08.2013 15:05, schrieb Andreas F=C3=A4rber: > pxa2xx_i2c_init() creates a pxa2xx-i2c-slave device on a second i2c-bus= , > which has a NULL parent device. This causes an assertion in > object_get_canonical_path() when accessing pxa2xx-i2c-slave's > "parent_bus" link property in tosa and likely other PXA2xx machine= s. >=20 > Fix this by using the pxa2xx_i2c device, created just before, as parent= . >=20 > Signed-off-by: Andreas F=C3=A4rber CC'ing Anthony as this may be lurking elsewhere, too. Unfortunately qtest can still only send QMP command but does not return the response, so we can't generically test walking the QOM composition tree in my proposed qom-test. Andreas > --- > hw/arm/pxa2xx.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) >=20 > diff --git a/hw/arm/pxa2xx.c b/hw/arm/pxa2xx.c > index 7de6453..17ddd3f 100644 > --- a/hw/arm/pxa2xx.c > +++ b/hw/arm/pxa2xx.c > @@ -1479,6 +1479,7 @@ PXA2xxI2CState *pxa2xx_i2c_init(hwaddr base, > DeviceState *dev; > SysBusDevice *i2c_dev; > PXA2xxI2CState *s; > + i2c_bus *i2cbus; > =20 > dev =3D qdev_create(NULL, TYPE_PXA2XX_I2C); > qdev_prop_set_uint32(dev, "size", region_size + 1); > @@ -1491,7 +1492,8 @@ PXA2xxI2CState *pxa2xx_i2c_init(hwaddr base, > =20 > s =3D PXA2XX_I2C(i2c_dev); > /* FIXME: Should the slave device really be on a separate bus? */ > - dev =3D i2c_create_slave(i2c_init_bus(NULL, "dummy"), "pxa2xx-i2c-= slave", 0); > + i2cbus =3D i2c_init_bus(dev, "dummy"); > + dev =3D i2c_create_slave(i2cbus, "pxa2xx-i2c-slave", 0); > s->slave =3D FROM_I2C_SLAVE(PXA2xxI2CSlaveState, I2C_SLAVE(dev)); > s->slave->host =3D s; > =20 --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3=BC= rnberg