From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34471) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ae76j-0002jR-SU for qemu-devel@nongnu.org; Thu, 10 Mar 2016 15:22:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ae76j-0007hE-0n for qemu-devel@nongnu.org; Thu, 10 Mar 2016 15:22:53 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51135) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ae76i-0007h6-S7 for qemu-devel@nongnu.org; Thu, 10 Mar 2016 15:22:52 -0500 From: Markus Armbruster References: <1457571335-10938-1-git-send-email-eblake@redhat.com> <1457571335-10938-14-git-send-email-eblake@redhat.com> Date: Thu, 10 Mar 2016 21:22:49 +0100 In-Reply-To: <1457571335-10938-14-git-send-email-eblake@redhat.com> (Eric Blake's message of "Wed, 9 Mar 2016 17:55:34 -0700") Message-ID: <87k2laozfq.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v5 13/14] qapi: Allow anonymous base for flat union 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: > Rather than requiring all flat unions to explicitly create > a separate base struct, we can allow the qapi schema to specify > the common members via an inline dictionary. This is similar to > how commands can specify an inline anonymous type for its 'data'. > We already have several struct types that only exist to serve as > a single flat union's base; the next commit will clean them up > (in particular, the doc change to the BlockdevOptions example in > this patch will be reflected to QMP in the next). The parenthesis is a bit cryptic. "Reflected"? > Now that anonymous bases are legal, we need to rework the > flat-union-bad-base negative test (as previously written, it > forms what is now valid QAPI; tweak it to now provide coverage > of a new error message path), and add a positive test in > qapi-schema-test to use an anonymous base (making the integer > argument optional, for even more coverage). > > Note that this patch only allows anonymous bases for flat unions; > simple unions are already enough syntactic sugar that we do not > want to burden them further. Meanwhile, while it would be easy > to also allow an anonymous base for structs, that would be quite > redundant, as the members can be put right into the struct > instead. > > Signed-off-by: Eric Blake Patch looks good.