From patchwork Wed Aug 1 00:01:35 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony Liguori X-Patchwork-Id: 174359 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 3455F2C0080 for ; Wed, 1 Aug 2012 10:01:50 +1000 (EST) Received: from localhost ([::1]:38501 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwMNn-0000Z4-JL for incoming@patchwork.ozlabs.org; Tue, 31 Jul 2012 20:01:47 -0400 Received: from eggs.gnu.org ([208.118.235.92]:56008) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwMNh-0000Yz-4t for qemu-devel@nongnu.org; Tue, 31 Jul 2012 20:01:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SwMNe-0000lx-Jo for qemu-devel@nongnu.org; Tue, 31 Jul 2012 20:01:41 -0400 Received: from mail-ob0-f173.google.com ([209.85.214.173]:36600) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwMNe-0000ln-Eh for qemu-devel@nongnu.org; Tue, 31 Jul 2012 20:01:38 -0400 Received: by obbta14 with SMTP id ta14so10710587obb.4 for ; Tue, 31 Jul 2012 17:01:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-type:x-gm-message-state; bh=7Pr/YZauYNFKp/hMYrmABq0mTCNMzswSSyiWabW1WVM=; b=a1OucP/Fz+fjEGl7hBpqb+mCWenIMeNYCdZE9GycrufDtbC4SSJ82+94IJvmWnQ470 pT/2c4CDdWdWVQTSB3rNNas983N/DNHv/NTGEYfjAnI5yiQBUY1+tk3AtY64Ba0SynOX yidhKF66ZMXrhWm1NEQjVkwHmhDC9nfznGpRN6sN8tOrqYcHH4R/4e9tcJ7V5OPvVy1X tAhB8by4CoraEUnCe4H4RLcCsgPReaNOTRHAW45WLzyxRZnnU8L9PzBdxQvWGT00LkiL FLjoyJ/cMM5Umhqgbua9NKaM/w0Ri/sMuMWpuBLqkTsXT5vGM+TSgqDG8EbYFzEzRqov G2NA== Received: by 10.182.98.108 with SMTP id eh12mr26149886obb.6.1343779297452; Tue, 31 Jul 2012 17:01:37 -0700 (PDT) Received: from titi.smtp.gmail.com (cpe-70-123-145-39.austin.res.rr.com. [70.123.145.39]) by mx.google.com with ESMTPS id th3sm1304310obb.6.2012.07.31.17.01.36 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 31 Jul 2012 17:01:36 -0700 (PDT) From: Anthony Liguori To: Paolo Bonzini , blauwirbel@gmail.com In-Reply-To: <5017892B.2070609@redhat.com> References: <5017892B.2070609@redhat.com> User-Agent: Notmuch/0.13.2+93~ged93d79 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu) Date: Tue, 31 Jul 2012 19:01:35 -0500 Message-ID: <87r4rr5vkw.fsf@codemonkey.ws> MIME-Version: 1.0 X-Gm-Message-State: ALoCoQn2Q+TNsXZS9fYybtiZwUmYVohwy2I1ls7a8ufO5L0MZ3w15unTi2plfvkzLca9rVIMssr6 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.214.173 Cc: Luiz Capitulino , Michael Roth , qemu-devel@nongnu.org Subject: Re: [Qemu-devel] [PATCH 3/5] qapi: avoid reserved word restrict X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Paolo Bonzini writes: > Il 30/07/2012 18:04, blauwirbel@gmail.com ha scritto: >> From: Blue Swirl >> >> Clang compiler complained about use of reserved word 'restrict' in SLIRP >> and QAPI. >> >> Rename 'restrict' to 'restricted' which also matches other SLIRP code. > > Can't do it, this changes the command-line option. > > Luiz, Michael, any ideas? Just change c_var() in scripts/qapi.py to have: Then fixup and build failures (make sure to do a clean first--dependencies seem to be off for qapi). Regards, Anthony Liguori > > Paolo > >> Signed-off-by: Blue Swirl >> --- >> net/slirp.c | 6 +++--- >> qapi-schema.json | 4 ++-- >> 2 files changed, 5 insertions(+), 5 deletions(-) >> >> diff --git a/net/slirp.c b/net/slirp.c >> index 5c2e6b2..8c42b53 100644 >> --- a/net/slirp.c >> +++ b/net/slirp.c >> @@ -722,9 +722,9 @@ int net_init_slirp(const NetClientOptions *opts, const char *name, >> net_init_slirp_configs(user->hostfwd, SLIRP_CFG_HOSTFWD); >> net_init_slirp_configs(user->guestfwd, 0); >> >> - ret = net_slirp_init(vlan, "user", name, user->restrict, vnet, user->host, >> - user->hostname, user->tftp, user->bootfile, >> - user->dhcpstart, user->dns, user->smb, >> + ret = net_slirp_init(vlan, "user", name, user->restricted, vnet, >> + user->host, user->hostname, user->tftp, >> + user->bootfile, user->dhcpstart, user->dns, user->smb, >> user->smbserver); >> >> while (slirp_configs) { >> diff --git a/qapi-schema.json b/qapi-schema.json >> index bc55ed2..3912430 100644 >> --- a/qapi-schema.json >> +++ b/qapi-schema.json >> @@ -1925,7 +1925,7 @@ >> # >> # @hostname: #optional client hostname reported by the builtin DHCP server >> # >> -# @restrict: #optional isolate the guest from the host >> +# @restricted: #optional isolate the guest from the host >> # >> # @ip: #optional legacy parameter, use net= instead >> # >> @@ -1956,7 +1956,7 @@ >> { 'type': 'NetdevUserOptions', >> 'data': { >> '*hostname': 'str', >> - '*restrict': 'bool', >> + '*restricted':'bool', >> '*ip': 'str', >> '*net': 'str', >> '*host': 'str', >> diff --git a/scripts/qapi.py b/scripts/qapi.py index 8082af3..34bfbf6 100644 --- a/scripts/qapi.py +++ b/scripts/qapi.py @@ -131,6 +131,8 @@ def camel_case(name): return new_name def c_var(name): + if name in ['restrict']: + return 'q_restrict' return name.replace('-', '_').lstrip("*") def c_fun(name):