Received: from eggs.gnu.org ([2001:4830:134:3::10]:58907) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WheY8-0001ec-M8 for qemu-devel@nongnu.org; Tue, 06 May 2014 08:32:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WheXz-0002Xx-5w for qemu-devel@nongnu.org; Tue, 06 May 2014 08:32:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42563) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WheXy-0002Xi-NC for qemu-devel@nongnu.org; Tue, 06 May 2014 08:32:35 -0400 From: Markus Armbruster References: <1399034675-17844-1-git-send-email-armbru@redhat.com> <1399034675-17844-13-git-send-email-armbru@redhat.com> <5368061D.9090201@redhat.com> Date: Tue, 06 May 2014 14:32:28 +0200 In-Reply-To: <5368061D.9090201@redhat.com> (Eric Blake's message of "Mon, 05 May 2014 15:43:57 -0600") Message-ID: <87lhuft7dv.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 12/13] qapi: Replace uncommon use of the error API by the common one List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com, lcapitulino@redhat.com, pbonzini@redhat.com, akong@redhat.com, vilanova@ac.upc.edu Eric Blake writes: > On 05/02/2014 06:44 AM, Markus Armbruster wrote: >> We commonly use the error API like this: >> > >> However, mixing the two techniques is confusing. You can't use the >> "accumulate" technique with functions designed for the "check >> separately" technique. You can use the "check separately" technique >> with functions designed for the "accumulate" technique, but then >> error_set() can't catch you setting an error more than once. > > Nice comparison of the two techniques. > >> >> Standardize on the "check separately" technique for now, because it's >> overwhelmingly prevalent. >> >> Signed-off-by: Markus Armbruster >> --- > >> +++ b/hw/virtio/virtio-balloon.c >> @@ -121,23 +121,27 @@ static void balloon_stats_get_all(Object *obj, struct Visitor *v, > >> visit_start_struct(v, NULL, NULL, "stats", 0, &err); >> if (err) { >> goto out_end; >> } >> - >> - for (i = 0; i < VIRTIO_BALLOON_S_NR; i++) { >> + for (i = 0; err && i < VIRTIO_BALLOON_S_NR; i++) { > > Oops; logic error makes this loop dead code. > > s/err/!err/ Oww! Respin coming... with all your nits fixed (you earned that). >> @@ -502,7 +503,7 @@ fdecl.write(mcgen(''' >> /* THIS FILE IS AUTOMATICALLY GENERATED, DO NOT MODIFY */ >> >> /* >> - * schema-defined QAPI visitor function >> + * schema-defined QAPI visitor functions > > Unrelated typo fix; could go in separately via -trivial if you were so > inclined, but I don't mind it going in here. > > If the logic error is the only fix, > Reviewed-by: Eric Blake Thanks!