summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2012-08-13 16:12:35 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2012-08-13 16:12:35 -0500
commit633decd71119a4293e5e53e6059026c517a8bef0 (patch)
tree438feefe0989cf4561c75b518790984900af7555 /scripts
parentac839ccd8c30fe5706cc43f00e056049d6e55377 (diff)
parent70b7660a4ed0ca3891ee51bda78e10b4c36cd358 (diff)
downloadhqemu-633decd71119a4293e5e53e6059026c517a8bef0.zip
hqemu-633decd71119a4293e5e53e6059026c517a8bef0.tar.gz
Merge remote-tracking branch 'qmp/queue/qmp' into staging
* qmp/queue/qmp: (48 commits) target-ppc: add implementation of query-cpu-definitions (v2) target-i386: add implementation of query-cpu-definitions (v2) qapi: add query-cpu-definitions command (v2) compiler: add macro for GCC weak symbols qapi: add query-machines command qapi: mark QOM commands stable qmp: introduce device-list-properties command qmp: add SUSPEND_DISK event qmp: qmp-events.txt: add missing doc for the SUSPEND event qmp: qmp-events.txt: put events in alphabetical order qmp: emit the WAKEUP event when the guest is put to run qmp: don't emit the RESET event on wakeup from S3 scripts: qapi-commands.py: qmp-commands.h: include qdict.h docs: writing-qmp-commands.txt: update error section error, qerror: drop QDict member qerror: drop qerror_table and qerror_format() error, qerror: pass desc string to error calls error: drop error_get_qobject()/error_set_qobject() qemu-ga: switch to the new error format on the wire qmp: switch to the new error format on the wire ...
Diffstat (limited to 'scripts')
-rw-r--r--scripts/qapi-commands.py1
-rw-r--r--scripts/qapi-types.py17
2 files changed, 15 insertions, 3 deletions
diff --git a/scripts/qapi-commands.py b/scripts/qapi-commands.py
index 9eed40e..3c4678d 100644
--- a/scripts/qapi-commands.py
+++ b/scripts/qapi-commands.py
@@ -342,6 +342,7 @@ def gen_command_decl_prologue(header, guard, prefix=""):
#define %(guard)s
#include "%(prefix)sqapi-types.h"
+#include "qdict.h"
#include "error.h"
''',
diff --git a/scripts/qapi-types.py b/scripts/qapi-types.py
index 4a734f5..cf601ae 100644
--- a/scripts/qapi-types.py
+++ b/scripts/qapi-types.py
@@ -70,7 +70,7 @@ const char *%(name)s_lookup[] = {
ret += mcgen('''
"%(value)s",
''',
- value=value.lower())
+ value=value)
ret += mcgen('''
NULL,
@@ -79,6 +79,16 @@ const char *%(name)s_lookup[] = {
''')
return ret
+def generate_enum_name(name):
+ if name.isupper():
+ return c_fun(name)
+ new_name = ''
+ for c in c_fun(name):
+ if c.isupper():
+ new_name += '_'
+ new_name += c
+ return new_name.lstrip('_').upper()
+
def generate_enum(name, values):
lookup_decl = mcgen('''
extern const char *%(name)s_lookup[];
@@ -100,7 +110,7 @@ typedef enum %(name)s
%(abbrev)s_%(value)s = %(i)d,
''',
abbrev=de_camel_case(name).upper(),
- value=c_fun(value).upper(),
+ value=generate_enum_name(value),
i=i)
i += 1
@@ -253,7 +263,8 @@ fdecl.write(mcgen('''
#ifndef %(guard)s
#define %(guard)s
-#include "qapi/qapi-types-core.h"
+#include "qemu-common.h"
+
''',
guard=guardname(h_file)))
OpenPOWER on IntegriCloud