From: Corey Minyard <cminy...@mvista.com>

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
another's.
---
 qom/object.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/qom/object.c b/qom/object.c
index 00bb3b0..484dc77 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -731,6 +731,8 @@ 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);
     }
 }
-- 
1.7.4.1


Reply via email to