Received: from eggs.gnu.org ([2001:4830:134:3::10]:46459) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZHvib-0002AS-VO for qemu-devel@nongnu.org; Wed, 22 Jul 2015 11:14:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZHviW-0007Gt-P5 for qemu-devel@nongnu.org; Wed, 22 Jul 2015 11:14:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40723) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZHviW-0007Gf-KG for qemu-devel@nongnu.org; Wed, 22 Jul 2015 11:13:56 -0400 From: Markus Armbruster References: <1436938201-16766-1-git-send-email-jasowang@redhat.com> <1436938201-16766-2-git-send-email-jasowang@redhat.com> <20150715110155.442078b5.cornelia.huck@de.ibm.com> <55A645A1.50708@redhat.com> Date: Wed, 22 Jul 2015 17:13:53 +0200 In-Reply-To: <55A645A1.50708@redhat.com> (Paolo Bonzini's message of "Wed, 15 Jul 2015 13:36:01 +0200") Message-ID: <87k2tsjkcu.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH V2 1/5] virtio: get_features() can fail List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: kwolf@redhat.com, mst@redhat.com, Jason Wang , qemu-devel@nongnu.org, stefanha@redhat.com, Cornelia Huck Paolo Bonzini 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.