All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] weird qdev error
Date: Sun, 12 Feb 2012 14:04:29 -0600	[thread overview]
Message-ID: <4F381B4D.2000108@codemonkey.ws> (raw)
In-Reply-To: <20120212175659.GA4199@redhat.com>

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<aliguori@us.ibm.com>
>> 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<mst@redhat.com>
>> Signed-off-by: Anthony Liguori<aliguori@us.ibm.com>
>
> 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.

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

  reply	other threads:[~2012-02-12 20:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-12 17:07 [Qemu-devel] weird qdev error Michael S. Tsirkin
2012-02-12 17:31 ` Michael S. Tsirkin
2012-02-12 17:38   ` Anthony Liguori
2012-02-12 17:57     ` Michael S. Tsirkin
2012-02-12 20:04       ` Anthony Liguori [this message]
2012-02-12 20:15         ` Michael S. Tsirkin
2012-02-12 20:19           ` Anthony Liguori
2012-02-13  0:17             ` Michael S. Tsirkin
2012-02-13  1:18               ` Michael S. Tsirkin
2012-02-13  4:58                 ` Michael S. Tsirkin
2012-02-13 10:19                   ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F381B4D.2000108@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.