summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMarkus Armbruster2015-04-02 14:52:55 +0200
committerMarkus Armbruster2015-05-14 18:41:33 +0200
commit4180978c9205c50acd2d6c385def9b3e81911696 (patch)
treeff6d6da4589fab500ab7f33389467cab6bb1282c /scripts
parentqapi: Drop pointless flush() before close() (diff)
downloadqemu-4180978c9205c50acd2d6c385def9b3e81911696.tar.gz
qemu-4180978c9205c50acd2d6c385def9b3e81911696.tar.xz
qemu-4180978c9205c50acd2d6c385def9b3e81911696.zip
qapi: Inline gen_command_decl_prologue(), gen_command_def_prologue()
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/qapi-commands.py58
1 files changed, 24 insertions, 34 deletions
diff --git a/scripts/qapi-commands.py b/scripts/qapi-commands.py
index c3e420e6c9..1c1d3aa029 100644
--- a/scripts/qapi-commands.py
+++ b/scripts/qapi-commands.py
@@ -309,36 +309,6 @@ qapi_init(qmp_init_marshal);
registry=registry.rstrip())
return ret
-def gen_command_decl_prologue(prefix=""):
- ret = mcgen('''
-#include "%(prefix)sqapi-types.h"
-#include "qapi/qmp/qdict.h"
-#include "qapi/error.h"
-
-''',
- prefix=prefix)
- return ret
-
-def gen_command_def_prologue(prefix="", proxy=False):
- ret = mcgen('''
-#include "qemu-common.h"
-#include "qemu/module.h"
-#include "qapi/qmp/qerror.h"
-#include "qapi/qmp/types.h"
-#include "qapi/qmp/dispatch.h"
-#include "qapi/visitor.h"
-#include "qapi/qmp-output-visitor.h"
-#include "qapi/qmp-input-visitor.h"
-#include "qapi/dealloc-visitor.h"
-#include "%(prefix)sqapi-types.h"
-#include "%(prefix)sqapi-visit.h"
-
-''',
- prefix=prefix)
- if not proxy:
- ret += '#include "%sqmp-commands.h"' % prefix
- return ret + "\n\n"
-
middle_mode = False
(input_file, output_dir, do_c, do_h, prefix, opts) = \
@@ -385,10 +355,30 @@ h_comment = '''
'qmp-marshal.c', 'qmp-commands.h',
c_comment, h_comment)
-ret = gen_command_decl_prologue(prefix=prefix)
-fdecl.write(ret)
-ret = gen_command_def_prologue(prefix=prefix)
-fdef.write(ret)
+fdef.write(mcgen('''
+#include "qemu-common.h"
+#include "qemu/module.h"
+#include "qapi/qmp/qerror.h"
+#include "qapi/qmp/types.h"
+#include "qapi/qmp/dispatch.h"
+#include "qapi/visitor.h"
+#include "qapi/qmp-output-visitor.h"
+#include "qapi/qmp-input-visitor.h"
+#include "qapi/dealloc-visitor.h"
+#include "%(prefix)sqapi-types.h"
+#include "%(prefix)sqapi-visit.h"
+#include "%(prefix)sqmp-commands.h"
+
+''',
+ prefix=prefix))
+
+fdecl.write(mcgen('''
+#include "%(prefix)sqapi-types.h"
+#include "qapi/qmp/qdict.h"
+#include "qapi/error.h"
+
+''',
+ prefix=prefix))
for cmd in commands:
arglist = []