From: Michael Tokarev <mjt@tls.msk.ru>
To: qemu-devel <qemu-devel@nongnu.org>,
Paolo Bonzini <pbonzini@redhat.com>,
Peter Maydell <peter.maydell@linaro.org>,
Anthony Liguori <aliguori@us.ibm.com>
Subject: Re: [Qemu-devel] commit da57febfed "qdev: give all devices a canonical path" broke usb_del
Date: Wed, 08 Aug 2012 16:22:57 +0400 [thread overview]
Message-ID: <50225A21.6070208@msgid.tls.msk.ru> (raw)
In-Reply-To: <50225901.7040101@msgid.tls.msk.ru>
On 08.08.2012 16:18, Michael Tokarev wrote:
> While dealing with USB issues today I noticed that
> usb_del monitor command is broken, attempting to
> delete any usb device immediately results in assertion
> failure:
>
> (qemu) usb_del 0.1
> ERROR:qom/object.c:408:object_delete: assertion failed: (obj->ref == 0)
> Aborted
>
>
> I bisected this issue to commit:
>
> commit da57febfed7bad11be79f047b59719c38abd0712
> Author: Paolo Bonzini <pbonzini@redhat.com>
> Date: Tue Mar 27 18:38:47 2012 +0200
>
> qdev: give all devices a canonical path
>
> A strong limitation of QOM right now is that unconverted ports
> (e.g. all...) do not give a canonical path to devices that are
> part of the board. This in turn makes it impossible to replace
> PROP_PTR with a QOM link for example.
>
> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
>
>
> The problem is still present in current qemu/master git.
>
> I'm not sure what to do with this.
Well. This commit adds this code:
@@ -152,6 +152,16 @@ int qdev_init(DeviceState *dev)
+
+ if (!OBJECT(dev)->parent) {
+ static int unattached_count = 0;
+ gchar *name = g_strdup_printf("device[%d]", unattached_count++);
+
+ object_property_add_child(container_get("/unattached"), name,
+ OBJECT(dev), NULL);
+ g_free(name);
+ }
ie, there's now extra call to object_property_add_child(),
which does object_ref(). So no doubt there's no a new
assertion failure: (obj->ref == 0).
Once again, patch description does not reflect what is
actually done by the patch. Can we please stop this
practice of accepting patches with desrciption not
reflecting reality?
Back to the point: should there be a call to object_unref()
somewhere?
Thanks,
/mjt
next prev parent reply other threads:[~2012-08-08 12:23 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-08 12:18 [Qemu-devel] commit da57febfed "qdev: give all devices a canonical path" broke usb_del Michael Tokarev
2012-08-08 12:22 ` Michael Tokarev [this message]
2012-08-08 12:39 ` Paolo Bonzini
2012-08-08 12:48 ` Andreas Färber
2012-08-08 13:02 ` Paolo Bonzini
2012-08-08 13:09 ` Michael Tokarev
2012-08-08 14:42 ` Michael Tokarev
2012-08-08 16:08 ` Michael Tokarev
2012-08-20 17:58 ` Anthony Liguori
2012-08-21 7:06 ` Paolo Bonzini
2012-08-21 19:53 ` Anthony Liguori
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=50225A21.6070208@msgid.tls.msk.ru \
--to=mjt@tls.msk.ru \
--cc=aliguori@us.ibm.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--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.