Received: from eggs.gnu.org ([2001:4830:134:3::10]:49989) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZteJ2-0000wj-Ez for qemu-devel@nongnu.org; Tue, 03 Nov 2015 11:19:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZteJ0-00066E-Ra for qemu-devel@nongnu.org; Tue, 03 Nov 2015 11:19:32 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44404) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZteJ0-00065t-M3 for qemu-devel@nongnu.org; Tue, 03 Nov 2015 11:19:30 -0500 From: Markus Armbruster References: <871tc8tnsl.fsf@blackfin.pond.sub.org> <1446504092-29008-2-git-send-email-eblake@redhat.com> <87611jjq98.fsf@blackfin.pond.sub.org> <5638B613.2020402@redhat.com> <87mvuvch9x.fsf@blackfin.pond.sub.org> <5638C0E8.1020102@redhat.com> Date: Tue, 03 Nov 2015 17:19:27 +0100 In-Reply-To: <5638C0E8.1020102@redhat.com> (Eric Blake's message of "Tue, 3 Nov 2015 07:12:56 -0700") Message-ID: <8737wn5a40.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v8.5 1/4] qapi: Drop all_members parameter from check() 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: > On 11/03/2015 07:02 AM, Markus Armbruster wrote: > >>>> I'm afraid you're omitting a few steps here, and I think you missed >>>> QAPISchemaObjectVariants.check()'s self.tag_member.check(). >>> >>> There is no self.tag_member.check(), any more; rather, my earlier >>> patches have reworked things so that tag_member is checked by the owner >>> (a flat union's base type, a simple union's local_members, or directly >>> in QAPISchemaAlternateType prior to calling Variants.check()). I guess >>> that's a pitfall of seeing this patch without my rework of 5/17 to >>> address your comments there. >> >> I'm assuming this patch is based on >> [PATCH v8 06/17] qapi-types: Consolidate gen_struct() and gen_union() >> which has >> >> def check(self, schema, members, seen): >> if self.tag_name: # flat union >> self.tag_member = seen[self.tag_name] >> elif seen: # simple union >> assert self.tag_member in seen.itervalues() >> else: # alternate >> ---> self.tag_member.check(schema, members, seen) >> >> in QAPISchemaObjectTypeVariants. > > That was true in v8, but not in my pending v9 which did essentially what > your 7/7 did (move the tag_member.check() into Alternate.check() back in > patch 5). > > At any rate, my first glance of your series shows that it is reasonable, > so my task today is to spit out a v9 of my series, but using your seven > patches in place of my four. Buyer beware: I'm not sure my seven do everything your four do. >> Yes, we're almost certainly headed in the same direction. But I got >> thoroughly confused and lost in the details on the way, so I had to hack >> things up myself to clear my head. The result looks nice to me, so I'll >> send it out in a jiffie in the hope you'll find it useful. >> > > Yes, it should make v9 easier when it includes your patches, because > then you know what to look for :) I hope I'll be less easily confused going forward...