Am 30.07.2012 15:51, schrieb Andreas Färber:
> Am 19.07.2012 20:53, schrieb [email protected]:
>> From: Corey Minyard <[email protected]>
>>
>> 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.
>>
>> Signed-off-by: Corey Minyard <[email protected]>
>> Acked-by: Paolo Bonzini <[email protected]>
>
> Reviewed-by: Andreas Färber <[email protected]>
>
> Anthony, this looks like a valid and generic QOM memory leak fix to me.
> Suggesting to cherry-pick this patch to master and stable-1.1.
Ping?
>
> Andreas
>
>> ---
>> 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);
>> }
>> }
>>
>
>
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg