From 776574d6417cf623fb071987cdd2c6bc13271dc2 Mon Sep 17 00:00:00 2001 From: Anthony Liguori Date: Fri, 2 Sep 2011 12:34:46 -0500 Subject: qapi: add code generation support for middle mode To get the ball rolling merging QAPI, this patch introduces a "middle mode" to the code generator. In middle mode, the code generator generates marshalling functions that are compatible with the current QMP server. We absolutely need to replace the current QMP server in order to support proper asynchronous commands but using a middle mode provides a middle-ground that lets us start converting commands in tree. Note that all of the commands have been converted already in my glib branch. Middle mode only exists until we finish merging them from my branch into the main tree. Signed-off-by: Anthony Liguori Signed-off-by: Luiz Capitulino --- scripts/qapi.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'scripts/qapi.py') diff --git a/scripts/qapi.py b/scripts/qapi.py index 56af232..5299976 100644 --- a/scripts/qapi.py +++ b/scripts/qapi.py @@ -200,4 +200,6 @@ def basename(filename): return filename.split("/")[-1] def guardname(filename): - return filename.replace("/", "_").replace("-", "_").split(".")[0].upper() + if filename.startswith('./'): + filename = filename[2:] + return filename.replace("/", "_").replace("-", "_").split(".")[0].upper() + '_H' -- cgit v1.1