[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/7] qom: add object_property_add_alias()
From: |
Peter Crosthwaite |
Subject: |
Re: [Qemu-devel] [PATCH 1/7] qom: add object_property_add_alias() |
Date: |
Fri, 23 May 2014 16:23:30 +1000 |
On Fri, May 23, 2014 at 12:38 AM, Stefan Hajnoczi <address@hidden> wrote:
> On Fri, May 23, 2014 at 12:02:44AM +1000, Peter Crosthwaite wrote:
>> On Thu, May 22, 2014 at 6:22 AM, Stefan Hajnoczi <address@hidden> wrote:
>> > +void object_property_add_alias(Object *obj, const char *name,
>> > + Object *target_obj, const char
>> > *target_name,
>> > + Error **errp)
>> > +{
>> > + AliasProperty *prop;
>> > + ObjectProperty *target_prop;
>> > +
>> > + target_prop = object_property_find(target_obj, target_name, errp);
>> > + if (!target_prop) {
>> > + return;
>>
>> Not sure silent failure is right here. This should perhaps populate
>> errp and then caller can decide to assert/ignore/report as needed.
>
> object_property_find() already populates errp so the error is not
> silent. Did you miss the errp argument to object_property_find()?
>
Yeh, so what's confused me here is using the function return to detect
error rather than the error mechanism. Its all good. The alternative
is the local_err = NULL / error_propagate pattern.
Out of scope of this work, but should we really be using return value
for error propagation when we have a usable errp argument?
Regards,
Peter
> Stefan
>
[Qemu-devel] [PATCH 3/7] virtio-blk: move x-data-plane qdev property to virtio-blk.h, Stefan Hajnoczi, 2014/05/21
[Qemu-devel] [PATCH 4/7] virtio-blk: use aliases instead of duplicate qdev properties, Stefan Hajnoczi, 2014/05/21