[Top][All Lists]

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

[Qemu-devel] [PATCH 10/18] qom: release previous object when setting

From: minyard
Subject: [Qemu-devel] [PATCH 10/18] qom: release previous object when setting
Date: Thu, 19 Jul 2012 13:53:25 -0500

From: Corey Minyard <address@hidden>

When setting an object, if you don't release the previous object
that was there, it may become unusable.  This change allows a
chardev to be removed from one object's properties and added to

Signed-off-by: Corey Minyard <address@hidden>
Acked-by: Paolo Bonzini <address@hidden>
 qom/object.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/qom/object.c b/qom/object.c
index 00bb3b0..f0ff9cc 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -731,6 +731,9 @@ void object_property_set(Object *obj, Visitor *v, const 
char *name,
     if (!prop->set) {
         error_set(errp, QERR_PERMISSION_DENIED);
     } else {
+        if (prop->release) {
+            prop->release(obj, name, prop->opaque);
+        }
         prop->set(obj, v, prop->opaque, name, errp);

reply via email to

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