Paolo Bonzini <pbonz...@redhat.com> writes:

> On 15/07/2015 11:01, Cornelia Huck wrote:
>> > diff --git a/hw/virtio/virtio-bus.c b/hw/virtio/virtio-bus.c
>> > index 3926f7e..febda76 100644
>> > --- a/hw/virtio/virtio-bus.c
>> > +++ b/hw/virtio/virtio-bus.c
>> > @@ -54,7 +54,8 @@ void virtio_bus_device_plugged(VirtIODevice *vdev, Error 
>> > **errp)
>> > 
>> >      /* Get the features of the plugged device. */
>> >      assert(vdc->get_features != NULL);
>> > -    vdev->host_features = vdc->get_features(vdev, vdev->host_features);
>> > +    vdev->host_features = vdc->get_features(vdev, vdev->host_features,
>> > +                                            errp);
>> >  }
>> > 
>> >  /* Reset the virtio_bus */
>>
>> Don't you need to propagate the error instead of passing it through? Or
>> am I just confused by error handling? :)
>
> Explicit propagation is only needed if you need to look at the error
> (because errp could be NULL).  Here you don't need to do that, so
> passing it through is fine.
>
> Error management is not hard if you know the rules (and the rules are
> not hard, just important).  Someone needs to dig up Markus's latest
> explanation and put it in docs/.

I got a patch pending that puts it in include/qapi/error.h:

    [PATCH 6/7] error: Revamp interface documentation

part of

    error: On abort, report where the error was created

Intend to respin soonish to address Eric's and Laszlo's review.

Reply via email to