From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:51379) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rwjbr-0002QX-3i for qemu-devel@nongnu.org; Sun, 12 Feb 2012 19:17:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rwjbp-0007wH-Mo for qemu-devel@nongnu.org; Sun, 12 Feb 2012 19:17:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42796) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rwjbp-0007vl-FS for qemu-devel@nongnu.org; Sun, 12 Feb 2012 19:17:33 -0500 Date: Mon, 13 Feb 2012 02:17:35 +0200 From: "Michael S. Tsirkin" Message-ID: <20120213001735.GA8269@redhat.com> References: <20120212170743.GA3375@redhat.com> <20120212173140.GB3375@redhat.com> <4F37F910.5030400@codemonkey.ws> <20120212175659.GA4199@redhat.com> <4F381B4D.2000108@codemonkey.ws> <20120212201547.GC4199@redhat.com> <4F381EC7.3030407@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4F381EC7.3030407@codemonkey.ws> Subject: Re: [Qemu-devel] weird qdev error List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel@nongnu.org On Sun, Feb 12, 2012 at 02:19:19PM -0600, Anthony Liguori wrote: > On 02/12/2012 02:15 PM, Michael S. Tsirkin wrote: > >On Sun, Feb 12, 2012 at 02:04:29PM -0600, Anthony Liguori wrote: > >>On 02/12/2012 11:57 AM, Michael S. Tsirkin wrote: > >>>On Sun, Feb 12, 2012 at 11:38:24AM -0600, Anthony Liguori wrote: > >>>>From: Anthony Liguori > >>>>Date: Sun, 12 Feb 2012 11:36:24 -0600 > >>>>Subject: [PATCH] device_add: don't add a /peripheral link until init is complete > >>>> > >>>>Otherwise we end up with a dangling reference which causes qdev_free() to fail. > >>>> > >>>>Reported-by: Michael Tsirkin > >>>>Signed-off-by: Anthony Liguori > >>> > >>>This handles the option parsing but what about hotplug > >>>failures (when bus->hotplug returns an error)? > >> > >>Sorry, I don't follow. > >> > >>The assert you reported was that object_free() noted a reference > >>count of !0 which indicates something else was holding the reference > >>to the object. In this case, it was the child link in /peripheral. > >> > >>By delaying creating the link in /peripheral, we eliminate the problem completely. > > > >Th other problem was internal in pci which calls ->hostplug > >during initialization. This doesn't seem affected? > >But I didn't try, maybe I misundertand. > > Yeah, from qdev's perspective it's all just init failing. hotplug > is entirely a PCI concept. > > > > >>BTW, the explicit calls to do_pci_unregister are redundant. > >>finalize() will be called during cleanup which means exit() will be > >>invoked (which already calls do_pci_unregister). I'm not sure why > >>this isn't failing more aggressively but it looks clearly wrong to > >>me. > >> > >>Regards, > >> > >>Anthony Liguori > > > >Me too. Want to try to drop them? > > Yeah, I'll make this a two patch series. > > Regards, > > Anthony Liguori I also see this: device_add virtio-net-pci,netdev=foo,mac=52:54:00:12:34:56,id=bla device_del bla *** glibc detected *** /home/mst/qemu-test/bin/qemu-system-x86_64: corrupted double-linked list: 0x00007fae434565a0 *** Am I alone?