[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 11/27] qom: fix canonical paths vs. interfaces
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PATCH v2 11/27] qom: fix canonical paths vs. interfaces |
Date: |
Sat, 4 Feb 2012 09:02:41 +0100 |
Signed-off-by: Paolo Bonzini <address@hidden>
---
qom/object.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/qom/object.c b/qom/object.c
index 75be582..e8418bc 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -819,6 +819,12 @@ void object_property_add_child(Object *obj, const char
*name,
{
gchar *type;
+ /* Registering an interface object in the composition tree will mightily
+ * confuse object_get_canonical_path (which, on the other hand, knows how
+ * to get the canonical path of an interface object).
+ */
+ assert(!object_is_type(obj, type_interface));
+
type = g_strdup_printf("child<%s>", object_get_typename(OBJECT(child)));
object_property_add(obj, name, type, object_get_child_property,
@@ -912,6 +918,10 @@ gchar *object_get_canonical_path(Object *obj)
Object *root = object_get_root();
char *newpath = NULL, *path = NULL;
+ if (object_is_type(obj, type_interface)) {
+ obj = INTERFACE(obj)->obj;
+ }
+
while (obj != root) {
ObjectProperty *prop = NULL;
--
1.7.7.6
- [Qemu-devel] [PATCH v2 15/27] qdev: remove parse method for string properties, (continued)
- [Qemu-devel] [PATCH v2 15/27] qdev: remove parse method for string properties, Paolo Bonzini, 2012/02/04
- [Qemu-devel] [PATCH v2 25/27] qdev: remove unused fields from PropertyInfo, Paolo Bonzini, 2012/02/04
- [Qemu-devel] [PATCH v2 21/27] qdev: fix off-by-one, Paolo Bonzini, 2012/02/04
- [Qemu-devel] [PATCH v2 09/27] qom: add object_resolve_path_type, Paolo Bonzini, 2012/02/04
- [Qemu-devel] [PATCH v2 27/27] omap: remove PROP_PTR properties, Paolo Bonzini, 2012/02/04
- [Qemu-devel] [PATCH v2 11/27] qom: fix canonical paths vs. interfaces,
Paolo Bonzini <=
- [Qemu-devel] [PATCH v2 22/27] qdev: access properties via QOM, Paolo Bonzini, 2012/02/04
- [Qemu-devel] [PATCH v2 23/27] qdev: inline qdev_prop_set into qdev_prop_set_ptr, Paolo Bonzini, 2012/02/04
- [Qemu-devel] [PATCH v2 19/27] qdev: remove parse/print methods for pointer properties, Paolo Bonzini, 2012/02/04
- Re: [Qemu-devel] [PATCH v2 00/27] next steps for qdev & QOM, Paolo Bonzini, 2012/02/07