[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 02/16] qom: store object with correct type in interf
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PATCH 02/16] qom: store object with correct type in interface links |
Date: |
Thu, 2 Feb 2012 17:45:28 +0100 |
When a link property's type is an interface, the code expects the
implementation object (not the parent object) to be stored in the
variable. The parent object does not contain the right vtable.
Signed-off-by: Paolo Bonzini <address@hidden>
---
qom/object.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/qom/object.c b/qom/object.c
index cd517f6..de6484d 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -749,7 +749,8 @@ static void object_set_link_property(Object *obj, Visitor
*v, void *opaque,
target_type = g_strdup(&type[5]);
target_type[strlen(target_type) - 2] = 0;
- if (object_dynamic_cast(target, target_type)) {
+ target = object_dynamic_cast(target, target_type);
+ if (target) {
object_ref(target);
*child = target;
} else {
--
1.7.7.6
Re: [Qemu-devel] [PATCH 01/16] qdev: fix hot-unplug, Anthony Liguori, 2012/02/03
[Qemu-devel] [PATCH 02/16] qom: store object with correct type in interface links,
Paolo Bonzini <=
[Qemu-devel] [PATCH 04/16] qom: add QObject-based property get/set wrappers, Paolo Bonzini, 2012/02/02