summaryrefslogtreecommitdiff
path: root/scripts/qapi-commands.py
diff options
context:
space:
mode:
authorAmos Kong <akong@redhat.com>2014-06-10 19:25:52 +0800
committerLuiz Capitulino <lcapitulino@redhat.com>2014-06-23 11:01:24 -0400
commit0d14eeb23325b6b1f0f9adce8baf7d1b415cba81 (patch)
treedb23b14f933bea5acae35ff75018a5790b0a96f7 /scripts/qapi-commands.py
parent638ca8ad983e22202091e3d486e7101f7da804c5 (diff)
downloadqemu-0d14eeb23325b6b1f0f9adce8baf7d1b415cba81.tar.gz
qemu-0d14eeb23325b6b1f0f9adce8baf7d1b415cba81.tar.bz2
qemu-0d14eeb23325b6b1f0f9adce8baf7d1b415cba81.zip
qapi: add const prefix to 'char *' insider c_type()
It's ugly to add const prefix for parameter type by an if statement outside c_type(). This patch adds a parameter to do it. Signed-off-by: Amos Kong <akong@redhat.com> Suggested-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'scripts/qapi-commands.py')
-rw-r--r--scripts/qapi-commands.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/scripts/qapi-commands.py b/scripts/qapi-commands.py
index 7d93d01ed2..34f200a11c 100644
--- a/scripts/qapi-commands.py
+++ b/scripts/qapi-commands.py
@@ -29,9 +29,7 @@ def type_visitor(name):
def generate_command_decl(name, args, ret_type):
arglist=""
for argname, argtype, optional, structured in parse_args(args):
- argtype = c_type(argtype)
- if argtype == "char *":
- argtype = "const char *"
+ argtype = c_type(argtype, is_param=True)
if optional:
arglist += "bool has_%s, " % c_var(argname)
arglist += "%s %s, " % (argtype, c_var(argname))