From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:36226) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SgVOH-0002WH-CM for qemu-devel@nongnu.org; Mon, 18 Jun 2012 02:24:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SgVOF-0002xS-JY for qemu-devel@nongnu.org; Mon, 18 Jun 2012 02:24:44 -0400 Received: from mout.web.de ([212.227.15.4]:55964) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SgVOF-0002xI-A8 for qemu-devel@nongnu.org; Mon, 18 Jun 2012 02:24:43 -0400 Message-ID: <4FDEC9A1.4070508@web.de> Date: Mon, 18 Jun 2012 08:24:33 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <36AF4B62444F4B4FB04EDD1FDAE1CF1D4889875E@G4W3209.americas.hpqcorp.net> <20120612082641.GC12356@redhat.com> <36AF4B62444F4B4FB04EDD1FDAE1CF1D48899822@G4W3209.americas.hpqcorp.net> <20120617083427.GB28089@redhat.com> <4FDDE974.3040001@codemonkey.ws> In-Reply-To: <4FDDE974.3040001@codemonkey.ws> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigBC9105EEAFA9376FA03B0566" Subject: Re: [Qemu-devel] [PATCH] Fix for qemu crash on assertion error when adding PCI passthru device. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: "Ma, Stephen B." , "'qemu-devel@nongnu.org'" , "Michael S. Tsirkin" This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigBC9105EEAFA9376FA03B0566 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 2012-06-17 16:28, Anthony Liguori wrote: > On 06/17/2012 03:34 AM, Michael S. Tsirkin wrote: >> On Sun, Jun 17, 2012 at 06:26:33AM +0000, Ma, Stephen B. wrote: >>> >>> Michael, >>> >>> Thanks for the review. I added the unparent to the qdev_free. >>> >>> >>> --- >>> hw/qdev.c | 1 + >>> 1 files changed, 1 insertions(+), 0 deletions(-) >>> >>> diff --git a/hw/qdev.c b/hw/qdev.c >>> index d2dc28b..ed1328d 100644 >>> --- a/hw/qdev.c >>> +++ b/hw/qdev.c >>> @@ -264,6 +264,7 @@ void qdev_init_nofail(DeviceState *dev) >>> /* Unlink device from bus and free the structure. */ >>> void qdev_free(DeviceState *dev) >>> { >>> + object_unparent(OBJECT(dev)); >>> object_delete(OBJECT(dev)); >>> } >>> >>> --=20 >>> 1.7.1 >> >> Anthony, any feedback? >=20 > Yes, this is wrong. >=20 > PCI passthrough isn't in qemu.git so it's not clear to me where this is= > happening. Why would qdev_free be called when adding a PCI passthru > device? The bug is reproducible with any in-tree device (at least PCI) that happens to return !=3D 0 from its init handler. Jan --------------enigBC9105EEAFA9376FA03B0566 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk/eyaYACgkQitSsb3rl5xSS5wCdGJ7O70Jka3HW9pxhP7b7WWuz PtMAn3WxN9sB2QDgv2QUwcZjYCUeWvGy =B+Ff -----END PGP SIGNATURE----- --------------enigBC9105EEAFA9376FA03B0566--