Received: from eggs.gnu.org ([2001:4830:134:3::10]:39505) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abAVc-0008NC-T6 for qemu-devel@nongnu.org; Wed, 02 Mar 2016 12:24:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1abAVZ-0000JC-Fx for qemu-devel@nongnu.org; Wed, 02 Mar 2016 12:24:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34188) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abAVZ-0000J7-AL for qemu-devel@nongnu.org; Wed, 02 Mar 2016 12:24:21 -0500 From: Markus Armbruster References: <1456443528-13901-1-git-send-email-eblake@redhat.com> <1456443528-13901-3-git-send-email-eblake@redhat.com> Date: Wed, 02 Mar 2016 18:24:18 +0100 In-Reply-To: <1456443528-13901-3-git-send-email-eblake@redhat.com> (Eric Blake's message of "Thu, 25 Feb 2016 16:38:31 -0700") Message-ID: <87oaawhjy5.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v2 02/19] qapi-visit: Expose visit_type_FOO_members() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: qemu-devel@nongnu.org, Michael Roth Eric Blake writes: > Dan Berrange reported a case where he needs to work with a > QCryptoBlockOptions union type using the OptsVisitor, but only > visit one of the branches of that type (the discriminator is not > visited directly, but learned externally). When things were > boxed, it was easy: just visit the variant directly, which took > care of both allocating the variant and visiting its members, then > store that pointer in the union type. But now that things are > unboxed, we need a way to visit the members without allocation, > done by exposing visit_type_FOO_members() to the user. > > Before the patch, we had quite a bit of code associated with > object_members_seen to make sure that a declaration of the helper > was in scope before any use of the function. But now that the > helper is public and declared in the header, the .c file no > longer needs to worry about topological sorting (the helper is > always in scope), which leads to some nice cleanups. > > Signed-off-by: Eric Blake > > --- > v2: Rebase atop s/fields/members/rename, don't provide useless > declaration on alternates I like this much better than v1. Thanks!