Received: from eggs.gnu.org ([2001:4830:134:3::10]:56063) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLtSJ-0001Aq-9M for qemu-devel@nongnu.org; Wed, 20 Jan 2016 09:09:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aLtSD-0007h3-Jk for qemu-devel@nongnu.org; Wed, 20 Jan 2016 09:09:51 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41797) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLtSD-0007gw-EO for qemu-devel@nongnu.org; Wed, 20 Jan 2016 09:09:45 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 12AB2C09FAB0 for ; Wed, 20 Jan 2016 14:09:45 +0000 (UTC) From: Markus Armbruster References: <1453219845-30939-1-git-send-email-eblake@redhat.com> <1453219845-30939-7-git-send-email-eblake@redhat.com> Date: Wed, 20 Jan 2016 15:09:42 +0100 In-Reply-To: <1453219845-30939-7-git-send-email-eblake@redhat.com> (Eric Blake's message of "Tue, 19 Jan 2016 09:10:14 -0700") Message-ID: <87vb6otk9l.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v9 06/37] balloon: Improve use of qapi visitor List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: marcandre.lureau@redhat.com, qemu-devel@nongnu.org, "Michael S. Tsirkin" Eric Blake writes: > Rework the control flow of balloon_stats_get_all() to make it > easier for a later patch to split visit_end_struct(). Also > switch to the uint64 visitor to match the data type. > > Signed-off-by: Eric Blake > Reviewed-by: Marc-Andr=C3=A9 Lureau > > --- > v9: no change > v8: no change > v7: place earlier in series > v6: new patch, split from RFC on v5 7/46 > --- > hw/virtio/virtio-balloon.c | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > > diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c > index 9671635..1ce987a 100644 > --- a/hw/virtio/virtio-balloon.c > +++ b/hw/virtio/virtio-balloon.c > @@ -130,10 +130,13 @@ static void balloon_stats_get_all(Object *obj, stru= ct Visitor *v, > if (err) { > goto out_end; > } > - for (i =3D 0; !err && i < VIRTIO_BALLOON_S_NR; i++) { > - visit_type_int64(v, (int64_t *) &s->stats[i], balloon_stat_names= [i], > - &err); > + for (i =3D 0; i < VIRTIO_BALLOON_S_NR; i++) { > + visit_type_uint64(v, &s->stats[i], balloon_stat_names[i], &err); > + if (err) { > + goto out_nested; > + } > } > +out_nested: > error_propagate(errp, err); > err =3D NULL; > visit_end_struct(v, &err); What's wrong with plain break? Hmm, PATCH 33 inserts something between the loop and the label. I would've used break here regardless of the extra churn, just to avoid review hiccups like this one. Too late now :)