[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 18/36] qapi: remove "middle" mode
From: |
marcandre . lureau |
Subject: |
[Qemu-devel] [PATCH 18/36] qapi: remove "middle" mode |
Date: |
Fri, 25 Sep 2015 16:03:46 +0200 |
From: Marc-André Lureau <address@hidden>
Now that the register function is always generated, we can
remove the so-called "middle" mode to the generator script.
Signed-off-by: Marc-André Lureau <address@hidden>
---
scripts/qapi-commands.py | 29 +++++------------------------
1 file changed, 5 insertions(+), 24 deletions(-)
diff --git a/scripts/qapi-commands.py b/scripts/qapi-commands.py
index 9d2708f..4db1ae3 100644
--- a/scripts/qapi-commands.py
+++ b/scripts/qapi-commands.py
@@ -179,17 +179,8 @@ out:
def gen_marshal_proto(name):
- ret = 'void qmp_marshal_%s(QDict *args, QObject **ret, Error **errp)' %
c_name(name)
- if not middle_mode:
- ret = 'static ' + ret
- return ret
-
-
-def gen_marshal_decl(name):
- return mcgen('''
-%(proto)s;
-''',
- proto=gen_marshal_proto(name))
+ return 'static void qmp_marshal_%s' % c_name(name) + \
+ '(QDict *args, QObject **ret, Error **errp)'
def gen_marshal(name, arg_type, box, ret_type):
@@ -263,8 +254,7 @@ class QAPISchemaGenCommandVisitor(QAPISchemaVisitor):
self._visited_ret_types = set()
def visit_end(self):
- if not middle_mode:
- self.defn += gen_registry(self._regy)
+ self.defn += gen_registry(self._regy)
self._regy = None
self._visited_ret_types = None
@@ -276,21 +266,12 @@ class QAPISchemaGenCommandVisitor(QAPISchemaVisitor):
if ret_type and ret_type not in self._visited_ret_types:
self._visited_ret_types.add(ret_type)
self.defn += gen_marshal_output(ret_type)
- if middle_mode:
- self.decl += gen_marshal_decl(name)
self.defn += gen_marshal(name, arg_type, box, ret_type)
- if not middle_mode:
- self._regy += gen_register_command(name, success_response)
-
+ self._regy += gen_register_command(name, success_response)
-middle_mode = False
(input_file, output_dir, do_c, do_h, prefix, opts) = \
- parse_command_line("m", ["middle"])
-
-for o, a in opts:
- if o in ("-m", "--middle"):
- middle_mode = True
+ parse_command_line()
c_comment = '''
/*
--
2.4.3
- Re: [Qemu-devel] [PATCH 08/36] qapi: add qapi2texi script, (continued)
- [Qemu-devel] [PATCH 11/36] build-sys: generate QAPI doc based on json, marcandre . lureau, 2015/09/25
- [Qemu-devel] [PATCH 12/36] build-sys: generate qmp-commands.txt, marcandre . lureau, 2015/09/25
- [Qemu-devel] [PATCH 09/36] qapi: remove qmp-events.txt, marcandre . lureau, 2015/09/25
- [Qemu-devel] [PATCH 14/36] monitor: remove usage of generated marshal functions, marcandre . lureau, 2015/09/25
- [Qemu-devel] [PATCH 13/36] build-sys: do not generate qmp-commands-old.h, marcandre . lureau, 2015/09/25
- [Qemu-devel] [PATCH 15/36] monitor: register gen:false commands manually, marcandre . lureau, 2015/09/25
- [Qemu-devel] [PATCH 18/36] qapi: remove "middle" mode,
marcandre . lureau <=
- [Qemu-devel] [PATCH 16/36] qmp: register qapi commands (no middle mode), marcandre . lureau, 2015/09/25
- [Qemu-devel] [PATCH 21/36] misc: spelling, marcandre . lureau, 2015/09/25
- [Qemu-devel] [PATCH 19/36] qmp: implement qmp_query_commands without qmp_cmds, marcandre . lureau, 2015/09/25
- [Qemu-devel] [PATCH 05/36] qapi: move examples to json schema, marcandre . lureau, 2015/09/25
- [Qemu-devel] [PATCH 17/36] qmp: use qmp_dispatch(), marcandre . lureau, 2015/09/25