qom: In function object_set_link_property(), first call object_ref(), then object_unr...
commitf0cdc966fb8998bc6acc15fbd360e52061495557
authorAlexander Barabash <alexander_barabash@mentor.com>
Wed, 22 Feb 2012 17:22:26 +0000 (22 19:22 +0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Wed, 22 Feb 2012 19:24:30 +0000 (22 13:24 -0600)
treeea0db3d4a80842fee1e2f560acf085688ba4eacd
parentadbbdf2484b74a4216e4b481ec6146e3ea0061e4
qom: In function object_set_link_property(), first call object_ref(), then object_unref().

In the old implementation, if the new value of the property links
to the same object, as the old value, that object is first unref-ed,
and then ref-ed. This leads to unintended deinitialization of that object.

In the new implementation, this is fixed.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Alexander Barabash <alexander_barabash@mentor.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qom/object.c