From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44008) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vng9G-0007rl-Q0 for qemu-devel@nongnu.org; Mon, 02 Dec 2013 21:55:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vng97-0003SY-9A for qemu-devel@nongnu.org; Mon, 02 Dec 2013 21:55:42 -0500 Received: from e28smtp02.in.ibm.com ([122.248.162.2]:41954) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vng96-0003SG-CU for qemu-devel@nongnu.org; Mon, 02 Dec 2013 21:55:33 -0500 Received: from /spool/local by e28smtp02.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 3 Dec 2013 08:25:28 +0530 Received: from d28relay05.in.ibm.com (d28relay05.in.ibm.com [9.184.220.62]) by d28dlp01.in.ibm.com (Postfix) with ESMTP id D468CE0056 for ; Tue, 3 Dec 2013 08:27:37 +0530 (IST) Received: from d28av03.in.ibm.com (d28av03.in.ibm.com [9.184.220.65]) by d28relay05.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id rB32tLj24194776 for ; Tue, 3 Dec 2013 08:25:23 +0530 Received: from d28av03.in.ibm.com (localhost [127.0.0.1]) by d28av03.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id rB32tONr023135 for ; Tue, 3 Dec 2013 08:25:24 +0530 Message-ID: <529D481C.3030200@linux.vnet.ibm.com> Date: Tue, 03 Dec 2013 10:55:24 +0800 From: Wenchao Xia MIME-Version: 1.0 References: <1384295108-10913-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1384295108-10913-6-git-send-email-xiawenc@linux.vnet.ibm.com> <529CEACA.9070008@redhat.com> In-Reply-To: <529CEACA.9070008@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH V2 5/8] qapi script: use same function to generate enum string List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , qemu-devel@nongnu.org Cc: mdroth@linux.vnet.ibm.com, kwolf@redhat.com, armbru@redhat.com, lcapitulino@redhat.com 于 2013/12/3 4:17, Eric Blake 写道: > On 11/12/2013 03:25 PM, Wenchao Xia wrote: >> One function one rule, so the enum string generating have same >> behavior for different caller. If multiple caller exist for one >> enum define in schema, it is for sure the generated string is >> identical. >> >> Note before the patch qapi-visit.py used custom function to >> generate the string in union visit, although the patch changes it, >> the final string generated is not changed. The custom function used >> before will met problem when capitalized discriminator value is >> introduced. > > I'm finding this commit message awkward to read and rather wordy. May I > suggest the shorter: > > Prior to this patch, qapi-visit.py used custom code to generate enum > names used for handling a qapi union. Fix it to instead reuse common > code, with identical generated results, and allowing future updates to > generation to only need to touch one place. > That sounds better, thanks for reviewing. I have sent v3 before at: http://lists.nongnu.org/archive/html/qemu-devel/2013-11/msg03980.html There is no change except better intro/doc, will use the new commit message in V4.