From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40503) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYqNd-00068m-L6 for qemu-devel@nongnu.org; Mon, 07 Sep 2015 02:58:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZYqNY-0002Cz-MT for qemu-devel@nongnu.org; Mon, 07 Sep 2015 02:58:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43622) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYqNY-0002Co-Hr for qemu-devel@nongnu.org; Mon, 07 Sep 2015 02:58:12 -0400 From: Markus Armbruster References: <878u8mb62t.fsf@blackfin.pond.sub.org> <1441410668-25265-1-git-send-email-eblake@redhat.com> Date: Mon, 07 Sep 2015 08:58:09 +0200 In-Reply-To: <1441410668-25265-1-git-send-email-eblake@redhat.com> (Eric Blake's message of "Fri, 4 Sep 2015 17:51:08 -0600") Message-ID: <87io7mvhq6.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH RFC v4 02.5/32] qapi: Hide internal data members of schema objects. 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 Eric Blake writes: > We have a few fields that exist mainly to hold information from > __init__() until check() (matching the fact that parsing is > two-pass; the first to find type names, the second to associate > types together while honoring forward references), or which should > only be used through accessor methods. We should not use these > fields directly in other files after check() has run, so use the > python convention of naming these fields with leading underscore > to mark their internal usage, and to check that no one else was > using them. > > Exception: our crazy handling of simple unions (with a C member > 'kind' matching the QMP wire 'type') requires peeking through > the hidden field. This leaky abstraction will be cleaned up in > a later patch. There are two more peeks: QAPISchemaAlternateType peeks when it asserts it got simple variants, and test-qapi.py peeks when it prints a flat union's tag. You missed the latter, and neglected to mention the former. > Signed-off-by: Eric Blake > --- > > Technically, I wrote this patch after 32; if you decide to rebase > it into the series, you'll have to split it among 2, 10, 11, and 30. > Up to you if you want to squash this in during your spin of v5, or > if you want me to keep it as a separate patch for inclusion after > your series. I doubt the improvement worth the churn as a follow-up patch. Instead, I'll squash it in, less the rename of .tag_name, plus a few more renames elsewhere. Thanks!