qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [RFC v0 4/8] object: create default canonical paths for orp


From: Peter A. G. Crosthwaite
Subject: [Qemu-devel] [RFC v0 4/8] object: create default canonical paths for orphans
Date: Wed, 13 Jun 2012 19:38:33 +1000

Create a default canonical path for an object which doesnt have one. This
is a workaround for a bug probably buried deep with qdev as objects should
always have valid canonical paths, but the need came about with the
petalogix_ml605_mmu platform, the ethernet and dma devices as created by
qdev have bogus paths (apparently).

Signed-off-by: Peter A. G. Crosthwaite <address@hidden>
---
 qom/object.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/qom/object.c b/qom/object.c
index e6c3cfb..1eba795 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -983,6 +983,13 @@ gchar *object_get_canonical_path(Object *obj)
         obj = INTERFACE(obj)->iface_obj;
     }
 
+    if (obj->parent == NULL) {
+        static int num_orphans = 0;
+        char orphan_name [16];
+        snprintf(orphan_name, 16, "orphan%d", num_orphans++);
+        object_property_add_child(root, orphan_name, obj, NULL);
+    }
+
     while (obj != root) {
         ObjectProperty *prop = NULL;
 
-- 
1.7.3.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]