qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v2 1/2] qom: Introduce object_property_try_add_child()


From: Paolo Bonzini
Subject: Re: [PATCH v2 1/2] qom: Introduce object_property_try_add_child()
Date: Wed, 24 Jun 2020 16:12:38 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0

On 24/06/20 14:43, Eric Auger wrote:
> +    op = object_property_try_add(obj, name, type, object_get_child_property,
> +                                 NULL, object_finalize_child_property,
> +                                 child, errp);
> +    if (!op) {
> +        goto out;
> +    }
>      op->resolve = object_resolve_child_property;
> +out:
>      object_ref(child);
>      child->parent = obj;
>      return op;

I think if there's an error you need to return NULL without ref-ing
child, shouldn't you?

You can then add another test that object_property_add_child succeeds
after object_property_try_add_child fails.

Paolo




reply via email to

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