Received: from eggs.gnu.org ([2001:4830:134:3::10]:59594) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ymljc-0004WR-Dd for qemu-devel@nongnu.org; Mon, 27 Apr 2015 12:18:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YmljZ-00051s-88 for qemu-devel@nongnu.org; Mon, 27 Apr 2015 12:18:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55203) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YmljY-00050a-Ut for qemu-devel@nongnu.org; Mon, 27 Apr 2015 12:18:13 -0400 From: Markus Armbruster References: <1428206887-7921-1-git-send-email-eblake@redhat.com> <1428206887-7921-9-git-send-email-eblake@redhat.com> Date: Mon, 27 Apr 2015 18:18:08 +0200 In-Reply-To: <1428206887-7921-9-git-send-email-eblake@redhat.com> (Eric Blake's message of "Sat, 4 Apr 2015 22:07:39 -0600") Message-ID: <87vbgh1r5r.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v6 08/36] qapi: Add some union tests List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: kwolf@redhat.com, berto@igalia.co, qemu-devel@nongnu.org Eric Blake writes: > Demonstrate that the qapi generator doesn't deal well with unions > that aren't up to par. Later patches will update the expected > reseults as the generator is made stricter. A few tests work > as planned, but most show poor or missing error messages. > > Of particular note, qapi-code-gen.txt documents 'base' only for > flat unions, but the tests here demonstrate that we currently allow > a 'base' to a simple union, although it is exercised only in the > testsuite. Later patches will remove this undocumented feature, to > give us more flexibility in adding other future extensions to union > types. For example, one possible extension is the idea of a > type-safe simple enum, where added fields tie the discriminator to > a user-defined enum type rather than creating an implicit enum from > the names in 'data'. But adding such safety on top of a simple > enum with a base type could look ambiguous with a flat enum; > besides, the documentation also mentions how any simple union can > be represented by an equivalent flat union. So it will be simpler > to just outlaw support for something we aren't using. > > Signed-off-by: Eric Blake Reviewed-by: Markus Armbruster