summary refs log tree commit diff stats
path: root/scripts/qapi-event.py
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2015-09-04 15:53:48 +0100
committerPeter Maydell <peter.maydell@linaro.org>2015-09-04 15:53:48 +0100
commitb5bff7518d8e4feda95f5c523cb24f72863c1df6 (patch)
tree28406ac68a1d1b57eb2e664432e8a3186db8bc87 /scripts/qapi-event.py
parentb041066421e8dcc7d080dfcfd83551c9c9f24ade (diff)
parentc4f498fe8532cdacc609262b104322911108df54 (diff)
downloadfocaccia-qemu-b5bff7518d8e4feda95f5c523cb24f72863c1df6.tar.gz
focaccia-qemu-b5bff7518d8e4feda95f5c523cb24f72863c1df6.zip
Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2015-09-04' into staging
qapi: Another round of fixes and cleanups

# gpg: Signature made Fri 04 Sep 2015 14:48:54 BST using RSA key ID EB918653
# gpg: Good signature from "Markus Armbruster <armbru@redhat.com>"
# gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>"

* remotes/armbru/tags/pull-qapi-2015-09-04: (33 commits)
  qapi: Generators crash when --output-dir isn't given, fix
  docs/qapi-code-gen.txt: Fix QAPI schema examples
  qapi: Simplify error reporting for array types
  qapi: Fix errors for non-string, non-dictionary members
  tests/qapi-schema: Cover non-string, non-dictionary members
  tests/qapi-schema: Cover two more syntax errors
  qapi: Drop one of two "simple union must not have base" checks
  qapi: Generated code cleanup
  qapi-commands: Drop useless initialization
  qapi-commands: Don't feed output of mcgen() to mcgen() again
  qapi-commands: Inline gen_marshal_output_call()
  qapi-commands: Fix gen_err_check(e) for e and e != 'local_err'
  qapi: Command returning anonymous type doesn't work, outlaw
  qapi: Fix to reject union command and event arguments
  qapi-tests: New tests for union, alternate command arguments
  tests/qapi-schema: Rename tests from data- to args-
  tests/qapi-schema: Restore test case for flat union base bug
  qapi: Document flaws in checking of names
  qapi: Document shortcoming with union 'data' branch
  qapi: Document that input visitor semantics are prone to leaks
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'scripts/qapi-event.py')
-rw-r--r--scripts/qapi-event.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/scripts/qapi-event.py b/scripts/qapi-event.py
index 56bc602a6d..7f238df5b2 100644
--- a/scripts/qapi-event.py
+++ b/scripts/qapi-event.py
@@ -167,8 +167,7 @@ extern const char *%(event_enum_name)s_lookup[];
                         event_enum_name = event_enum_name)
 
     enum_decl = mcgen('''
-typedef enum %(event_enum_name)s
-{
+typedef enum %(event_enum_name)s {
 ''',
                       event_enum_name = event_enum_name)
 
@@ -199,7 +198,6 @@ const char *%(event_enum_name)s_lookup[] = {
 ''',
                 event_enum_name = event_enum_name)
 
-    i = 0
     for string in event_enum_strings:
         ret += mcgen('''
     "%(string)s",
@@ -267,7 +265,7 @@ fdecl.write(mcgen('''
 
 exprs = parse_schema(input_file)
 
-event_enum_name = prefix.upper().replace('-', '_') + "QAPIEvent"
+event_enum_name = c_name(prefix + "QAPIEvent", protect=False)
 event_enum_values = []
 event_enum_strings = []