Received: from eggs.gnu.org ([2001:4830:134:3::10]:39274) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1adN5e-0001ZW-Nr for qemu-devel@nongnu.org; Tue, 08 Mar 2016 14:14:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1adN5b-0007Fe-E1 for qemu-devel@nongnu.org; Tue, 08 Mar 2016 14:14:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57291) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1adN5b-0007FW-8F for qemu-devel@nongnu.org; Tue, 08 Mar 2016 14:14:39 -0500 From: Markus Armbruster References: <1457194595-16189-1-git-send-email-eblake@redhat.com> <1457194595-16189-11-git-send-email-eblake@redhat.com> <87lh5s6hpz.fsf@blackfin.pond.sub.org> <56DF04D9.4040403@redhat.com> Date: Tue, 08 Mar 2016 20:14:35 +0100 In-Reply-To: <56DF04D9.4040403@redhat.com> (Eric Blake's message of "Tue, 8 Mar 2016 09:59:05 -0700") Message-ID: <871t7k3hpg.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v4 10/10] qapi: Populate info['name'] for each entity 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 03/08/2016 09:46 AM, Markus Armbruster wrote: >> Eric Blake writes: >> >>> Every non-implicit entity is associated with an 'info' >>> dictionary, but it is not easy to reverse-engineer the name of >>> the top-most entity associated with that 'info'. Our use of >>> 'case_whitelist' (added in commit 893e1f2) is thus currently >>> tied to the owner of a member instead; but as the previous patch >>> showed with CpuInfo, this requires whitelist exceptions to know >>> how an implicit name will be generated. >> >> Why is that a problem? > > Not necessarily a bad problem, but a bit annoying. If a developer > modifies a .json file and adds an improper name, then they will get an > error message that tells them that they need to fix their naming > conventions (hmm, the error message doesn't even point them to the > whitelist - see args-member-case.err). I'd consider that a feature :) I don't want anyone adding to that white list. > If the developer figures out > that the whitelist will let them avoid the error, they still have to > figure _what_ name to add to the whitelist, and without this patch, they > have to determine the generated name for the implicit struct Still feature... > (which may > not be constant, since we are discussing about alternative names earlier > in the series other than something that flattens to a public 'struct > _obj_...' in violation of file-local naming scope). Whoever messes with the generated names gets to update the whitelist. > The goal is thus to > make the whitelist tied only to names mentioned in the .json file, > rather than dragging generated implicit names into the mix. > > But it is cosmetic; we could live without the patch and stick to > generated names in the whitelist, just as easily. Let's drop this patch. If we find a truly compelling use for info['name'] later, we can revisit it if you like, because then it's almost free. [...]