From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58112) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbkmK-0007cL-5l for qemu-devel@nongnu.org; Thu, 31 Oct 2013 01:26:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vbkm7-00042i-NI for qemu-devel@nongnu.org; Thu, 31 Oct 2013 01:26:44 -0400 Received: from e28smtp05.in.ibm.com ([122.248.162.5]:48139) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vbkm7-00040a-1p for qemu-devel@nongnu.org; Thu, 31 Oct 2013 01:26:31 -0400 Received: from /spool/local by e28smtp05.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 31 Oct 2013 10:56:17 +0530 Received: from d28relay05.in.ibm.com (d28relay05.in.ibm.com [9.184.220.62]) by d28dlp03.in.ibm.com (Postfix) with ESMTP id D2928125805A for ; Thu, 31 Oct 2013 10:56:53 +0530 (IST) Received: from d28av02.in.ibm.com (d28av02.in.ibm.com [9.184.220.64]) by d28relay05.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r9V5QBCr35651754 for ; Thu, 31 Oct 2013 10:56:12 +0530 Received: from d28av02.in.ibm.com (localhost [127.0.0.1]) by d28av02.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id r9V5QDNG031514 for ; Thu, 31 Oct 2013 10:56:13 +0530 Message-ID: <5271E9F6.8060803@linux.vnet.ibm.com> Date: Thu, 31 Oct 2013 13:26:14 +0800 From: Wenchao Xia MIME-Version: 1.0 References: <1382321765-29052-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1382321765-29052-4-git-send-email-xiawenc@linux.vnet.ibm.com> <5265917D.3000903@redhat.com> <20131029181845.GA25726@dhcp-200-207.str.redhat.com> <5270B4DC.9040608@linux.vnet.ibm.com> <5270F3A2.8010105@redhat.com> In-Reply-To: <5270F3A2.8010105@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH 3/6] qapi: rename prefix QEVENT to Q_EVENT List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Kevin Wolf , lcapitulino@redhat.com, armbru@redhat.com, stefanha@redhat.com, qemu-devel@nongnu.org 于 2013/10/30 19:55, Paolo Bonzini 写道: > Il 30/10/2013 08:27, Wenchao Xia ha scritto: >> 于 2013/10/30 2:18, Kevin Wolf 写道: >>> Am 21.10.2013 um 22:41 hat Eric Blake geschrieben: >>>> On 10/21/2013 03:16 AM, Wenchao Xia wrote: >>>>> The define will be moved to qapi-schema.json later, so rename the >>>>> prefix to match its naming style. >>>> Wouldn't it be simpler to fix the code generator to special case QEvent >>>> to turn into QEVENT, instead of having to go through this churn? But if >>>> we _like_ the Q_EVENT_ prefix, then this looks fairly mechanical: >>> Or rather, instead of special casing QEvent, it shouldn't insert >>> underscores if there is nothing between the two capital letters. > > ... but it should still insert one before the very last capital letter. > For example AIOType should become AIO_TYPE, not AIOTYPE. > >>> I've had a similar case with AIO in the blockdev-add series; and while >>> renaming it to Aio worked, this kind of thing doesn't seem to be a rare >>> exception in practice, so it might be worth adjusting the generator. >> >> It seems the right way, will adjust the generator. > > I think even if you adjusted it, it would be a no-op in this case. For > example: > > AIOType => AIO_TYPE > QEvent => Q_EVENT > > Paolo > Maybe check whether there is more than two continous capitalized char?