From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:54460) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8CDJ-0000kQ-Ka for qemu-devel@nongnu.org; Thu, 15 Mar 2012 11:04:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S8CDD-0001b6-De for qemu-devel@nongnu.org; Thu, 15 Mar 2012 11:03:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:15656) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8CDD-0001af-1r for qemu-devel@nongnu.org; Thu, 15 Mar 2012 11:03:31 -0400 Date: Thu, 15 Mar 2012 12:03:30 -0300 From: Luiz Capitulino Message-ID: <20120315120330.5d368f24@doriath.home> In-Reply-To: <20120315145110.GI2894@illuin> References: <1331819618-12481-1-git-send-email-fsimonce@redhat.com> <20120315145110.GI2894@illuin> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] qapi: escaping the dots in c_var List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Roth Cc: pbonzini@redhat.com, Federico Simoncelli , qemu-devel@nongnu.org On Thu, 15 Mar 2012 09:51:10 -0500 Michael Roth wrote: > On Thu, Mar 15, 2012 at 01:53:38PM +0000, Federico Simoncelli wrote: > > This allows qapi commands and types with dots. > > > > Signed-off-by: Federico Simoncelli > > --- > > scripts/qapi.py | 2 +- > > 1 files changed, 1 insertions(+), 1 deletions(-) > > > > diff --git a/scripts/qapi.py b/scripts/qapi.py > > index 6e05469..4090c55 100644 > > --- a/scripts/qapi.py > > +++ b/scripts/qapi.py > > @@ -131,7 +131,7 @@ def camel_case(name): > > return new_name > > > > def c_var(name): > > - return '_'.join(name.split('-')).lstrip("*") > > + return name.replace('-', '_').replace('.', '_').lstrip('*') > > What are you looking to use this for? The general rule so far has been to > always use "-" as the word delimiter. Downstream extensions of QMP (commands, events, etc) are fully qualified domain names, and hence contain dots.