qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Amos Kong <akong@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] qom: fix refcounting in object_property_del_child()
Date: Fri, 11 May 2012 22:52:20 +0800	[thread overview]
Message-ID: <4FAD27A4.9000806@redhat.com> (raw)
In-Reply-To: <4FACB4E4.2070708@redhat.com>

On 05/11/2012 02:42 PM, Paolo Bonzini wrote:
> Il 11/05/2012 04:15, Amos Kong ha scritto:
>> Start VM with 8 multiple-function block devs, hot-removing
>> those block devs by 'device_del ...' would cause qemu abort.
>>
>> object_ref() is called in object_property_add_child(),
>> but we don't unref it in object_property_del_child().
>>
>> | (qemu) device_del virti0-0-0
>> | (qemu) **
>> | ERROR:qom/object.c:389:object_delete: assertion failed: (obj->ref == 0)
>>
>> Signed-off-by: Amos Kong <akong@redhat.com>
>> ---
>>  qom/object.c |    1 +
>>  1 files changed, 1 insertions(+), 0 deletions(-)
>>
>> diff --git a/qom/object.c b/qom/object.c
>> index e721fc2..9da6b59 100644
>> --- a/qom/object.c
>> +++ b/qom/object.c
>> @@ -320,6 +320,7 @@ static void object_property_del_child(Object *obj, Object *child, Error **errp)
>>      QTAILQ_FOREACH(prop, &obj->properties, node) {
>>          if (strstart(prop->type, "child<", NULL) && prop->opaque == child) {
>>              object_property_del(obj, prop->name, errp);
>> +            object_unref(child);
> 
> This should be called by object_finalize_child_property instead, can you
> check why this is not the case?

Yes, original ref/unref are right.
I will post another patch to fix this issue.


NAK this patch.


> Paolo

Thanks!

-- 
			Amos.

  reply	other threads:[~2012-05-11 14:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-11  2:15 [Qemu-devel] [PATCH] qom: fix refcounting in object_property_del_child() Amos Kong
2012-05-11  6:42 ` Paolo Bonzini
2012-05-11 14:52   ` Amos Kong [this message]
2012-05-11 14:57   ` [Qemu-devel] [PATCH] pci: unplug all devs of same slot once Amos Kong
2012-05-13  0:40     ` Amos Kong
2012-05-13 10:54     ` Michael S. Tsirkin
2012-05-14  7:55       ` Paolo Bonzini
2012-05-20  9:57     ` [Qemu-devel] [PATCH v3] pci: call object_unparent() before free_qdev() Amos Kong
2012-05-20 10:22       ` Michael S. Tsirkin
2012-06-04 20:15       ` Jason Baron
2012-06-04 21:52         ` Michael S. Tsirkin
2012-06-07 14:06           ` Jason Baron

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=4FAD27A4.9000806@redhat.com \
    --to=akong@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=pbonzini@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).