From: Eric Blake <eblake@redhat.com>
To: qemu-devel@nongnu.org
Cc: armbru@redhat.com, Michael Roth <mdroth@linux.vnet.ibm.com>,
Eduardo Habkost <ehabkost@redhat.com>,
Cleber Rosa <crosa@redhat.com>
Subject: [Qemu-devel] [PATCH 2/2] qapi: Drop qapi-gen --unmask option
Date: Fri, 29 Jun 2018 14:55:44 -0500 [thread overview]
Message-ID: <20180629195544.34263-3-eblake@redhat.com> (raw)
In-Reply-To: <20180629195544.34263-1-eblake@redhat.com>
Now that we have useful access to the type name as a comment
in the generated qapi-introspect.c, we don't need to regenerate
code with a temporary -u option just to get at type names.
Signed-off-by: Eric Blake <eblake@redhat.com>
---
scripts/qapi-gen.py | 5 +----
scripts/qapi/introspect.py | 12 ++++--------
2 files changed, 5 insertions(+), 12 deletions(-)
diff --git a/scripts/qapi-gen.py b/scripts/qapi-gen.py
index 3d98ca2e0c6..6ec7e481b1b 100755
--- a/scripts/qapi-gen.py
+++ b/scripts/qapi-gen.py
@@ -26,9 +26,6 @@ def main(argv):
help="write output to directory OUTPUT_DIR")
parser.add_argument('-p', '--prefix', action='store', default='',
help="prefix for symbols")
- parser.add_argument('-u', '--unmask-non-abi-names', action='store_true',
- dest='unmask',
- help="expose non-ABI names in introspection")
parser.add_argument('schema', action='store')
args = parser.parse_args()
@@ -49,7 +46,7 @@ def main(argv):
gen_visit(schema, args.output_dir, args.prefix, args.builtins)
gen_commands(schema, args.output_dir, args.prefix)
gen_events(schema, args.output_dir, args.prefix)
- gen_introspect(schema, args.output_dir, args.prefix, args.unmask)
+ gen_introspect(schema, args.output_dir, args.prefix)
gen_doc(schema, args.output_dir, args.prefix)
diff --git a/scripts/qapi/introspect.py b/scripts/qapi/introspect.py
index b37160292bc..8dd4136c0af 100644
--- a/scripts/qapi/introspect.py
+++ b/scripts/qapi/introspect.py
@@ -58,11 +58,10 @@ def to_c_string(string):
class QAPISchemaGenIntrospectVisitor(QAPISchemaMonolithicCVisitor):
- def __init__(self, prefix, unmask):
+ def __init__(self, prefix):
QAPISchemaMonolithicCVisitor.__init__(
self, prefix, 'qapi-introspect',
' * QAPI/QMP schema introspection', __doc__)
- self._unmask = unmask
self._schema = None
self._qlits = []
self._used_types = []
@@ -104,8 +103,6 @@ const QLitObject %(c_name)s = %(c_string)s;
return not isinstance(entity, QAPISchemaType)
def _name(self, name):
- if self._unmask:
- return name
if name not in self._name_map:
self._name_map[name] = '%d' % len(self._name_map)
return self._name_map[name]
@@ -131,8 +128,7 @@ const QLitObject %(c_name)s = %(c_string)s;
def _gen_qlit(self, name, mtype, obj):
if mtype not in ('command', 'event', 'builtin', 'array'):
- if not self._unmask:
- obj['comment'] = name
+ obj['comment'] = name
name = self._name(name)
obj['name'] = name
obj['meta-type'] = mtype
@@ -188,7 +184,7 @@ const QLitObject %(c_name)s = %(c_string)s;
self._gen_qlit(name, 'event', {'arg-type': self._use_type(arg_type)})
-def gen_introspect(schema, output_dir, prefix, opt_unmask):
- vis = QAPISchemaGenIntrospectVisitor(prefix, opt_unmask)
+def gen_introspect(schema, output_dir, prefix):
+ vis = QAPISchemaGenIntrospectVisitor(prefix)
schema.visit(vis)
vis.write(output_dir)
--
2.14.4
next prev parent reply other threads:[~2018-06-29 19:55 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-29 19:55 [Qemu-devel] [PATCH 0/2] qapi: easier debugging of introspection file Eric Blake
2018-06-29 19:55 ` [Qemu-devel] [PATCH 1/2] qapi: Add comments to aid debugging generated introspection Eric Blake
2018-06-29 20:09 ` Eric Blake
2018-07-02 18:43 ` Markus Armbruster
2018-07-02 19:59 ` Eric Blake
2018-07-03 5:38 ` Markus Armbruster
2018-06-29 20:53 ` Eric Blake
2018-06-29 19:55 ` Eric Blake [this message]
2018-06-29 20:18 ` [Qemu-devel] [PATCH 2/2] qapi: Drop qapi-gen --unmask option Eduardo Habkost
2018-07-02 18:48 ` Markus Armbruster
2018-07-02 19:55 ` Eric Blake
2018-07-03 5:51 ` Markus Armbruster
2018-07-03 12:44 ` Eric Blake
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180629195544.34263-3-eblake@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=crosa@redhat.com \
--cc=ehabkost@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).