[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] qom: fix refcounting in object_property_del_child()
From: |
Amos Kong |
Subject: |
[Qemu-devel] [PATCH] qom: fix refcounting in object_property_del_child() |
Date: |
Fri, 11 May 2012 10:15:31 +0800 |
User-agent: |
StGit/0.15 |
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 <address@hidden>
---
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);
break;
}
}
- [Qemu-devel] [PATCH] qom: fix refcounting in object_property_del_child(),
Amos Kong <=
- Re: [Qemu-devel] [PATCH] qom: fix refcounting in object_property_del_child(), Paolo Bonzini, 2012/05/11
- Re: [Qemu-devel] [PATCH] qom: fix refcounting in object_property_del_child(), Amos Kong, 2012/05/11
- [Qemu-devel] [PATCH] pci: unplug all devs of same slot once, Amos Kong, 2012/05/11
- [Qemu-devel] [PATCH v3] pci: call object_unparent() before free_qdev(), Amos Kong, 2012/05/20
- Re: [Qemu-devel] [PATCH v3] pci: call object_unparent() before free_qdev(), Michael S. Tsirkin, 2012/05/20
- Re: [Qemu-devel] [PATCH v3] pci: call object_unparent() before free_qdev(), Anthony Liguori, 2012/05/29
- Re: [Qemu-devel] [PATCH v3] pci: call object_unparent() before free_qdev(), Michael S. Tsirkin, 2012/05/30