On Tue, Jul 31, 2012 at 12:58 PM, Luiz Capitulino <lcapitul...@redhat.com> wrote: > On Tue, 31 Jul 2012 09:28:43 +0200 > Paolo Bonzini <pbonz...@redhat.com> wrote: > >> Il 30/07/2012 18:04, blauwir...@gmail.com ha scritto: >> > From: Blue Swirl <blauwir...@gmail.com> >> > >> > 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? > > I'm not sure how complicated it would be to implement this, but we could add > a 'bind' keyword to the type dict to control mapping between protocol names > and generated variable names. Like this: > > { 'type': 'NetdevUserOptions', > 'data': { > '*hostname': 'str', > '*restrict': 'bool', > ... > '*hostfwd': ['String'], > '*guestfwd': ['String'] }, > > 'bind': { 'restrict': 'restricted' } }
How about prefixing all json-generated field names with for example 'json_'? Should be a simple mechanical change. In addition to 'restrict', there may also be problems with 'if' (-drive, HMP drive_add) and maybe also 'auto' as value (several command line options, HMP pci_add) in the future.