Skip to contentSkip to conversation

qom: do nothing on unparent of object without parent

PATCH Applied Paolo Bonzini 3 participants 4 messages Apr 2, 2013 – Apr 22, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qom: do nothing on unparent of object without parent

Otherwise, device_unparent will fail to get a canonical path of the object.

---
 qom/object.c | 4 ++++
 1 file changed, 4 insertions(+)
qom/object.c +4 -0
index 8818149..093502e 100644
@@ -362,6 +362,10 @@ static void object_property_del_child(Object *obj, Object *child, Error **errp)
 
 void object_unparent(Object *obj)
 {
+    if (!obj->parent) {
+        return;
+    }
+
     object_ref(obj);
     if (obj->class->unparent) {
         (obj->class->unparent)(obj);
Signature · 1 line
1.8.1.4
#1 lore raw

Il 02/04/2013 15:50, Paolo Bonzini ha scritto:

Quoted 14 lines

Otherwise, device_unparent will fail to get a canonical path of the object.

---
 qom/object.c | 4 ++++
 1 file changed, 4 insertions(+)
qom/object.c +0 -0
index 8818149..093502e 100644

qom/object.c static void object_property_del_child(Object *obj, Object *child, Error **errp) · line 371

Quoted 10 lines
qom/object.c +4 -0
@@ -362,6 +362,10 @@ static void object_property_del_child(Object *obj, Object *child, Error **errp)
 
 void object_unparent(Object *obj)
 {
+    if (!obj->parent) {
+        return;
+    }
+
     object_ref(obj);
     if (obj->class->unparent) {
         (obj->class->unparent)(obj);

Ping.

Paolo

Reviewed-by on v1 1/1
#2 lore raw
In reply to Paolo Bonzini

Am 02.04.2013 15:50, schrieb Paolo Bonzini:

Quoted 4 lines

Otherwise, device_unparent will fail to get a canonical path of the object.

Andreas

Quoted 20 lines
---
 qom/object.c | 4 ++++
 1 file changed, 4 insertions(+)
qom/object.c +4 -0
index 8818149..093502e 100644
@@ -362,6 +362,10 @@ static void object_property_del_child(Object *obj, Object *child, Error **errp)
 
 void object_unparent(Object *obj)
 {
+    if (!obj->parent) {
+        return;
+    }
+
     object_ref(obj);
     if (obj->class->unparent) {
         (obj->class->unparent)(obj);
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg