All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code
@ 2018-02-02 13:03 Markus Armbruster
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 01/21] qapi: Streamline boilerplate comment generation Markus Armbruster
                   ` (28 more replies)
  0 siblings, 29 replies; 87+ messages in thread
From: Markus Armbruster @ 2018-02-02 13:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: marcandre.lureau, eblake, mdroth

Our qapi-schema.json is composed of modules connected by include
directives, but the generated code is monolithic all the same: one
qapi-types.h with all the types, one qapi-visit.h with all the
visitors, and so forth.  These monolithic headers get included all
over the place.  In my "build everyhing" tree, adding a QAPI type
recompiles about 4500 out of 4800 objects.

Nobody would write such monolithic headers by hand.  It stands to
reason that one shouldn't generate them, either.

This series' basic idea is to split up generated headers to mirror the
schema's modular structure: one header per module.  That way, you can
include just what you need.

The series is RFC for a number of reasons:

* The split is implemented only for qapi-types.h.  That one should
  provide the biggest benefits, though.

* There's a bit of code duplication.

* I haven't re-read my patches, yet.

Even in this incomplete state, the compile-time improvements can be
massive.  Before this series, any QAPI schema change recompiles some
4500 out of 4800 objects in my "build everything" tree.  Afterwards,
adding a type to qapi/migration.json recompiles less than 400, adding
a QMP event recompiles less than 200, and a documentation change no
longer recompiles anything.

Related: Marc-André's 'unit' pragma proposal.  That's a different way
to split off parts of the generated code, motivated by the desire to
use poisoned identifiers such as TARGET_I386.  I noted in my review of
v3 that I "can either accept it, or come up with a better solution."
This is my attempt at a better solution.  It's a bit more ambitious,
and thus more useful (I hope).  The pragma has one theoretical
advantage, though: you can modularize the generated output in
different ways than the input.  The patches using don't do that,
however.

Based-on: <20180201111846.21846-1-armbru@redhat.com>
[PATCH v3 00/19] Clean up includes to reduce compile time

Markus Armbruster (21):
  qapi: Streamline boilerplate comment generation
  qapi: Generate up-to-date copyright notice
  qapi: New classes QAPIGenC, QAPIGenH, QAPIGenDoc
  qapi: Reduce use of global variables in generators some
  qapi: Turn generators into modules
  qapi-gen: New common driver for code and doc generators
  qapi: Move parse_command_line() next to its only use
  qapi: Touch generated files only when they change
  qapi: Don't absolutize include file name in error messages
  qapi/common: Eliminate QAPISchema.exprs
  qapi: Lift error reporting from QAPISchema.__init__() to callers
  qapi: Concentrate QAPISchemaParser.exprs updates in .__init__()
  qapi: Record 'include' directives in parse tree
  qapi: Generate in source order
  qapi: Record 'include' directives in intermediate representation
  qapi/types qapi/visit: Make visitors use QAPIGen more
  qapi/types qapi/visit: Generate built-in stuff into separate files
  qapi/common: Fix guardname() for funny filenames
  qapi/types: Generate separate .h, .c for each module
  Include less of qapi-types.h
  qapi: Empty out qapi-schema.json

 Makefile                                           |  131 +-
 Makefile.objs                                      |   20 +-
 crypto/cipherpriv.h                                |    2 +-
 hw/block/block.c                                   |    1 +
 hw/block/hd-geometry.c                             |    1 +
 hw/net/rocker/rocker_fp.c                          |    2 +-
 include/block/block.h                              |    2 +-
 include/block/dirty-bitmap.h                       |    2 +-
 include/chardev/char.h                             |    1 +
 include/crypto/cipher.h                            |    2 +-
 include/crypto/hash.h                              |    2 +-
 include/crypto/hmac.h                              |    2 +-
 include/crypto/secret.h                            |    1 +
 include/crypto/tlscreds.h                          |    1 +
 include/hw/block/block.h                           |    2 +-
 include/hw/block/fdc.h                             |    2 +-
 include/hw/ppc/spapr_drc.h                         |    1 +
 include/hw/qdev-properties.h                       |    2 +
 include/io/dns-resolver.h                          |    1 +
 include/migration/colo.h                           |    2 +-
 include/migration/failover.h                       |    2 +-
 include/migration/global_state.h                   |    1 +
 include/monitor/monitor.h                          |    1 +
 include/net/filter.h                               |    1 +
 include/net/net.h                                  |    2 +-
 include/qapi/error.h                               |    2 +-
 include/qapi/qmp/qobject.h                         |    2 +-
 include/qapi/visitor.h                             |    2 +-
 include/qemu/sockets.h                             |    2 +-
 include/qemu/throttle.h                            |    2 +-
 include/qom/cpu.h                                  |    1 +
 include/qom/object.h                               |    2 +-
 include/sysemu/arch_init.h                         |    2 +-
 include/sysemu/balloon.h                           |    2 +-
 include/sysemu/dump.h                              |    2 +
 include/sysemu/hostmem.h                           |    1 +
 include/sysemu/replay.h                            |    2 +
 include/sysemu/sysemu.h                            |    1 +
 include/sysemu/tpm.h                               |    1 +
 include/sysemu/watchdog.h                          |    2 +-
 include/ui/input.h                                 |    2 +-
 migration/migration.h                              |    1 +
 migration/ram.h                                    |    2 +-
 net/tap_int.h                                      |    2 +-
 qapi-schema.json                                   | 3098 +-------------------
 qapi/misc.json                                     | 3090 +++++++++++++++++++
 qapi/run-state.json                                |   10 +
 replication.h                                      |    1 +
 scripts/qapi-gen.py                                |   95 +
 scripts/qapi/__init__.py                           |    0
 scripts/{qapi-commands.py => qapi/commands.py}     |   98 +-
 scripts/{qapi.py => qapi/common.py}                |  290 +-
 scripts/{qapi2texi.py => qapi/doc.py}              |   28 +-
 scripts/{qapi-event.py => qapi/events.py}          |  101 +-
 scripts/{qapi-introspect.py => qapi/introspect.py} |   87 +-
 scripts/{qapi-types.py => qapi/types.py}           |  218 +-
 scripts/{qapi-visit.py => qapi/visit.py}           |  208 +-
 tests/Makefile.include                             |   56 +-
 tests/qapi-schema/comments.out                     |    3 +-
 tests/qapi-schema/doc-bad-section.out              |    5 +-
 tests/qapi-schema/doc-good.out                     |   33 +-
 tests/qapi-schema/doc-good.texi                    |    3 +-
 tests/qapi-schema/empty.out                        |    2 +-
 tests/qapi-schema/event-case.out                   |    3 +-
 tests/qapi-schema/ident-with-escape.out            |    7 +-
 tests/qapi-schema/include-no-file.err              |    2 +-
 tests/qapi-schema/include-relpath.out              |    7 +-
 tests/qapi-schema/include-repetition.out           |   12 +-
 tests/qapi-schema/include-simple.out               |    5 +-
 tests/qapi-schema/indented-expr.out                |    3 +-
 tests/qapi-schema/qapi-schema-test.out             |  321 +-
 tests/qapi-schema/test-qapi.py                     |   17 +-
 ui/vnc.h                                           |    1 +
 73 files changed, 4040 insertions(+), 3984 deletions(-)
 create mode 100644 qapi/misc.json
 create mode 100755 scripts/qapi-gen.py
 create mode 100644 scripts/qapi/__init__.py
 rename scripts/{qapi-commands.py => qapi/commands.py} (78%)
 rename scripts/{qapi.py => qapi/common.py} (93%)
 rename scripts/{qapi2texi.py => qapi/doc.py} (93%)
 mode change 100755 => 100644
 rename scripts/{qapi-event.py => qapi/events.py} (69%)
 rename scripts/{qapi-introspect.py => qapi/introspect.py} (78%)
 rename scripts/{qapi-types.py => qapi/types.py} (54%)
 rename scripts/{qapi-visit.py => qapi/visit.py} (66%)

-- 
2.13.6

^ permalink raw reply	[flat|nested] 87+ messages in thread

* [Qemu-devel] [PATCH RFC 01/21] qapi: Streamline boilerplate comment generation
  2018-02-02 13:03 [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code Markus Armbruster
@ 2018-02-02 13:03 ` Markus Armbruster
  2018-02-02 15:08   ` Eric Blake
  2018-02-05 13:44   ` Marc-Andre Lureau
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 02/21] qapi: Generate up-to-date copyright notice Markus Armbruster
                   ` (27 subsequent siblings)
  28 siblings, 2 replies; 87+ messages in thread
From: Markus Armbruster @ 2018-02-02 13:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: marcandre.lureau, eblake, mdroth

Every generator has separate boilerplate for .h and .c, and their
differences are boring.  All of them repeat the license note.

Reduce the repetition as follows.  Move common text like the license
note to common open_output(), next to the existintg common text there.
For each generator, replace the two separate descriptions by a single
one.

While there, emit an "automatically generated" note into generated
documentation, too.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 scripts/qapi-commands.py        | 26 +++-----------------------
 scripts/qapi-event.py           | 26 +++-----------------------
 scripts/qapi-introspect.py      | 21 ++-------------------
 scripts/qapi-types.py           | 26 +++-----------------------
 scripts/qapi-visit.py           | 26 +++-----------------------
 scripts/qapi.py                 | 31 ++++++++++++++++++-------------
 scripts/qapi2texi.py            |  3 ++-
 tests/qapi-schema/doc-good.texi |  3 ++-
 8 files changed, 36 insertions(+), 126 deletions(-)

diff --git a/scripts/qapi-commands.py b/scripts/qapi-commands.py
index 26c56c5062..25ac52503a 100644
--- a/scripts/qapi-commands.py
+++ b/scripts/qapi-commands.py
@@ -255,38 +255,18 @@ class QAPISchemaGenCommandVisitor(QAPISchemaVisitor):
 
 (input_file, output_dir, do_c, do_h, prefix, opts) = parse_command_line()
 
-c_comment = '''
-/*
- * schema-defined QMP->QAPI command dispatch
+blurb = '''
+ * Schema-defined QAPI/QMP commands
  *
  * Copyright IBM, Corp. 2011
  *
  * Authors:
  *  Anthony Liguori   <aliguori@us.ibm.com>
- *
- * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
- * See the COPYING.LIB file in the top-level directory.
- *
- */
-'''
-h_comment = '''
-/*
- * schema-defined QAPI function prototypes
- *
- * Copyright IBM, Corp. 2011
- *
- * Authors:
- *  Anthony Liguori   <aliguori@us.ibm.com>
- *
- * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
- * See the COPYING.LIB file in the top-level directory.
- *
- */
 '''
 
 (fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix,
                             'qmp-marshal.c', 'qmp-commands.h',
-                            c_comment, h_comment)
+                            blurb)
 
 fdef.write(mcgen('''
 
diff --git a/scripts/qapi-event.py b/scripts/qapi-event.py
index 9d7134658d..31faedc689 100644
--- a/scripts/qapi-event.py
+++ b/scripts/qapi-event.py
@@ -171,38 +171,18 @@ class QAPISchemaGenEventVisitor(QAPISchemaVisitor):
 
 (input_file, output_dir, do_c, do_h, prefix, dummy) = parse_command_line()
 
-c_comment = '''
-/*
- * schema-defined QAPI event functions
+blurb = '''
+ * Schema-defined QAPI/QMP events
  *
  * Copyright (c) 2014 Wenchao Xia
  *
  * Authors:
  *  Wenchao Xia   <wenchaoqemu@gmail.com>
- *
- * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
- * See the COPYING.LIB file in the top-level directory.
- *
- */
-'''
-h_comment = '''
-/*
- * schema-defined QAPI event functions
- *
- * Copyright (c) 2014 Wenchao Xia
- *
- * Authors:
- *  Wenchao Xia  <wenchaoqemu@gmail.com>
- *
- * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
- * See the COPYING.LIB file in the top-level directory.
- *
- */
 '''
 
 (fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix,
                             'qapi-event.c', 'qapi-event.h',
-                            c_comment, h_comment)
+                            blurb)
 
 fdef.write(mcgen('''
 #include "qemu/osdep.h"
diff --git a/scripts/qapi-introspect.py b/scripts/qapi-introspect.py
index 032bcea491..83da2bdb94 100644
--- a/scripts/qapi-introspect.py
+++ b/scripts/qapi-introspect.py
@@ -176,32 +176,15 @@ for o, a in opts:
     if o in ('-u', '--unmask-non-abi-names'):
         opt_unmask = True
 
-c_comment = '''
-/*
+blurb = '''
  * QAPI/QMP schema introspection
  *
  * Copyright (C) 2015 Red Hat, Inc.
- *
- * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
- * See the COPYING.LIB file in the top-level directory.
- *
- */
-'''
-h_comment = '''
-/*
- * QAPI/QMP schema introspection
- *
- * Copyright (C) 2015 Red Hat, Inc.
- *
- * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
- * See the COPYING.LIB file in the top-level directory.
- *
- */
 '''
 
 (fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix,
                             'qmp-introspect.c', 'qmp-introspect.h',
-                            c_comment, h_comment)
+                            blurb)
 
 fdef.write(mcgen('''
 #include "qemu/osdep.h"
diff --git a/scripts/qapi-types.py b/scripts/qapi-types.py
index 7e3051dbb9..86afc57f92 100644
--- a/scripts/qapi-types.py
+++ b/scripts/qapi-types.py
@@ -250,39 +250,19 @@ for o, a in opts:
     if o in ('-b', '--builtins'):
         do_builtins = True
 
-c_comment = '''
-/*
- * deallocation functions for schema-defined QAPI types
+blurb = '''
+ * Schema-defined QAPI types
  *
  * Copyright IBM, Corp. 2011
  *
  * Authors:
  *  Anthony Liguori   <aliguori@us.ibm.com>
  *  Michael Roth      <mdroth@linux.vnet.ibm.com>
- *
- * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
- * See the COPYING.LIB file in the top-level directory.
- *
- */
-'''
-h_comment = '''
-/*
- * schema-defined QAPI types
- *
- * Copyright IBM, Corp. 2011
- *
- * Authors:
- *  Anthony Liguori   <aliguori@us.ibm.com>
- *
- * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
- * See the COPYING.LIB file in the top-level directory.
- *
- */
 '''
 
 (fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix,
                             'qapi-types.c', 'qapi-types.h',
-                            c_comment, h_comment)
+                            blurb)
 
 fdef.write(mcgen('''
 #include "qemu/osdep.h"
diff --git a/scripts/qapi-visit.py b/scripts/qapi-visit.py
index 7e1cfc13f0..9f7127e548 100644
--- a/scripts/qapi-visit.py
+++ b/scripts/qapi-visit.py
@@ -334,38 +334,18 @@ for o, a in opts:
     if o in ('-b', '--builtins'):
         do_builtins = True
 
-c_comment = '''
-/*
- * schema-defined QAPI visitor functions
+blurb = '''
+ * Schema-defined QAPI visitors
  *
  * Copyright IBM, Corp. 2011
  *
  * Authors:
  *  Anthony Liguori   <aliguori@us.ibm.com>
- *
- * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
- * See the COPYING.LIB file in the top-level directory.
- *
- */
-'''
-h_comment = '''
-/*
- * schema-defined QAPI visitor functions
- *
- * Copyright IBM, Corp. 2011
- *
- * Authors:
- *  Anthony Liguori   <aliguori@us.ibm.com>
- *
- * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
- * See the COPYING.LIB file in the top-level directory.
- *
- */
 '''
 
 (fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix,
                             'qapi-visit.c', 'qapi-visit.h',
-                            c_comment, h_comment)
+                            blurb)
 
 fdef.write(mcgen('''
 #include "qemu/osdep.h"
diff --git a/scripts/qapi.py b/scripts/qapi.py
index 43a54bf40f..2e4b2bc9eb 100644
--- a/scripts/qapi.py
+++ b/scripts/qapi.py
@@ -1975,11 +1975,21 @@ def parse_command_line(extra_options='', extra_long_options=[]):
 #
 
 
-def open_output(output_dir, do_c, do_h, prefix, c_file, h_file,
-                c_comment, h_comment):
+def open_output(output_dir, do_c, do_h, prefix, c_file, h_file, blurb):
     guard = guardname(prefix + h_file)
     c_file = output_dir + prefix + c_file
     h_file = output_dir + prefix + h_file
+    comment = mcgen('''/* AUTOMATICALLY GENERATED, DO NOT MODIFY */
+
+/*
+%(blurb)s
+ *
+ * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
+ * See the COPYING.LIB file in the top-level directory.
+ */
+
+''',
+                    blurb=blurb.strip('\n'))
 
     if output_dir:
         try:
@@ -1998,27 +2008,22 @@ def open_output(output_dir, do_c, do_h, prefix, c_file, h_file,
     fdef = maybe_open(do_c, c_file, 'w')
     fdecl = maybe_open(do_h, h_file, 'w')
 
-    fdef.write(mcgen('''
-/* AUTOMATICALLY GENERATED, DO NOT MODIFY */
-%(comment)s
-''',
-                     comment=c_comment))
-
+    fdef.write(comment)
+    fdecl.write(comment)
     fdecl.write(mcgen('''
-/* AUTOMATICALLY GENERATED, DO NOT MODIFY */
-%(comment)s
 #ifndef %(guard)s
 #define %(guard)s
 
 ''',
-                      comment=h_comment, guard=guard))
+                      guard=guard))
 
     return (fdef, fdecl)
 
 
 def close_output(fdef, fdecl):
-    fdecl.write('''
+    fdecl.write(mcgen('''
+
 #endif
-''')
+'''))
     fdecl.close()
     fdef.close()
diff --git a/scripts/qapi2texi.py b/scripts/qapi2texi.py
index 92e2af2cd6..924b374cd3 100755
--- a/scripts/qapi2texi.py
+++ b/scripts/qapi2texi.py
@@ -282,7 +282,8 @@ def main(argv):
         print >>sys.stderr, ("%s: need pragma 'doc-required' "
                              "to generate documentation" % argv[0])
         sys.exit(1)
-    print texi_schema(schema)
+    print '@c AUTOMATICALLY GENERATED, DO NOT MODIFY\n'
+    print texi_schema(schema),
 
 
 if __name__ == '__main__':
diff --git a/tests/qapi-schema/doc-good.texi b/tests/qapi-schema/doc-good.texi
index 1778312581..0aed2300a5 100644
--- a/tests/qapi-schema/doc-good.texi
+++ b/tests/qapi-schema/doc-good.texi
@@ -1,3 +1,5 @@
+@c AUTOMATICALLY GENERATED, DO NOT MODIFY
+
 @section Section
 
 @subsection Subsection
@@ -231,4 +233,3 @@ If you're bored enough to read this, go see a video of boxed cats
 
 @end deftypefn
 
-
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 87+ messages in thread

* [Qemu-devel] [PATCH RFC 02/21] qapi: Generate up-to-date copyright notice
  2018-02-02 13:03 [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code Markus Armbruster
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 01/21] qapi: Streamline boilerplate comment generation Markus Armbruster
@ 2018-02-02 13:03 ` Markus Armbruster
  2018-02-02 15:47   ` Eric Blake
  2018-02-05 13:44   ` Marc-Andre Lureau
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 03/21] qapi: New classes QAPIGenC, QAPIGenH, QAPIGenDoc Markus Armbruster
                   ` (26 subsequent siblings)
  28 siblings, 2 replies; 87+ messages in thread
From: Markus Armbruster @ 2018-02-02 13:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: marcandre.lureau, eblake, mdroth

Each generator carries a copyright notice for the generator itself,
and another one for the files it generates.  Only the former have been
updated along the way, the latter have not, and are all out of date.

Fix by copying the generator's copyright notice to the generated files
instead.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 scripts/qapi-commands.py   | 34 +++++++++++++++-------------------
 scripts/qapi-event.py      | 32 ++++++++++++++------------------
 scripts/qapi-introspect.py | 25 ++++++++++++-------------
 scripts/qapi-types.py      | 32 ++++++++++++++------------------
 scripts/qapi-visit.py      | 34 +++++++++++++++-------------------
 scripts/qapi.py            |  7 +++++--
 6 files changed, 75 insertions(+), 89 deletions(-)

diff --git a/scripts/qapi-commands.py b/scripts/qapi-commands.py
index 25ac52503a..a861ac52e7 100644
--- a/scripts/qapi-commands.py
+++ b/scripts/qapi-commands.py
@@ -1,16 +1,17 @@
-#
-# QAPI command marshaller generator
-#
-# Copyright IBM, Corp. 2011
-# Copyright (C) 2014-2016 Red Hat, Inc.
-#
-# Authors:
-#  Anthony Liguori <aliguori@us.ibm.com>
-#  Michael Roth    <mdroth@linux.vnet.ibm.com>
-#  Markus Armbruster <armbru@redhat.com>
-#
-# This work is licensed under the terms of the GNU GPL, version 2.
-# See the COPYING file in the top-level directory.
+"""
+QAPI command marshaller generator
+
+Copyright IBM, Corp. 2011
+Copyright (C) 2014-2018 Red Hat, Inc.
+
+Authors:
+ Anthony Liguori <aliguori@us.ibm.com>
+ Michael Roth <mdroth@linux.vnet.ibm.com>
+ Markus Armbruster <armbru@redhat.com>
+
+This work is licensed under the terms of the GNU GPL, version 2.
+See the COPYING file in the top-level directory.
+"""
 
 from qapi import *
 
@@ -257,16 +258,11 @@ class QAPISchemaGenCommandVisitor(QAPISchemaVisitor):
 
 blurb = '''
  * Schema-defined QAPI/QMP commands
- *
- * Copyright IBM, Corp. 2011
- *
- * Authors:
- *  Anthony Liguori   <aliguori@us.ibm.com>
 '''
 
 (fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix,
                             'qmp-marshal.c', 'qmp-commands.h',
-                            blurb)
+                            blurb, __doc__)
 
 fdef.write(mcgen('''
 
diff --git a/scripts/qapi-event.py b/scripts/qapi-event.py
index 31faedc689..b1d611c5ea 100644
--- a/scripts/qapi-event.py
+++ b/scripts/qapi-event.py
@@ -1,15 +1,16 @@
-#
-# QAPI event generator
-#
-# Copyright (c) 2014 Wenchao Xia
-# Copyright (c) 2015-2016 Red Hat Inc.
-#
-# Authors:
-#  Wenchao Xia <wenchaoqemu@gmail.com>
-#  Markus Armbruster <armbru@redhat.com>
-#
-# This work is licensed under the terms of the GNU GPL, version 2.
-# See the COPYING file in the top-level directory.
+"""
+QAPI event generator
+
+Copyright (c) 2014 Wenchao Xia
+Copyright (c) 2015-2018 Red Hat Inc.
+
+Authors:
+ Wenchao Xia <wenchaoqemu@gmail.com>
+ Markus Armbruster <armbru@redhat.com>
+
+This work is licensed under the terms of the GNU GPL, version 2.
+See the COPYING file in the top-level directory.
+"""
 
 from qapi import *
 
@@ -173,16 +174,11 @@ class QAPISchemaGenEventVisitor(QAPISchemaVisitor):
 
 blurb = '''
  * Schema-defined QAPI/QMP events
- *
- * Copyright (c) 2014 Wenchao Xia
- *
- * Authors:
- *  Wenchao Xia   <wenchaoqemu@gmail.com>
 '''
 
 (fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix,
                             'qapi-event.c', 'qapi-event.h',
-                            blurb)
+                            blurb, __doc__)
 
 fdef.write(mcgen('''
 #include "qemu/osdep.h"
diff --git a/scripts/qapi-introspect.py b/scripts/qapi-introspect.py
index 83da2bdb94..bd9253a172 100644
--- a/scripts/qapi-introspect.py
+++ b/scripts/qapi-introspect.py
@@ -1,13 +1,14 @@
-#
-# QAPI introspection generator
-#
-# Copyright (C) 2015-2016 Red Hat, Inc.
-#
-# Authors:
-#  Markus Armbruster <armbru@redhat.com>
-#
-# This work is licensed under the terms of the GNU GPL, version 2.
-# See the COPYING file in the top-level directory.
+"""
+QAPI introspection generator
+
+Copyright (C) 2015-2018 Red Hat, Inc.
+
+Authors:
+ Markus Armbruster <armbru@redhat.com>
+
+This work is licensed under the terms of the GNU GPL, version 2.
+See the COPYING file in the top-level directory.
+"""
 
 from qapi import *
 
@@ -178,13 +179,11 @@ for o, a in opts:
 
 blurb = '''
  * QAPI/QMP schema introspection
- *
- * Copyright (C) 2015 Red Hat, Inc.
 '''
 
 (fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix,
                             'qmp-introspect.c', 'qmp-introspect.h',
-                            blurb)
+                            blurb, __doc__)
 
 fdef.write(mcgen('''
 #include "qemu/osdep.h"
diff --git a/scripts/qapi-types.py b/scripts/qapi-types.py
index 86afc57f92..1103dbda2d 100644
--- a/scripts/qapi-types.py
+++ b/scripts/qapi-types.py
@@ -1,15 +1,17 @@
-#
-# QAPI types generator
-#
-# Copyright IBM, Corp. 2011
-# Copyright (c) 2013-2016 Red Hat Inc.
-#
-# Authors:
-#  Anthony Liguori <aliguori@us.ibm.com>
-#  Markus Armbruster <armbru@redhat.com>
-#
-# This work is licensed under the terms of the GNU GPL, version 2.
+"""
+QAPI types generator
+
+Copyright IBM, Corp. 2011
+Copyright (c) 2013-2018 Red Hat Inc.
+
+Authors:
+ Anthony Liguori <aliguori@us.ibm.com>
+ Michael Roth <mdroth@linux.vnet.ibm.com>
+ Markus Armbruster <armbru@redhat.com>
+
+This work is licensed under the terms of the GNU GPL, version 2.
 # See the COPYING file in the top-level directory.
+"""
 
 from qapi import *
 
@@ -252,17 +254,11 @@ for o, a in opts:
 
 blurb = '''
  * Schema-defined QAPI types
- *
- * Copyright IBM, Corp. 2011
- *
- * Authors:
- *  Anthony Liguori   <aliguori@us.ibm.com>
- *  Michael Roth      <mdroth@linux.vnet.ibm.com>
 '''
 
 (fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix,
                             'qapi-types.c', 'qapi-types.h',
-                            blurb)
+                            blurb, __doc__)
 
 fdef.write(mcgen('''
 #include "qemu/osdep.h"
diff --git a/scripts/qapi-visit.py b/scripts/qapi-visit.py
index 9f7127e548..5231f89c36 100644
--- a/scripts/qapi-visit.py
+++ b/scripts/qapi-visit.py
@@ -1,16 +1,17 @@
-#
-# QAPI visitor generator
-#
-# Copyright IBM, Corp. 2011
-# Copyright (C) 2014-2016 Red Hat, Inc.
-#
-# Authors:
-#  Anthony Liguori <aliguori@us.ibm.com>
-#  Michael Roth    <mdroth@linux.vnet.ibm.com>
-#  Markus Armbruster <armbru@redhat.com>
-#
-# This work is licensed under the terms of the GNU GPL, version 2.
-# See the COPYING file in the top-level directory.
+"""
+QAPI visitor generator
+
+Copyright IBM, Corp. 2011
+Copyright (C) 2014-2018 Red Hat, Inc.
+
+Authors:
+ Anthony Liguori <aliguori@us.ibm.com>
+ Michael Roth    <mdroth@linux.vnet.ibm.com>
+ Markus Armbruster <armbru@redhat.com>
+
+This work is licensed under the terms of the GNU GPL, version 2.
+See the COPYING file in the top-level directory.
+"""
 
 from qapi import *
 
@@ -336,16 +337,11 @@ for o, a in opts:
 
 blurb = '''
  * Schema-defined QAPI visitors
- *
- * Copyright IBM, Corp. 2011
- *
- * Authors:
- *  Anthony Liguori   <aliguori@us.ibm.com>
 '''
 
 (fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix,
                             'qapi-visit.c', 'qapi-visit.h',
-                            blurb)
+                            blurb, __doc__)
 
 fdef.write(mcgen('''
 #include "qemu/osdep.h"
diff --git a/scripts/qapi.py b/scripts/qapi.py
index 2e4b2bc9eb..d0816f7479 100644
--- a/scripts/qapi.py
+++ b/scripts/qapi.py
@@ -1975,21 +1975,24 @@ def parse_command_line(extra_options='', extra_long_options=[]):
 #
 
 
-def open_output(output_dir, do_c, do_h, prefix, c_file, h_file, blurb):
+def open_output(output_dir, do_c, do_h, prefix, c_file, h_file, blurb, doc):
     guard = guardname(prefix + h_file)
     c_file = output_dir + prefix + c_file
     h_file = output_dir + prefix + h_file
+    copyright = '\n * '.join(re.findall(r'^Copyright .*', doc, re.MULTILINE))
     comment = mcgen('''/* AUTOMATICALLY GENERATED, DO NOT MODIFY */
 
 /*
 %(blurb)s
  *
+ * %(copyright)s
+ *
  * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
  * See the COPYING.LIB file in the top-level directory.
  */
 
 ''',
-                    blurb=blurb.strip('\n'))
+                    blurb=blurb.strip('\n'), copyright=copyright)
 
     if output_dir:
         try:
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 87+ messages in thread

* [Qemu-devel] [PATCH RFC 03/21] qapi: New classes QAPIGenC, QAPIGenH, QAPIGenDoc
  2018-02-02 13:03 [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code Markus Armbruster
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 01/21] qapi: Streamline boilerplate comment generation Markus Armbruster
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 02/21] qapi: Generate up-to-date copyright notice Markus Armbruster
@ 2018-02-02 13:03 ` Markus Armbruster
  2018-02-02 15:59   ` Eric Blake
  2018-02-05 13:44   ` Marc-Andre Lureau
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 04/21] qapi: Reduce use of global variables in generators some Markus Armbruster
                   ` (25 subsequent siblings)
  28 siblings, 2 replies; 87+ messages in thread
From: Markus Armbruster @ 2018-02-02 13:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: marcandre.lureau, eblake, mdroth

These classes encapsulate accumulating and writing output.

Convert C code generation to QAPIGenC and QAPIGenH.  The conversion is
rather shallow: most of the output accumulation is not converted.
Left for later.

The indentation machinery uses a single global variable indent_level,
even though we generally interleave creation of a .c and its .h.  It
should become instance variable of QAPIGenC.  Also left for later.

Documentation generation isn't converted, and QAPIGenDoc isn't used.
This will change shortly.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 scripts/qapi-commands.py   | 27 ++++++-------
 scripts/qapi-event.py      | 26 +++++++------
 scripts/qapi-introspect.py | 22 ++++++-----
 scripts/qapi-types.py      | 26 +++++++------
 scripts/qapi-visit.py      | 26 +++++++------
 scripts/qapi.py            | 96 ++++++++++++++++++++++++++--------------------
 6 files changed, 122 insertions(+), 101 deletions(-)

diff --git a/scripts/qapi-commands.py b/scripts/qapi-commands.py
index a861ac52e7..4be7dbc482 100644
--- a/scripts/qapi-commands.py
+++ b/scripts/qapi-commands.py
@@ -260,12 +260,10 @@ blurb = '''
  * Schema-defined QAPI/QMP commands
 '''
 
-(fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix,
-                            'qmp-marshal.c', 'qmp-commands.h',
-                            blurb, __doc__)
-
-fdef.write(mcgen('''
+genc = QAPIGenC(blurb, __doc__)
+genh = QAPIGenH(blurb, __doc__)
 
+genc.body(mcgen('''
 #include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qemu/module.h"
@@ -279,21 +277,24 @@ fdef.write(mcgen('''
 #include "%(prefix)sqmp-commands.h"
 
 ''',
-                 prefix=prefix))
+                prefix=prefix))
 
-fdecl.write(mcgen('''
+genh.body(mcgen('''
 #include "%(prefix)sqapi-types.h"
 #include "qapi/qmp/qdict.h"
 #include "qapi/qmp/dispatch.h"
 
 void %(c_prefix)sqmp_init_marshal(QmpCommandList *cmds);
 ''',
-                  prefix=prefix, c_prefix=c_name(prefix, protect=False)))
+                prefix=prefix, c_prefix=c_name(prefix, protect=False)))
 
 schema = QAPISchema(input_file)
-gen = QAPISchemaGenCommandVisitor()
-schema.visit(gen)
-fdef.write(gen.defn)
-fdecl.write(gen.decl)
+vis = QAPISchemaGenCommandVisitor()
+schema.visit(vis)
+genc.body(vis.defn)
+genh.body(vis.decl)
 
-close_output(fdef, fdecl)
+if do_c:
+    genc.write(output_dir, prefix + 'qmp-marshal.c')
+if do_h:
+    genh.write(output_dir, prefix + 'qmp-commands.h')
diff --git a/scripts/qapi-event.py b/scripts/qapi-event.py
index b1d611c5ea..da3de17c76 100644
--- a/scripts/qapi-event.py
+++ b/scripts/qapi-event.py
@@ -176,11 +176,10 @@ blurb = '''
  * Schema-defined QAPI/QMP events
 '''
 
-(fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix,
-                            'qapi-event.c', 'qapi-event.h',
-                            blurb, __doc__)
+genc = QAPIGenC(blurb, __doc__)
+genh = QAPIGenH(blurb, __doc__)
 
-fdef.write(mcgen('''
+genc.body(mcgen('''
 #include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "%(prefix)sqapi-event.h"
@@ -190,22 +189,25 @@ fdef.write(mcgen('''
 #include "qapi/qmp-event.h"
 
 ''',
-                 prefix=prefix))
+                prefix=prefix))
 
-fdecl.write(mcgen('''
+genh.body(mcgen('''
 #include "qapi/util.h"
 #include "qapi/qmp/qdict.h"
 #include "%(prefix)sqapi-types.h"
 
 ''',
-                  prefix=prefix))
+                prefix=prefix))
 
 event_enum_name = c_name(prefix + 'QAPIEvent', protect=False)
 
 schema = QAPISchema(input_file)
-gen = QAPISchemaGenEventVisitor()
-schema.visit(gen)
-fdef.write(gen.defn)
-fdecl.write(gen.decl)
+vis = QAPISchemaGenEventVisitor()
+schema.visit(vis)
+genc.body(vis.defn)
+genh.body(vis.decl)
 
-close_output(fdef, fdecl)
+if do_c:
+    genc.write(output_dir, prefix + 'qapi-event.c')
+if do_h:
+    genh.write(output_dir, prefix + 'qapi-event.h')
diff --git a/scripts/qapi-introspect.py b/scripts/qapi-introspect.py
index bd9253a172..c654f8fa94 100644
--- a/scripts/qapi-introspect.py
+++ b/scripts/qapi-introspect.py
@@ -181,21 +181,23 @@ blurb = '''
  * QAPI/QMP schema introspection
 '''
 
-(fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix,
-                            'qmp-introspect.c', 'qmp-introspect.h',
-                            blurb, __doc__)
+genc = QAPIGenC(blurb, __doc__)
+genh = QAPIGenH(blurb, __doc__)
 
-fdef.write(mcgen('''
+genc.body(mcgen('''
 #include "qemu/osdep.h"
 #include "%(prefix)sqmp-introspect.h"
 
 ''',
-                 prefix=prefix))
+                prefix=prefix))
 
 schema = QAPISchema(input_file)
-gen = QAPISchemaGenIntrospectVisitor(opt_unmask)
-schema.visit(gen)
-fdef.write(gen.defn)
-fdecl.write(gen.decl)
+vis = QAPISchemaGenIntrospectVisitor(opt_unmask)
+schema.visit(vis)
+genc.body(vis.defn)
+genh.body(vis.decl)
 
-close_output(fdef, fdecl)
+if do_c:
+    genc.write(output_dir, prefix + 'qmp-introspect.c')
+if do_h:
+    genh.write(output_dir, prefix + 'qmp-introspect.h')
diff --git a/scripts/qapi-types.py b/scripts/qapi-types.py
index 1103dbda2d..97406b3368 100644
--- a/scripts/qapi-types.py
+++ b/scripts/qapi-types.py
@@ -180,7 +180,7 @@ class QAPISchemaGenTypeVisitor(QAPISchemaVisitor):
         self.decl = ''
         self.defn = ''
         self._fwdecl = ''
-        self._btin = guardstart('QAPI_TYPES_BUILTIN')
+        self._btin = '\n' + guardstart('QAPI_TYPES_BUILTIN')
 
     def visit_end(self):
         self.decl = self._fwdecl + self.decl
@@ -256,26 +256,28 @@ blurb = '''
  * Schema-defined QAPI types
 '''
 
-(fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix,
-                            'qapi-types.c', 'qapi-types.h',
-                            blurb, __doc__)
+genc = QAPIGenC(blurb, __doc__)
+genh = QAPIGenH(blurb, __doc__)
 
-fdef.write(mcgen('''
+genc.body(mcgen('''
 #include "qemu/osdep.h"
 #include "qapi/dealloc-visitor.h"
 #include "%(prefix)sqapi-types.h"
 #include "%(prefix)sqapi-visit.h"
 ''',
-                 prefix=prefix))
+                prefix=prefix))
 
-fdecl.write(mcgen('''
+genh.body(mcgen('''
 #include "qapi/util.h"
 '''))
 
 schema = QAPISchema(input_file)
-gen = QAPISchemaGenTypeVisitor()
-schema.visit(gen)
-fdef.write(gen.defn)
-fdecl.write(gen.decl)
+vis = QAPISchemaGenTypeVisitor()
+schema.visit(vis)
+genc.body(vis.defn)
+genh.body(vis.decl)
 
-close_output(fdef, fdecl)
+if do_c:
+    genc.write(output_dir, prefix + 'qapi-types.c')
+if do_h:
+    genh.write(output_dir, prefix + 'qapi-types.h')
diff --git a/scripts/qapi-visit.py b/scripts/qapi-visit.py
index 5231f89c36..d1b25daf0d 100644
--- a/scripts/qapi-visit.py
+++ b/scripts/qapi-visit.py
@@ -339,30 +339,32 @@ blurb = '''
  * Schema-defined QAPI visitors
 '''
 
-(fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix,
-                            'qapi-visit.c', 'qapi-visit.h',
-                            blurb, __doc__)
+genc = QAPIGenC(blurb, __doc__)
+genh = QAPIGenH(blurb, __doc__)
 
-fdef.write(mcgen('''
+genc.body(mcgen('''
 #include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qapi/error.h"
 #include "%(prefix)sqapi-visit.h"
 ''',
-                 prefix=prefix))
+                prefix=prefix))
 
-fdecl.write(mcgen('''
+genh.body(mcgen('''
 #include "qapi/visitor.h"
 #include "qapi/qmp/qerror.h"
 #include "%(prefix)sqapi-types.h"
 
 ''',
-                  prefix=prefix))
+                prefix=prefix))
 
 schema = QAPISchema(input_file)
-gen = QAPISchemaGenVisitVisitor()
-schema.visit(gen)
-fdef.write(gen.defn)
-fdecl.write(gen.decl)
+vis = QAPISchemaGenVisitVisitor()
+schema.visit(vis)
+genc.body(vis.defn)
+genh.body(vis.decl)
 
-close_output(fdef, fdecl)
+if do_c:
+    genc.write(output_dir, prefix + 'qapi-visit.c')
+if do_h:
+    genh.write(output_dir, prefix + 'qapi-visit.h')
diff --git a/scripts/qapi.py b/scripts/qapi.py
index d0816f7479..d73ef618e2 100644
--- a/scripts/qapi.py
+++ b/scripts/qapi.py
@@ -2,7 +2,7 @@
 # QAPI helper library
 #
 # Copyright IBM, Corp. 2011
-# Copyright (c) 2013-2016 Red Hat Inc.
+# Copyright (c) 2013-2018 Red Hat Inc.
 #
 # Authors:
 #  Anthony Liguori <aliguori@us.ibm.com>
@@ -1820,7 +1820,6 @@ def guardname(filename):
 
 def guardstart(name):
     return mcgen('''
-
 #ifndef %(name)s
 #define %(name)s
 
@@ -1832,7 +1831,6 @@ def guardend(name):
     return mcgen('''
 
 #endif /* %(name)s */
-
 ''',
                  name=guardname(name))
 
@@ -1970,17 +1968,53 @@ def parse_command_line(extra_options='', extra_long_options=[]):
 
     return (fname, output_dir, do_c, do_h, prefix, extra_opts)
 
+
 #
-# Generate output files with boilerplate
+# Accumulate and write output
 #
 
+class QAPIGen(object):
+
+    def __init__(self):
+        self._preamble = ''
+        self._body = ''
+
+    def preamble(self, text):
+        self._preamble += text
+
+    def body(self, text):
+        self._body += text
+
+    def top(self, fname):
+        return ''
+
+    def bottom(self, fname):
+        return ''
+
+    def write(self, output_dir, fname):
+        if output_dir:
+            try:
+                os.makedirs(output_dir)
+            except os.error as e:
+                if e.errno != errno.EEXIST:
+                    raise
+        f = open(os.path.join(output_dir, fname), 'w')
+        f.write(self.top(fname) + self._preamble + self._body
+                + self.bottom(fname))
+        f.close()
+
+
+class QAPIGenC(QAPIGen):
+
+    def __init__(self, blurb, pydoc):
+        QAPIGen.__init__(self)
+        self._blurb = blurb.strip('\n')
+        self._copyright = '\n * '.join(re.findall(r'^Copyright .*', pydoc,
+                                                  re.MULTILINE))
 
-def open_output(output_dir, do_c, do_h, prefix, c_file, h_file, blurb, doc):
-    guard = guardname(prefix + h_file)
-    c_file = output_dir + prefix + c_file
-    h_file = output_dir + prefix + h_file
-    copyright = '\n * '.join(re.findall(r'^Copyright .*', doc, re.MULTILINE))
-    comment = mcgen('''/* AUTOMATICALLY GENERATED, DO NOT MODIFY */
+    def top(self, fname):
+        return mcgen('''
+/* AUTOMATICALLY GENERATED, DO NOT MODIFY */
 
 /*
 %(blurb)s
@@ -1992,41 +2026,19 @@ def open_output(output_dir, do_c, do_h, prefix, c_file, h_file, blurb, doc):
  */
 
 ''',
-                    blurb=blurb.strip('\n'), copyright=copyright)
+                     blurb=self._blurb, copyright=self._copyright)
 
-    if output_dir:
-        try:
-            os.makedirs(output_dir)
-        except os.error as e:
-            if e.errno != errno.EEXIST:
-                raise
 
-    def maybe_open(really, name, opt):
-        if really:
-            return open(name, opt)
-        else:
-            import StringIO
-            return StringIO.StringIO()
+class QAPIGenH(QAPIGenC):
 
-    fdef = maybe_open(do_c, c_file, 'w')
-    fdecl = maybe_open(do_h, h_file, 'w')
+    def top(self, fname):
+        return QAPIGenC.top(self, fname) + guardstart(fname)
 
-    fdef.write(comment)
-    fdecl.write(comment)
-    fdecl.write(mcgen('''
-#ifndef %(guard)s
-#define %(guard)s
+    def bottom(self, fname):
+        return guardend(fname)
 
-''',
-                      guard=guard))
 
-    return (fdef, fdecl)
-
-
-def close_output(fdef, fdecl):
-    fdecl.write(mcgen('''
-
-#endif
-'''))
-    fdecl.close()
-    fdef.close()
+class QAPIGenDoc(QAPIGen):
+    def top(self, fname):
+        return (QAPIGen.top(self, fname)
+                + '@c AUTOMATICALLY GENERATED, DO NOT MODIFY\n\n')
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 87+ messages in thread

* [Qemu-devel] [PATCH RFC 04/21] qapi: Reduce use of global variables in generators some
  2018-02-02 13:03 [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code Markus Armbruster
                   ` (2 preceding siblings ...)
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 03/21] qapi: New classes QAPIGenC, QAPIGenH, QAPIGenDoc Markus Armbruster
@ 2018-02-02 13:03 ` Markus Armbruster
  2018-02-02 16:03   ` Eric Blake
  2018-02-05 13:44   ` Marc-Andre Lureau
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 05/21] qapi: Turn generators into modules Markus Armbruster
                   ` (24 subsequent siblings)
  28 siblings, 2 replies; 87+ messages in thread
From: Markus Armbruster @ 2018-02-02 13:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: marcandre.lureau, eblake, mdroth

In preparation of the next commit, which will turn the generators into
modules.  These global variables will become local to main() then.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 scripts/qapi-commands.py   |  9 +++++----
 scripts/qapi-event.py      | 15 +++++++--------
 scripts/qapi-introspect.py |  7 ++++---
 scripts/qapi-types.py      | 17 +++++++++--------
 scripts/qapi-visit.py      | 17 +++++++++--------
 5 files changed, 34 insertions(+), 31 deletions(-)

diff --git a/scripts/qapi-commands.py b/scripts/qapi-commands.py
index 4be7dbc482..d229537659 100644
--- a/scripts/qapi-commands.py
+++ b/scripts/qapi-commands.py
@@ -207,7 +207,7 @@ def gen_register_command(name, success_response):
     return ret
 
 
-def gen_registry(registry):
+def gen_registry(registry, prefix):
     ret = mcgen('''
 
 void %(c_prefix)sqmp_init_marshal(QmpCommandList *cmds)
@@ -224,7 +224,8 @@ void %(c_prefix)sqmp_init_marshal(QmpCommandList *cmds)
 
 
 class QAPISchemaGenCommandVisitor(QAPISchemaVisitor):
-    def __init__(self):
+    def __init__(self, prefix):
+        self._prefix = prefix
         self.decl = None
         self.defn = None
         self._regy = None
@@ -237,7 +238,7 @@ class QAPISchemaGenCommandVisitor(QAPISchemaVisitor):
         self._visited_ret_types = set()
 
     def visit_end(self):
-        self.defn += gen_registry(self._regy)
+        self.defn += gen_registry(self._regy, self._prefix)
         self._regy = None
         self._visited_ret_types = None
 
@@ -289,7 +290,7 @@ void %(c_prefix)sqmp_init_marshal(QmpCommandList *cmds);
                 prefix=prefix, c_prefix=c_name(prefix, protect=False)))
 
 schema = QAPISchema(input_file)
-vis = QAPISchemaGenCommandVisitor()
+vis = QAPISchemaGenCommandVisitor(prefix)
 schema.visit(vis)
 genc.body(vis.defn)
 genh.body(vis.decl)
diff --git a/scripts/qapi-event.py b/scripts/qapi-event.py
index da3de17c76..1af21b580a 100644
--- a/scripts/qapi-event.py
+++ b/scripts/qapi-event.py
@@ -58,7 +58,7 @@ def gen_param_var(typ):
     return ret
 
 
-def gen_event_send(name, arg_type, boxed):
+def gen_event_send(name, arg_type, boxed, event_enum_name):
     # FIXME: Our declaration of local variables (and of 'errp' in the
     # parameter list) can collide with exploded members of the event's
     # data type passed in as parameters.  If this collision ever hits in
@@ -149,7 +149,8 @@ out:
 
 
 class QAPISchemaGenEventVisitor(QAPISchemaVisitor):
-    def __init__(self):
+    def __init__(self, prefix):
+        self._enum_name = c_name(prefix + 'QAPIEvent', protect=False)
         self.decl = None
         self.defn = None
         self._event_names = None
@@ -160,13 +161,13 @@ class QAPISchemaGenEventVisitor(QAPISchemaVisitor):
         self._event_names = []
 
     def visit_end(self):
-        self.decl += gen_enum(event_enum_name, self._event_names)
-        self.defn += gen_enum_lookup(event_enum_name, self._event_names)
+        self.decl += gen_enum(self._enum_name, self._event_names)
+        self.defn += gen_enum_lookup(self._enum_name, self._event_names)
         self._event_names = None
 
     def visit_event(self, name, info, arg_type, boxed):
         self.decl += gen_event_send_decl(name, arg_type, boxed)
-        self.defn += gen_event_send(name, arg_type, boxed)
+        self.defn += gen_event_send(name, arg_type, boxed, self._enum_name)
         self._event_names.append(name)
 
 
@@ -199,10 +200,8 @@ genh.body(mcgen('''
 ''',
                 prefix=prefix))
 
-event_enum_name = c_name(prefix + 'QAPIEvent', protect=False)
-
 schema = QAPISchema(input_file)
-vis = QAPISchemaGenEventVisitor()
+vis = QAPISchemaGenEventVisitor(prefix)
 schema.visit(vis)
 genc.body(vis.defn)
 genh.body(vis.decl)
diff --git a/scripts/qapi-introspect.py b/scripts/qapi-introspect.py
index c654f8fa94..8d4e3c1c3a 100644
--- a/scripts/qapi-introspect.py
+++ b/scripts/qapi-introspect.py
@@ -41,7 +41,8 @@ def to_c_string(string):
 
 
 class QAPISchemaGenIntrospectVisitor(QAPISchemaVisitor):
-    def __init__(self, unmask):
+    def __init__(self, prefix, unmask):
+        self._prefix = prefix
         self._unmask = unmask
         self.defn = None
         self.decl = None
@@ -65,7 +66,7 @@ class QAPISchemaGenIntrospectVisitor(QAPISchemaVisitor):
         # generate C
         # TODO can generate awfully long lines
         jsons.extend(self._jsons)
-        name = c_name(prefix, protect=False) + 'qmp_schema_json'
+        name = c_name(self._prefix, protect=False) + 'qmp_schema_json'
         self.decl = mcgen('''
 extern const char %(c_name)s[];
 ''',
@@ -192,7 +193,7 @@ genc.body(mcgen('''
                 prefix=prefix))
 
 schema = QAPISchema(input_file)
-vis = QAPISchemaGenIntrospectVisitor(opt_unmask)
+vis = QAPISchemaGenIntrospectVisitor(prefix, opt_unmask)
 schema.visit(vis)
 genc.body(vis.defn)
 genh.body(vis.decl)
diff --git a/scripts/qapi-types.py b/scripts/qapi-types.py
index 97406b3368..2d711b137b 100644
--- a/scripts/qapi-types.py
+++ b/scripts/qapi-types.py
@@ -168,7 +168,8 @@ void qapi_free_%(c_name)s(%(c_name)s *obj)
 
 
 class QAPISchemaGenTypeVisitor(QAPISchemaVisitor):
-    def __init__(self):
+    def __init__(self, opt_builtins):
+        self._opt_builtins = opt_builtins
         self.decl = None
         self.defn = None
         self._fwdecl = None
@@ -187,7 +188,7 @@ class QAPISchemaGenTypeVisitor(QAPISchemaVisitor):
         self._fwdecl = None
         # To avoid header dependency hell, we always generate
         # declarations for built-in types in our header files and
-        # simply guard them.  See also do_builtins (command line
+        # simply guard them.  See also opt_builtins (command line
         # option -b).
         self._btin += guardend('QAPI_TYPES_BUILTIN')
         self.decl = self._btin + self.decl
@@ -202,7 +203,7 @@ class QAPISchemaGenTypeVisitor(QAPISchemaVisitor):
         # TODO use something cleaner than existence of info
         if not info:
             self._btin += gen_enum(name, values, prefix)
-            if do_builtins:
+            if self._opt_builtins:
                 self.defn += gen_enum_lookup(name, values, prefix)
         else:
             self._fwdecl += gen_enum(name, values, prefix)
@@ -213,7 +214,7 @@ class QAPISchemaGenTypeVisitor(QAPISchemaVisitor):
             self._btin += gen_fwd_object_or_array(name)
             self._btin += gen_array(name, element_type)
             self._btin += gen_type_cleanup_decl(name)
-            if do_builtins:
+            if self._opt_builtins:
                 self.defn += gen_type_cleanup(name)
         else:
             self._fwdecl += gen_fwd_object_or_array(name)
@@ -241,16 +242,16 @@ class QAPISchemaGenTypeVisitor(QAPISchemaVisitor):
 
 # If you link code generated from multiple schemata, you want only one
 # instance of the code for built-in types.  Generate it only when
-# do_builtins, enabled by command line option -b.  See also
+# opt_builtins, enabled by command line option -b.  See also
 # QAPISchemaGenTypeVisitor.visit_end().
-do_builtins = False
+opt_builtins = False
 
 (input_file, output_dir, do_c, do_h, prefix, opts) = \
     parse_command_line('b', ['builtins'])
 
 for o, a in opts:
     if o in ('-b', '--builtins'):
-        do_builtins = True
+        opt_builtins = True
 
 blurb = '''
  * Schema-defined QAPI types
@@ -272,7 +273,7 @@ genh.body(mcgen('''
 '''))
 
 schema = QAPISchema(input_file)
-vis = QAPISchemaGenTypeVisitor()
+vis = QAPISchemaGenTypeVisitor(opt_builtins)
 schema.visit(vis)
 genc.body(vis.defn)
 genh.body(vis.decl)
diff --git a/scripts/qapi-visit.py b/scripts/qapi-visit.py
index d1b25daf0d..79dc6cae48 100644
--- a/scripts/qapi-visit.py
+++ b/scripts/qapi-visit.py
@@ -264,7 +264,8 @@ out:
 
 
 class QAPISchemaGenVisitVisitor(QAPISchemaVisitor):
-    def __init__(self):
+    def __init__(self, opt_builtins):
+        self._opt_builtins = opt_builtins
         self.decl = None
         self.defn = None
         self._btin = None
@@ -277,7 +278,7 @@ class QAPISchemaGenVisitVisitor(QAPISchemaVisitor):
     def visit_end(self):
         # To avoid header dependency hell, we always generate
         # declarations for built-in types in our header files and
-        # simply guard them.  See also do_builtins (command line
+        # simply guard them.  See also opt_builtins (command line
         # option -b).
         self._btin += guardend('QAPI_VISIT_BUILTIN')
         self.decl = self._btin + self.decl
@@ -288,7 +289,7 @@ class QAPISchemaGenVisitVisitor(QAPISchemaVisitor):
         # TODO use something cleaner than existence of info
         if not info:
             self._btin += gen_visit_decl(name, scalar=True)
-            if do_builtins:
+            if self._opt_builtins:
                 self.defn += gen_visit_enum(name)
         else:
             self.decl += gen_visit_decl(name, scalar=True)
@@ -299,7 +300,7 @@ class QAPISchemaGenVisitVisitor(QAPISchemaVisitor):
         defn = gen_visit_list(name, element_type)
         if isinstance(element_type, QAPISchemaBuiltinType):
             self._btin += decl
-            if do_builtins:
+            if self._opt_builtins:
                 self.defn += defn
         else:
             self.decl += decl
@@ -324,16 +325,16 @@ class QAPISchemaGenVisitVisitor(QAPISchemaVisitor):
 
 # If you link code generated from multiple schemata, you want only one
 # instance of the code for built-in types.  Generate it only when
-# do_builtins, enabled by command line option -b.  See also
+# opt_builtins, enabled by command line option -b.  See also
 # QAPISchemaGenVisitVisitor.visit_end().
-do_builtins = False
+opt_builtins = False
 
 (input_file, output_dir, do_c, do_h, prefix, opts) = \
     parse_command_line('b', ['builtins'])
 
 for o, a in opts:
     if o in ('-b', '--builtins'):
-        do_builtins = True
+        opt_builtins = True
 
 blurb = '''
  * Schema-defined QAPI visitors
@@ -359,7 +360,7 @@ genh.body(mcgen('''
                 prefix=prefix))
 
 schema = QAPISchema(input_file)
-vis = QAPISchemaGenVisitVisitor()
+vis = QAPISchemaGenVisitVisitor(opt_builtins)
 schema.visit(vis)
 genc.body(vis.defn)
 genh.body(vis.decl)
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 87+ messages in thread

* [Qemu-devel] [PATCH RFC 05/21] qapi: Turn generators into modules
  2018-02-02 13:03 [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code Markus Armbruster
                   ` (3 preceding siblings ...)
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 04/21] qapi: Reduce use of global variables in generators some Markus Armbruster
@ 2018-02-02 13:03 ` Markus Armbruster
  2018-02-02 16:47   ` Eric Blake
  2018-02-05 13:44   ` Marc-Andre Lureau
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 06/21] qapi-gen: New common driver for code and doc generators Markus Armbruster
                   ` (23 subsequent siblings)
  28 siblings, 2 replies; 87+ messages in thread
From: Markus Armbruster @ 2018-02-02 13:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: marcandre.lureau, eblake, mdroth

The next commit will introduce a common driver program for all
generators.  The generators need to be modules for that.  qapi2texi.py
already is.  Make the other generators follow suit.

The changes are actually trivial.  Obvious in the diffs once you view
them with whitespace changes ignored.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 scripts/qapi-commands.py   | 43 ++++++++++++++++++--------------
 scripts/qapi-event.py      | 43 ++++++++++++++++++--------------
 scripts/qapi-introspect.py | 54 ++++++++++++++++++++++------------------
 scripts/qapi-types.py      | 56 ++++++++++++++++++++++-------------------
 scripts/qapi-visit.py      | 62 +++++++++++++++++++++++++---------------------
 5 files changed, 143 insertions(+), 115 deletions(-)

diff --git a/scripts/qapi-commands.py b/scripts/qapi-commands.py
index d229537659..331b58670e 100644
--- a/scripts/qapi-commands.py
+++ b/scripts/qapi-commands.py
@@ -255,16 +255,17 @@ class QAPISchemaGenCommandVisitor(QAPISchemaVisitor):
         self._regy += gen_register_command(name, success_response)
 
 
-(input_file, output_dir, do_c, do_h, prefix, opts) = parse_command_line()
+def main(argv):
+    (input_file, output_dir, do_c, do_h, prefix, opts) = parse_command_line()
 
-blurb = '''
+    blurb = '''
  * Schema-defined QAPI/QMP commands
 '''
 
-genc = QAPIGenC(blurb, __doc__)
-genh = QAPIGenH(blurb, __doc__)
+    genc = QAPIGenC(blurb, __doc__)
+    genh = QAPIGenH(blurb, __doc__)
 
-genc.body(mcgen('''
+    genc.body(mcgen('''
 #include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qemu/module.h"
@@ -278,24 +279,28 @@ genc.body(mcgen('''
 #include "%(prefix)sqmp-commands.h"
 
 ''',
-                prefix=prefix))
+                    prefix=prefix))
 
-genh.body(mcgen('''
+    genh.body(mcgen('''
 #include "%(prefix)sqapi-types.h"
 #include "qapi/qmp/qdict.h"
 #include "qapi/qmp/dispatch.h"
 
 void %(c_prefix)sqmp_init_marshal(QmpCommandList *cmds);
 ''',
-                prefix=prefix, c_prefix=c_name(prefix, protect=False)))
-
-schema = QAPISchema(input_file)
-vis = QAPISchemaGenCommandVisitor(prefix)
-schema.visit(vis)
-genc.body(vis.defn)
-genh.body(vis.decl)
-
-if do_c:
-    genc.write(output_dir, prefix + 'qmp-marshal.c')
-if do_h:
-    genh.write(output_dir, prefix + 'qmp-commands.h')
+                    prefix=prefix, c_prefix=c_name(prefix, protect=False)))
+
+    schema = QAPISchema(input_file)
+    vis = QAPISchemaGenCommandVisitor(prefix)
+    schema.visit(vis)
+    genc.body(vis.defn)
+    genh.body(vis.decl)
+
+    if do_c:
+        genc.write(output_dir, prefix + 'qmp-marshal.c')
+    if do_h:
+        genh.write(output_dir, prefix + 'qmp-commands.h')
+
+
+if __name__ == '__main__':
+    main(sys.argv)
diff --git a/scripts/qapi-event.py b/scripts/qapi-event.py
index 1af21b580a..5b33c694d4 100644
--- a/scripts/qapi-event.py
+++ b/scripts/qapi-event.py
@@ -171,16 +171,17 @@ class QAPISchemaGenEventVisitor(QAPISchemaVisitor):
         self._event_names.append(name)
 
 
-(input_file, output_dir, do_c, do_h, prefix, dummy) = parse_command_line()
+def main(argv):
+    (input_file, output_dir, do_c, do_h, prefix, dummy) = parse_command_line()
 
-blurb = '''
+    blurb = '''
  * Schema-defined QAPI/QMP events
 '''
 
-genc = QAPIGenC(blurb, __doc__)
-genh = QAPIGenH(blurb, __doc__)
+    genc = QAPIGenC(blurb, __doc__)
+    genh = QAPIGenH(blurb, __doc__)
 
-genc.body(mcgen('''
+    genc.body(mcgen('''
 #include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "%(prefix)sqapi-event.h"
@@ -190,23 +191,27 @@ genc.body(mcgen('''
 #include "qapi/qmp-event.h"
 
 ''',
-                prefix=prefix))
+                    prefix=prefix))
 
-genh.body(mcgen('''
+    genh.body(mcgen('''
 #include "qapi/util.h"
 #include "qapi/qmp/qdict.h"
 #include "%(prefix)sqapi-types.h"
 
 ''',
-                prefix=prefix))
-
-schema = QAPISchema(input_file)
-vis = QAPISchemaGenEventVisitor(prefix)
-schema.visit(vis)
-genc.body(vis.defn)
-genh.body(vis.decl)
-
-if do_c:
-    genc.write(output_dir, prefix + 'qapi-event.c')
-if do_h:
-    genh.write(output_dir, prefix + 'qapi-event.h')
+                    prefix=prefix))
+
+    schema = QAPISchema(input_file)
+    vis = QAPISchemaGenEventVisitor(prefix)
+    schema.visit(vis)
+    genc.body(vis.defn)
+    genh.body(vis.decl)
+
+    if do_c:
+        genc.write(output_dir, prefix + 'qapi-event.c')
+    if do_h:
+        genh.write(output_dir, prefix + 'qapi-event.h')
+
+
+if __name__ == '__main__':
+    main(sys.argv)
diff --git a/scripts/qapi-introspect.py b/scripts/qapi-introspect.py
index 8d4e3c1c3a..09e7d1f140 100644
--- a/scripts/qapi-introspect.py
+++ b/scripts/qapi-introspect.py
@@ -167,38 +167,44 @@ const char %(c_name)s[] = %(c_string)s;
         arg_type = arg_type or self._schema.the_empty_object_type
         self._gen_json(name, 'event', {'arg-type': self._use_type(arg_type)})
 
-# Debugging aid: unmask QAPI schema's type names
-# We normally mask them, because they're not QMP wire ABI
-opt_unmask = False
 
-(input_file, output_dir, do_c, do_h, prefix, opts) = \
-    parse_command_line('u', ['unmask-non-abi-names'])
+def main(argv):
+    # Debugging aid: unmask QAPI schema's type names
+    # We normally mask them, because they're not QMP wire ABI
+    opt_unmask = False
 
-for o, a in opts:
-    if o in ('-u', '--unmask-non-abi-names'):
-        opt_unmask = True
+    (input_file, output_dir, do_c, do_h, prefix, opts) = \
+        parse_command_line('u', ['unmask-non-abi-names'])
 
-blurb = '''
+    for o, a in opts:
+        if o in ('-u', '--unmask-non-abi-names'):
+            opt_unmask = True
+
+    blurb = '''
  * QAPI/QMP schema introspection
 '''
 
-genc = QAPIGenC(blurb, __doc__)
-genh = QAPIGenH(blurb, __doc__)
+    genc = QAPIGenC(blurb, __doc__)
+    genh = QAPIGenH(blurb, __doc__)
 
-genc.body(mcgen('''
+    genc.body(mcgen('''
 #include "qemu/osdep.h"
 #include "%(prefix)sqmp-introspect.h"
 
 ''',
-                prefix=prefix))
-
-schema = QAPISchema(input_file)
-vis = QAPISchemaGenIntrospectVisitor(prefix, opt_unmask)
-schema.visit(vis)
-genc.body(vis.defn)
-genh.body(vis.decl)
-
-if do_c:
-    genc.write(output_dir, prefix + 'qmp-introspect.c')
-if do_h:
-    genh.write(output_dir, prefix + 'qmp-introspect.h')
+                    prefix=prefix))
+
+    schema = QAPISchema(input_file)
+    vis = QAPISchemaGenIntrospectVisitor(prefix, opt_unmask)
+    schema.visit(vis)
+    genc.body(vis.defn)
+    genh.body(vis.decl)
+
+    if do_c:
+        genc.write(output_dir, prefix + 'qmp-introspect.c')
+    if do_h:
+        genh.write(output_dir, prefix + 'qmp-introspect.h')
+
+
+if __name__ == '__main__':
+    main(sys.argv)
diff --git a/scripts/qapi-types.py b/scripts/qapi-types.py
index 2d711b137b..f2ddde94b1 100644
--- a/scripts/qapi-types.py
+++ b/scripts/qapi-types.py
@@ -240,45 +240,51 @@ class QAPISchemaGenTypeVisitor(QAPISchemaVisitor):
         self.decl += gen_object(name, None, [variants.tag_member], variants)
         self._gen_type_cleanup(name)
 
-# If you link code generated from multiple schemata, you want only one
-# instance of the code for built-in types.  Generate it only when
-# opt_builtins, enabled by command line option -b.  See also
-# QAPISchemaGenTypeVisitor.visit_end().
-opt_builtins = False
 
-(input_file, output_dir, do_c, do_h, prefix, opts) = \
-    parse_command_line('b', ['builtins'])
+def main(argv):
+    # If you link code generated from multiple schemata, you want only one
+    # instance of the code for built-in types.  Generate it only when
+    # opt_builtins, enabled by command line option -b.  See also
+    # QAPISchemaGenTypeVisitor.visit_end().
+    opt_builtins = False
 
-for o, a in opts:
-    if o in ('-b', '--builtins'):
-        opt_builtins = True
+    (input_file, output_dir, do_c, do_h, prefix, opts) = \
+        parse_command_line('b', ['builtins'])
 
-blurb = '''
+    for o, a in opts:
+        if o in ('-b', '--builtins'):
+            opt_builtins = True
+
+    blurb = '''
  * Schema-defined QAPI types
 '''
 
-genc = QAPIGenC(blurb, __doc__)
-genh = QAPIGenH(blurb, __doc__)
+    genc = QAPIGenC(blurb, __doc__)
+    genh = QAPIGenH(blurb, __doc__)
 
-genc.body(mcgen('''
+    genc.body(mcgen('''
 #include "qemu/osdep.h"
 #include "qapi/dealloc-visitor.h"
 #include "%(prefix)sqapi-types.h"
 #include "%(prefix)sqapi-visit.h"
 ''',
-                prefix=prefix))
+                    prefix=prefix))
 
-genh.body(mcgen('''
+    genh.body(mcgen('''
 #include "qapi/util.h"
 '''))
 
-schema = QAPISchema(input_file)
-vis = QAPISchemaGenTypeVisitor(opt_builtins)
-schema.visit(vis)
-genc.body(vis.defn)
-genh.body(vis.decl)
+    schema = QAPISchema(input_file)
+    vis = QAPISchemaGenTypeVisitor(opt_builtins)
+    schema.visit(vis)
+    genc.body(vis.defn)
+    genh.body(vis.decl)
 
-if do_c:
-    genc.write(output_dir, prefix + 'qapi-types.c')
-if do_h:
-    genh.write(output_dir, prefix + 'qapi-types.h')
+    if do_c:
+        genc.write(output_dir, prefix + 'qapi-types.c')
+    if do_h:
+        genh.write(output_dir, prefix + 'qapi-types.h')
+
+
+if __name__ == '__main__':
+    main(sys.argv)
diff --git a/scripts/qapi-visit.py b/scripts/qapi-visit.py
index 79dc6cae48..473fa72574 100644
--- a/scripts/qapi-visit.py
+++ b/scripts/qapi-visit.py
@@ -323,49 +323,55 @@ class QAPISchemaGenVisitVisitor(QAPISchemaVisitor):
         self.decl += gen_visit_decl(name)
         self.defn += gen_visit_alternate(name, variants)
 
-# If you link code generated from multiple schemata, you want only one
-# instance of the code for built-in types.  Generate it only when
-# opt_builtins, enabled by command line option -b.  See also
-# QAPISchemaGenVisitVisitor.visit_end().
-opt_builtins = False
 
-(input_file, output_dir, do_c, do_h, prefix, opts) = \
-    parse_command_line('b', ['builtins'])
+def main(argv):
+    # If you link code generated from multiple schemata, you want only one
+    # instance of the code for built-in types.  Generate it only when
+    # opt_builtins, enabled by command line option -b.  See also
+    # QAPISchemaGenVisitVisitor.visit_end().
+    opt_builtins = False
 
-for o, a in opts:
-    if o in ('-b', '--builtins'):
-        opt_builtins = True
+    (input_file, output_dir, do_c, do_h, prefix, opts) = \
+        parse_command_line('b', ['builtins'])
 
-blurb = '''
+    for o, a in opts:
+        if o in ('-b', '--builtins'):
+            opt_builtins = True
+
+    blurb = '''
  * Schema-defined QAPI visitors
 '''
 
-genc = QAPIGenC(blurb, __doc__)
-genh = QAPIGenH(blurb, __doc__)
+    genc = QAPIGenC(blurb, __doc__)
+    genh = QAPIGenH(blurb, __doc__)
 
-genc.body(mcgen('''
+    genc.body(mcgen('''
 #include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qapi/error.h"
 #include "%(prefix)sqapi-visit.h"
 ''',
-                prefix=prefix))
+                    prefix=prefix))
 
-genh.body(mcgen('''
+    genh.body(mcgen('''
 #include "qapi/visitor.h"
 #include "qapi/qmp/qerror.h"
 #include "%(prefix)sqapi-types.h"
 
 ''',
-                prefix=prefix))
-
-schema = QAPISchema(input_file)
-vis = QAPISchemaGenVisitVisitor(opt_builtins)
-schema.visit(vis)
-genc.body(vis.defn)
-genh.body(vis.decl)
-
-if do_c:
-    genc.write(output_dir, prefix + 'qapi-visit.c')
-if do_h:
-    genh.write(output_dir, prefix + 'qapi-visit.h')
+                    prefix=prefix))
+
+    schema = QAPISchema(input_file)
+    vis = QAPISchemaGenVisitVisitor(opt_builtins)
+    schema.visit(vis)
+    genc.body(vis.defn)
+    genh.body(vis.decl)
+
+    if do_c:
+        genc.write(output_dir, prefix + 'qapi-visit.c')
+    if do_h:
+        genh.write(output_dir, prefix + 'qapi-visit.h')
+
+
+if __name__ == '__main__':
+    main(sys.argv)
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 87+ messages in thread

* [Qemu-devel] [PATCH RFC 06/21] qapi-gen: New common driver for code and doc generators
  2018-02-02 13:03 [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code Markus Armbruster
                   ` (4 preceding siblings ...)
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 05/21] qapi: Turn generators into modules Markus Armbruster
@ 2018-02-02 13:03 ` Markus Armbruster
  2018-02-02 19:27   ` Eric Blake
  2018-02-05 13:44   ` Marc-Andre Lureau
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 07/21] qapi: Move parse_command_line() next to its only use Markus Armbruster
                   ` (22 subsequent siblings)
  28 siblings, 2 replies; 87+ messages in thread
From: Markus Armbruster @ 2018-02-02 13:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: marcandre.lureau, eblake, mdroth

Whenever qapi-schema.json changes, we run six programs eleven times to
update eleven files.  This is silly.  Replace the six programs by a
single program that spits out all eleven files.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 Makefile                                           | 86 ++++++++++------------
 scripts/qapi-gen.py                                | 41 +++++++++++
 scripts/qapi/__init__.py                           |  0
 scripts/{qapi-commands.py => qapi/commands.py}     | 23 ++----
 scripts/{qapi.py => qapi/common.py}                |  0
 scripts/{qapi2texi.py => qapi/doc.py}              | 29 ++------
 scripts/{qapi-event.py => qapi/events.py}          | 23 ++----
 scripts/{qapi-introspect.py => qapi/introspect.py} | 32 ++------
 scripts/{qapi-types.py => qapi/types.py}           | 34 ++-------
 scripts/{qapi-visit.py => qapi/visit.py}           | 34 ++-------
 tests/Makefile.include                             | 56 +++++++-------
 tests/qapi-schema/test-qapi.py                     |  2 +-
 12 files changed, 140 insertions(+), 220 deletions(-)
 create mode 100755 scripts/qapi-gen.py
 create mode 100644 scripts/qapi/__init__.py
 rename scripts/{qapi-commands.py => qapi/commands.py} (94%)
 rename scripts/{qapi.py => qapi/common.py} (100%)
 rename scripts/{qapi2texi.py => qapi/doc.py} (92%)
 mode change 100755 => 100644
 rename scripts/{qapi-event.py => qapi/events.py} (92%)
 rename scripts/{qapi-introspect.py => qapi/introspect.py} (90%)
 rename scripts/{qapi-types.py => qapi/types.py} (90%)
 rename scripts/{qapi-visit.py => qapi/visit.py} (92%)

diff --git a/Makefile b/Makefile
index af31e8981f..e02f0c13ef 100644
--- a/Makefile
+++ b/Makefile
@@ -92,6 +92,7 @@ GENERATED_FILES += qmp-commands.h qapi-types.h qapi-visit.h qapi-event.h
 GENERATED_FILES += qmp-marshal.c qapi-types.c qapi-visit.c qapi-event.c
 GENERATED_FILES += qmp-introspect.h
 GENERATED_FILES += qmp-introspect.c
+GENERATED_FILES += qapi.texi
 
 GENERATED_FILES += trace/generated-tcg-tracers.h
 
@@ -477,25 +478,26 @@ qemu-ga$(EXESUF): QEMU_CFLAGS += -I qga/qapi-generated
 qemu-keymap$(EXESUF): LIBS += $(XKBCOMMON_LIBS)
 qemu-keymap$(EXESUF): QEMU_CFLAGS += $(XKBCOMMON_CFLAGS)
 
-gen-out-type = $(subst .,-,$(suffix $@))
+qapi-py = $(SRC_PATH)/scripts/qapi/commands.py \
+$(SRC_PATH)/scripts/qapi/events.py \
+$(SRC_PATH)/scripts/qapi/introspect.py \
+$(SRC_PATH)/scripts/qapi/types.py \
+$(SRC_PATH)/scripts/qapi/visit.py \
+$(SRC_PATH)/scripts/qapi/common.py \
+$(SRC_PATH)/scripts/qapi/doc.py \
+$(SRC_PATH)/scripts/ordereddict.py \
+$(SRC_PATH)/scripts/qapi-gen.py
 
-qapi-py = $(SRC_PATH)/scripts/qapi.py $(SRC_PATH)/scripts/ordereddict.py
-
-qga/qapi-generated/qga-qapi-types.c qga/qapi-generated/qga-qapi-types.h :\
-$(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-types.py $(qapi-py)
-	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py \
-		$(gen-out-type) -o qga/qapi-generated -p "qga-" $<, \
-		"GEN","$@")
-qga/qapi-generated/qga-qapi-visit.c qga/qapi-generated/qga-qapi-visit.h :\
-$(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py)
-	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py \
-		$(gen-out-type) -o qga/qapi-generated -p "qga-" $<, \
-		"GEN","$@")
-qga/qapi-generated/qga-qmp-commands.h qga/qapi-generated/qga-qmp-marshal.c :\
-$(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py)
-	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py \
-		$(gen-out-type) -o qga/qapi-generated -p "qga-" $<, \
-		"GEN","$@")
+qga/qapi-generated/qga-qapi-types.c qga/qapi-generated/qga-qapi-types.h \
+qga/qapi-generated/qga-qapi-visit.c qga/qapi-generated/qga-qapi-visit.h \
+qga/qapi-generated/qga-qmp-commands.h qga/qapi-generated/qga-qmp-marshal.c \
+qga/qapi-generated/qga-qapi.texi: \
+qga/qapi-generated/qapi-gen-timestamp ;
+qga/qapi-generated/qapi-gen-timestamp: $(SRC_PATH)/qga/qapi-schema.json $(qapi-py)
+	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-gen.py \
+		-o qga/qapi-generated -p "qga-" $<, \
+		"GEN","$(@:%-timestamp=%)")
+	@>$@
 
 qapi-modules = $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/qapi/common.json \
                $(SRC_PATH)/qapi/block.json $(SRC_PATH)/qapi/block-core.json \
@@ -512,31 +514,18 @@ qapi-modules = $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/qapi/common.json \
                $(SRC_PATH)/qapi/transaction.json \
                $(SRC_PATH)/qapi/ui.json
 
-qapi-types.c qapi-types.h :\
-$(qapi-modules) $(SRC_PATH)/scripts/qapi-types.py $(qapi-py)
-	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py \
-		$(gen-out-type) -o "." -b $<, \
-		"GEN","$@")
-qapi-visit.c qapi-visit.h :\
-$(qapi-modules) $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py)
-	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py \
-		$(gen-out-type) -o "." -b $<, \
-		"GEN","$@")
-qapi-event.c qapi-event.h :\
-$(qapi-modules) $(SRC_PATH)/scripts/qapi-event.py $(qapi-py)
-	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-event.py \
-		$(gen-out-type) -o "." $<, \
-		"GEN","$@")
-qmp-commands.h qmp-marshal.c :\
-$(qapi-modules) $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py)
-	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py \
-		$(gen-out-type) -o "." $<, \
-		"GEN","$@")
-qmp-introspect.h qmp-introspect.c :\
-$(qapi-modules) $(SRC_PATH)/scripts/qapi-introspect.py $(qapi-py)
-	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-introspect.py \
-		$(gen-out-type) -o "." $<, \
-		"GEN","$@")
+qapi-types.c qapi-types.h \
+qapi-visit.c qapi-visit.h \
+qmp-commands.h qmp-marshal.c \
+qapi-event.c qapi-event.h \
+qmp-introspect.h qmp-introspect.c \
+qapi.texi: \
+qapi-gen-timestamp ;
+qapi-gen-timestamp: $(qapi-modules) $(qapi-py)
+	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-gen.py \
+		-o "." -b $<, \
+		"GEN","$(@:%-timestamp=%)")
+	@>$@
 
 QGALIB_GEN=$(addprefix qga/qapi-generated/, qga-qapi-types.h qga-qapi-visit.h qga-qmp-commands.h)
 $(qga-obj-y): $(QGALIB_GEN)
@@ -596,6 +585,7 @@ clean:
 	rm -f trace/generated-tracers-dtrace.dtrace*
 	rm -f trace/generated-tracers-dtrace.h*
 	rm -f $(foreach f,$(GENERATED_FILES),$(f) $(f)-timestamp)
+	rm -f qapi-gen-timestamp
 	rm -rf qapi-generated
 	rm -rf qga/qapi-generated
 	for d in $(ALL_SUBDIRS); do \
@@ -803,13 +793,11 @@ qemu-monitor-info.texi: $(SRC_PATH)/hmp-commands-info.hx $(SRC_PATH)/scripts/hxt
 qemu-img-cmds.texi: $(SRC_PATH)/qemu-img-cmds.hx $(SRC_PATH)/scripts/hxtool
 	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"GEN","$@")
 
-docs/interop/qemu-qmp-qapi.texi docs/interop/qemu-ga-qapi.texi: $(SRC_PATH)/scripts/qapi2texi.py $(qapi-py)
+docs/interop/qemu-qmp-qapi.texi: qapi.texi
+	@cp -p $< $@
 
-docs/interop/qemu-qmp-qapi.texi: $(qapi-modules)
-	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi2texi.py $< > $@,"GEN","$@")
-
-docs/interop/qemu-ga-qapi.texi: $(SRC_PATH)/qga/qapi-schema.json
-	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi2texi.py $< > $@,"GEN","$@")
+docs/interop/qemu-ga-qapi.texi: qga/qapi-generated/qga-qapi.texi
+	@cp -p $< $@
 
 qemu.1: qemu-doc.texi qemu-options.texi qemu-monitor.texi qemu-monitor-info.texi
 qemu.1: qemu-option-trace.texi
diff --git a/scripts/qapi-gen.py b/scripts/qapi-gen.py
new file mode 100755
index 0000000000..575c938a1b
--- /dev/null
+++ b/scripts/qapi-gen.py
@@ -0,0 +1,41 @@
+#!/usr/bin/env python
+# QAPI generator
+#
+# This work is licensed under the terms of the GNU GPL, version 2 or later.
+# See the COPYING file in the top-level directory.
+
+import sys
+from qapi.common import parse_command_line, QAPISchema
+from qapi.types import gen_types
+from qapi.visit import gen_visit
+from qapi.commands import gen_commands
+from qapi.events import gen_events
+from qapi.introspect import gen_introspect
+from qapi.doc import gen_doc
+
+
+def main(argv):
+    (input_file, output_dir, do_c, do_h, prefix, opts) = \
+        parse_command_line('bu', ['builtins', 'unmask-non-abi-names'])
+
+    opt_builtins = False
+    opt_unmask = False
+
+    for o, a in opts:
+        if o in ('-b', '--builtins'):
+            opt_builtins = True
+        if o in ('-u', '--unmask-non-abi-names'):
+            opt_unmask = True
+
+    schema = QAPISchema(input_file)
+
+    gen_types(schema, output_dir, prefix, opt_builtins)
+    gen_visit(schema, output_dir, prefix, opt_builtins)
+    gen_commands(schema, output_dir, prefix)
+    gen_events(schema, output_dir, prefix)
+    gen_introspect(schema, output_dir, prefix, opt_unmask)
+    gen_doc(schema, output_dir, prefix)
+
+
+if __name__ == '__main__':
+    main(sys.argv)
diff --git a/scripts/qapi/__init__.py b/scripts/qapi/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/scripts/qapi-commands.py b/scripts/qapi/commands.py
similarity index 94%
rename from scripts/qapi-commands.py
rename to scripts/qapi/commands.py
index 331b58670e..383a4dd426 100644
--- a/scripts/qapi-commands.py
+++ b/scripts/qapi/commands.py
@@ -13,7 +13,7 @@ This work is licensed under the terms of the GNU GPL, version 2.
 See the COPYING file in the top-level directory.
 """
 
-from qapi import *
+from qapi.common import *
 
 
 def gen_command_decl(name, arg_type, boxed, ret_type):
@@ -255,13 +255,8 @@ class QAPISchemaGenCommandVisitor(QAPISchemaVisitor):
         self._regy += gen_register_command(name, success_response)
 
 
-def main(argv):
-    (input_file, output_dir, do_c, do_h, prefix, opts) = parse_command_line()
-
-    blurb = '''
- * Schema-defined QAPI/QMP commands
-'''
-
+def gen_commands(schema, output_dir, prefix):
+    blurb = ' * Schema-defined QAPI/QMP commands'
     genc = QAPIGenC(blurb, __doc__)
     genh = QAPIGenH(blurb, __doc__)
 
@@ -290,17 +285,9 @@ void %(c_prefix)sqmp_init_marshal(QmpCommandList *cmds);
 ''',
                     prefix=prefix, c_prefix=c_name(prefix, protect=False)))
 
-    schema = QAPISchema(input_file)
     vis = QAPISchemaGenCommandVisitor(prefix)
     schema.visit(vis)
     genc.body(vis.defn)
     genh.body(vis.decl)
-
-    if do_c:
-        genc.write(output_dir, prefix + 'qmp-marshal.c')
-    if do_h:
-        genh.write(output_dir, prefix + 'qmp-commands.h')
-
-
-if __name__ == '__main__':
-    main(sys.argv)
+    genc.write(output_dir, prefix + 'qmp-marshal.c')
+    genh.write(output_dir, prefix + 'qmp-commands.h')
diff --git a/scripts/qapi.py b/scripts/qapi/common.py
similarity index 100%
rename from scripts/qapi.py
rename to scripts/qapi/common.py
diff --git a/scripts/qapi2texi.py b/scripts/qapi/doc.py
old mode 100755
new mode 100644
similarity index 92%
rename from scripts/qapi2texi.py
rename to scripts/qapi/doc.py
index 924b374cd3..1f57f6e1c2
--- a/scripts/qapi2texi.py
+++ b/scripts/qapi/doc.py
@@ -4,10 +4,9 @@
 # This work is licensed under the terms of the GNU LGPL, version 2+.
 # See the COPYING file in the top-level directory.
 """This script produces the documentation of a qapi schema in texinfo format"""
+
 import re
-import sys
-
-import qapi
+import qapi.common
 
 MSG_FMT = """
 @deftypefn {type} {{}} {name}
@@ -196,7 +195,7 @@ def texi_entity(doc, what, base=None, variants=None,
             + texi_sections(doc))
 
 
-class QAPISchemaGenDocVisitor(qapi.QAPISchemaVisitor):
+class QAPISchemaGenDocVisitor(qapi.common.QAPISchemaVisitor):
     def __init__(self):
         self.out = None
         self.cur_doc = None
@@ -271,20 +270,8 @@ def texi_schema(schema):
     return gen.out
 
 
-def main(argv):
-    """Takes schema argument, prints result to stdout"""
-    if len(argv) != 2:
-        print >>sys.stderr, "%s: need exactly 1 argument: SCHEMA" % argv[0]
-        sys.exit(1)
-
-    schema = qapi.QAPISchema(argv[1])
-    if not qapi.doc_required:
-        print >>sys.stderr, ("%s: need pragma 'doc-required' "
-                             "to generate documentation" % argv[0])
-        sys.exit(1)
-    print '@c AUTOMATICALLY GENERATED, DO NOT MODIFY\n'
-    print texi_schema(schema),
-
-
-if __name__ == '__main__':
-    main(sys.argv)
+def gen_doc(schema, output_dir, prefix):
+    if qapi.common.doc_required:
+        gen = qapi.common.QAPIGenDoc()
+        gen.body(texi_schema(schema))
+        gen.write(output_dir, prefix + 'qapi.texi')
diff --git a/scripts/qapi-event.py b/scripts/qapi/events.py
similarity index 92%
rename from scripts/qapi-event.py
rename to scripts/qapi/events.py
index 5b33c694d4..1f267686db 100644
--- a/scripts/qapi-event.py
+++ b/scripts/qapi/events.py
@@ -12,7 +12,7 @@ This work is licensed under the terms of the GNU GPL, version 2.
 See the COPYING file in the top-level directory.
 """
 
-from qapi import *
+from qapi.common import *
 
 
 def build_event_send_proto(name, arg_type, boxed):
@@ -171,13 +171,8 @@ class QAPISchemaGenEventVisitor(QAPISchemaVisitor):
         self._event_names.append(name)
 
 
-def main(argv):
-    (input_file, output_dir, do_c, do_h, prefix, dummy) = parse_command_line()
-
-    blurb = '''
- * Schema-defined QAPI/QMP events
-'''
-
+def gen_events(schema, output_dir, prefix):
+    blurb = ' * Schema-defined QAPI/QMP events'
     genc = QAPIGenC(blurb, __doc__)
     genh = QAPIGenH(blurb, __doc__)
 
@@ -201,17 +196,9 @@ def main(argv):
 ''',
                     prefix=prefix))
 
-    schema = QAPISchema(input_file)
     vis = QAPISchemaGenEventVisitor(prefix)
     schema.visit(vis)
     genc.body(vis.defn)
     genh.body(vis.decl)
-
-    if do_c:
-        genc.write(output_dir, prefix + 'qapi-event.c')
-    if do_h:
-        genh.write(output_dir, prefix + 'qapi-event.h')
-
-
-if __name__ == '__main__':
-    main(sys.argv)
+    genc.write(output_dir, prefix + 'qapi-event.c')
+    genh.write(output_dir, prefix + 'qapi-event.h')
diff --git a/scripts/qapi-introspect.py b/scripts/qapi/introspect.py
similarity index 90%
rename from scripts/qapi-introspect.py
rename to scripts/qapi/introspect.py
index 09e7d1f140..2153060f2c 100644
--- a/scripts/qapi-introspect.py
+++ b/scripts/qapi/introspect.py
@@ -10,7 +10,7 @@ This work is licensed under the terms of the GNU GPL, version 2.
 See the COPYING file in the top-level directory.
 """
 
-from qapi import *
+from qapi.common import *
 
 
 # Caveman's json.dumps() replacement (we're stuck at Python 2.4)
@@ -168,22 +168,8 @@ const char %(c_name)s[] = %(c_string)s;
         self._gen_json(name, 'event', {'arg-type': self._use_type(arg_type)})
 
 
-def main(argv):
-    # Debugging aid: unmask QAPI schema's type names
-    # We normally mask them, because they're not QMP wire ABI
-    opt_unmask = False
-
-    (input_file, output_dir, do_c, do_h, prefix, opts) = \
-        parse_command_line('u', ['unmask-non-abi-names'])
-
-    for o, a in opts:
-        if o in ('-u', '--unmask-non-abi-names'):
-            opt_unmask = True
-
-    blurb = '''
- * QAPI/QMP schema introspection
-'''
-
+def gen_introspect(schema, output_dir, prefix, opt_unmask):
+    blurb = ' * QAPI/QMP schema introspection'
     genc = QAPIGenC(blurb, __doc__)
     genh = QAPIGenH(blurb, __doc__)
 
@@ -194,17 +180,9 @@ def main(argv):
 ''',
                     prefix=prefix))
 
-    schema = QAPISchema(input_file)
     vis = QAPISchemaGenIntrospectVisitor(prefix, opt_unmask)
     schema.visit(vis)
     genc.body(vis.defn)
     genh.body(vis.decl)
-
-    if do_c:
-        genc.write(output_dir, prefix + 'qmp-introspect.c')
-    if do_h:
-        genh.write(output_dir, prefix + 'qmp-introspect.h')
-
-
-if __name__ == '__main__':
-    main(sys.argv)
+    genc.write(output_dir, prefix + 'qmp-introspect.c')
+    genh.write(output_dir, prefix + 'qmp-introspect.h')
diff --git a/scripts/qapi-types.py b/scripts/qapi/types.py
similarity index 90%
rename from scripts/qapi-types.py
rename to scripts/qapi/types.py
index f2ddde94b1..b2095120e0 100644
--- a/scripts/qapi-types.py
+++ b/scripts/qapi/types.py
@@ -13,7 +13,7 @@ This work is licensed under the terms of the GNU GPL, version 2.
 # See the COPYING file in the top-level directory.
 """
 
-from qapi import *
+from qapi.common import *
 
 
 # variants must be emitted before their container; track what has already
@@ -241,24 +241,8 @@ class QAPISchemaGenTypeVisitor(QAPISchemaVisitor):
         self._gen_type_cleanup(name)
 
 
-def main(argv):
-    # If you link code generated from multiple schemata, you want only one
-    # instance of the code for built-in types.  Generate it only when
-    # opt_builtins, enabled by command line option -b.  See also
-    # QAPISchemaGenTypeVisitor.visit_end().
-    opt_builtins = False
-
-    (input_file, output_dir, do_c, do_h, prefix, opts) = \
-        parse_command_line('b', ['builtins'])
-
-    for o, a in opts:
-        if o in ('-b', '--builtins'):
-            opt_builtins = True
-
-    blurb = '''
- * Schema-defined QAPI types
-'''
-
+def gen_types(schema, output_dir, prefix, opt_builtins):
+    blurb = ' * Schema-defined QAPI types'
     genc = QAPIGenC(blurb, __doc__)
     genh = QAPIGenH(blurb, __doc__)
 
@@ -274,17 +258,9 @@ def main(argv):
 #include "qapi/util.h"
 '''))
 
-    schema = QAPISchema(input_file)
     vis = QAPISchemaGenTypeVisitor(opt_builtins)
     schema.visit(vis)
     genc.body(vis.defn)
     genh.body(vis.decl)
-
-    if do_c:
-        genc.write(output_dir, prefix + 'qapi-types.c')
-    if do_h:
-        genh.write(output_dir, prefix + 'qapi-types.h')
-
-
-if __name__ == '__main__':
-    main(sys.argv)
+    genc.write(output_dir, prefix + 'qapi-types.c')
+    genh.write(output_dir, prefix + 'qapi-types.h')
diff --git a/scripts/qapi-visit.py b/scripts/qapi/visit.py
similarity index 92%
rename from scripts/qapi-visit.py
rename to scripts/qapi/visit.py
index 473fa72574..80c0b85f8c 100644
--- a/scripts/qapi-visit.py
+++ b/scripts/qapi/visit.py
@@ -13,7 +13,7 @@ This work is licensed under the terms of the GNU GPL, version 2.
 See the COPYING file in the top-level directory.
 """
 
-from qapi import *
+from qapi.common import *
 
 
 def gen_visit_decl(name, scalar=False):
@@ -324,24 +324,8 @@ class QAPISchemaGenVisitVisitor(QAPISchemaVisitor):
         self.defn += gen_visit_alternate(name, variants)
 
 
-def main(argv):
-    # If you link code generated from multiple schemata, you want only one
-    # instance of the code for built-in types.  Generate it only when
-    # opt_builtins, enabled by command line option -b.  See also
-    # QAPISchemaGenVisitVisitor.visit_end().
-    opt_builtins = False
-
-    (input_file, output_dir, do_c, do_h, prefix, opts) = \
-        parse_command_line('b', ['builtins'])
-
-    for o, a in opts:
-        if o in ('-b', '--builtins'):
-            opt_builtins = True
-
-    blurb = '''
- * Schema-defined QAPI visitors
-'''
-
+def gen_visit(schema, output_dir, prefix, opt_builtins):
+    blurb = ' * Schema-defined QAPI visitors'
     genc = QAPIGenC(blurb, __doc__)
     genh = QAPIGenH(blurb, __doc__)
 
@@ -361,17 +345,9 @@ def main(argv):
 ''',
                     prefix=prefix))
 
-    schema = QAPISchema(input_file)
     vis = QAPISchemaGenVisitVisitor(opt_builtins)
     schema.visit(vis)
     genc.body(vis.defn)
     genh.body(vis.decl)
-
-    if do_c:
-        genc.write(output_dir, prefix + 'qapi-visit.c')
-    if do_h:
-        genh.write(output_dir, prefix + 'qapi-visit.h')
-
-
-if __name__ == '__main__':
-    main(sys.argv)
+    genc.write(output_dir, prefix + 'qapi-visit.c')
+    genh.write(output_dir, prefix + 'qapi-visit.h')
diff --git a/tests/Makefile.include b/tests/Makefile.include
index 851aafe9d1..768655a810 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -23,7 +23,16 @@ check-help:
 ifneq ($(wildcard config-host.mak),)
 export SRC_PATH
 
-qapi-py = $(SRC_PATH)/scripts/qapi.py $(SRC_PATH)/scripts/ordereddict.py
+# TODO don't duplicate $(SRC_PATH)/Makefile's qapi-py here
+qapi-py = $(SRC_PATH)/scripts/qapi/commands.py \
+$(SRC_PATH)/scripts/qapi/events.py \
+$(SRC_PATH)/scripts/qapi/introspect.py \
+$(SRC_PATH)/scripts/qapi/types.py \
+$(SRC_PATH)/scripts/qapi/visit.py \
+$(SRC_PATH)/scripts/qapi/common.py \
+$(SRC_PATH)/scripts/qapi/doc.py \
+$(SRC_PATH)/scripts/ordereddict.py \
+$(SRC_PATH)/scripts/qapi-gen.py
 
 # Get the list of all supported sysemu targets
 SYSEMU_TARGET_LIST := $(subst -softmmu.mak,,$(notdir \
@@ -642,34 +651,24 @@ tests/test-logging$(EXESUF): tests/test-logging.o $(test-util-obj-y)
 tests/test-replication$(EXESUF): tests/test-replication.o $(test-util-obj-y) \
 	$(test-block-obj-y)
 
-tests/test-qapi-types.c tests/test-qapi-types.h :\
-$(SRC_PATH)/tests/qapi-schema/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-types.py $(qapi-py)
-	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py \
-		$(gen-out-type) -o tests -p "test-" $<, \
-		"GEN","$@")
-tests/test-qapi-visit.c tests/test-qapi-visit.h :\
-$(SRC_PATH)/tests/qapi-schema/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py)
-	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py \
-		$(gen-out-type) -o tests -p "test-" $<, \
-		"GEN","$@")
-tests/test-qmp-commands.h tests/test-qmp-marshal.c :\
-$(SRC_PATH)/tests/qapi-schema/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py)
-	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py \
-		$(gen-out-type) -o tests -p "test-" $<, \
-		"GEN","$@")
-tests/test-qapi-event.c tests/test-qapi-event.h :\
-$(SRC_PATH)/tests/qapi-schema/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-event.py $(qapi-py)
-	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-event.py \
-		$(gen-out-type) -o tests -p "test-" $<, \
-		"GEN","$@")
-tests/test-qmp-introspect.c tests/test-qmp-introspect.h :\
-$(SRC_PATH)/tests/qapi-schema/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-introspect.py $(qapi-py)
-	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-introspect.py \
-		$(gen-out-type) -o tests -p "test-" $<, \
-		"GEN","$@")
+tests/test-qapi-types.c tests/test-qapi-types.h \
+tests/test-qapi-visit.c tests/test-qapi-visit.h \
+tests/test-qmp-commands.h tests/test-qmp-marshal.c \
+tests/test-qapi-event.c tests/test-qapi-event.h \
+tests/test-qmp-introspect.c tests/test-qmp-introspect.h: \
+tests/test-qapi-gen-timestamp ;
+tests/test-qapi-gen-timestamp: $(SRC_PATH)/tests/qapi-schema/qapi-schema-test.json $(qapi-py)
+	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-gen.py \
+		-o tests -p "test-" $<, \
+		"GEN","$(@:%-timestamp=%)")
+	@>$@
 
-tests/qapi-schema/doc-good.test.texi: $(SRC_PATH)/tests/qapi-schema/doc-good.json $(SRC_PATH)/scripts/qapi2texi.py $(qapi-py)
-	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi2texi.py $< > $@,"GEN","$@")
+tests/qapi-schema/doc-good.test.texi: $(SRC_PATH)/tests/qapi-schema/doc-good.json $(qapi-py)
+	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-gen.py \
+		-o tests/qapi-schema -p "doc-good-" $<, \
+		"GEN","$@")
+	@mv tests/qapi-schema/doc-good-qapi.texi $@
+	@rm -f tests/qapi-schema/doc-good-qapi-*.[ch] tests/qapi-schema/doc-good-qmp-*.[ch]
 
 tests/test-string-output-visitor$(EXESUF): tests/test-string-output-visitor.o $(test-qapi-obj-y)
 tests/test-string-input-visitor$(EXESUF): tests/test-string-input-visitor.o $(test-qapi-obj-y)
@@ -937,6 +936,7 @@ check-clean:
 	$(MAKE) -C tests/tcg clean
 	rm -rf $(check-unit-y) tests/*.o $(QEMU_IOTESTS_HELPERS-y)
 	rm -rf $(sort $(foreach target,$(SYSEMU_TARGET_LIST), $(check-qtest-$(target)-y)) $(check-qtest-generic-y))
+	rm -f tests/test-qapi-gen-timestamp
 
 clean: check-clean
 
diff --git a/tests/qapi-schema/test-qapi.py b/tests/qapi-schema/test-qapi.py
index fe0ca08d78..7772d09919 100644
--- a/tests/qapi-schema/test-qapi.py
+++ b/tests/qapi-schema/test-qapi.py
@@ -10,7 +10,7 @@
 # See the COPYING file in the top-level directory.
 #
 
-from qapi import *
+from qapi.common import *
 from pprint import pprint
 import os
 import sys
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 87+ messages in thread

* [Qemu-devel] [PATCH RFC 07/21] qapi: Move parse_command_line() next to its only use
  2018-02-02 13:03 [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code Markus Armbruster
                   ` (5 preceding siblings ...)
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 06/21] qapi-gen: New common driver for code and doc generators Markus Armbruster
@ 2018-02-02 13:03 ` Markus Armbruster
  2018-02-02 19:29   ` Eric Blake
  2018-02-05 13:45   ` Marc-Andre Lureau
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 08/21] qapi: Touch generated files only when they change Markus Armbruster
                   ` (21 subsequent siblings)
  28 siblings, 2 replies; 87+ messages in thread
From: Markus Armbruster @ 2018-02-02 13:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: marcandre.lureau, eblake, mdroth

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 scripts/qapi-gen.py    | 52 +++++++++++++++++++++++++++++++++++++++++++++++-
 scripts/qapi/common.py | 54 --------------------------------------------------
 2 files changed, 51 insertions(+), 55 deletions(-)

diff --git a/scripts/qapi-gen.py b/scripts/qapi-gen.py
index 575c938a1b..6302fd0d55 100755
--- a/scripts/qapi-gen.py
+++ b/scripts/qapi-gen.py
@@ -4,8 +4,10 @@
 # This work is licensed under the terms of the GNU GPL, version 2 or later.
 # See the COPYING file in the top-level directory.
 
+import getopt
+import re
 import sys
-from qapi.common import parse_command_line, QAPISchema
+from qapi.common import QAPISchema
 from qapi.types import gen_types
 from qapi.visit import gen_visit
 from qapi.commands import gen_commands
@@ -14,6 +16,54 @@ from qapi.introspect import gen_introspect
 from qapi.doc import gen_doc
 
 
+def parse_command_line(extra_options='', extra_long_options=[]):
+
+    try:
+        opts, args = getopt.gnu_getopt(sys.argv[1:],
+                                       'chp:o:' + extra_options,
+                                       ['source', 'header', 'prefix=',
+                                        'output-dir='] + extra_long_options)
+    except getopt.GetoptError as err:
+        print >>sys.stderr, "%s: %s" % (sys.argv[0], str(err))
+        sys.exit(1)
+
+    output_dir = ''
+    prefix = ''
+    do_c = False
+    do_h = False
+    extra_opts = []
+
+    for oa in opts:
+        o, a = oa
+        if o in ('-p', '--prefix'):
+            match = re.match(r'([A-Za-z_.-][A-Za-z0-9_.-]*)?', a)
+            if match.end() != len(a):
+                print >>sys.stderr, \
+                    "%s: 'funny character '%s' in argument of --prefix" \
+                    % (sys.argv[0], a[match.end()])
+                sys.exit(1)
+            prefix = a
+        elif o in ('-o', '--output-dir'):
+            output_dir = a + '/'
+        elif o in ('-c', '--source'):
+            do_c = True
+        elif o in ('-h', '--header'):
+            do_h = True
+        else:
+            extra_opts.append(oa)
+
+    if not do_c and not do_h:
+        do_c = True
+        do_h = True
+
+    if len(args) != 1:
+        print >>sys.stderr, "%s: need exactly one argument" % sys.argv[0]
+        sys.exit(1)
+    fname = args[0]
+
+    return (fname, output_dir, do_c, do_h, prefix, extra_opts)
+
+
 def main(argv):
     (input_file, output_dir, do_c, do_h, prefix, opts) = \
         parse_command_line('bu', ['builtins', 'unmask-non-abi-names'])
diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py
index d73ef618e2..cfa2671ca3 100644
--- a/scripts/qapi/common.py
+++ b/scripts/qapi/common.py
@@ -12,7 +12,6 @@
 # See the COPYING file in the top-level directory.
 
 import errno
-import getopt
 import os
 import re
 import string
@@ -1917,59 +1916,6 @@ def build_params(arg_type, boxed, extra):
 
 
 #
-# Common command line parsing
-#
-
-
-def parse_command_line(extra_options='', extra_long_options=[]):
-
-    try:
-        opts, args = getopt.gnu_getopt(sys.argv[1:],
-                                       'chp:o:' + extra_options,
-                                       ['source', 'header', 'prefix=',
-                                        'output-dir='] + extra_long_options)
-    except getopt.GetoptError as err:
-        print >>sys.stderr, "%s: %s" % (sys.argv[0], str(err))
-        sys.exit(1)
-
-    output_dir = ''
-    prefix = ''
-    do_c = False
-    do_h = False
-    extra_opts = []
-
-    for oa in opts:
-        o, a = oa
-        if o in ('-p', '--prefix'):
-            match = re.match(r'([A-Za-z_.-][A-Za-z0-9_.-]*)?', a)
-            if match.end() != len(a):
-                print >>sys.stderr, \
-                    "%s: 'funny character '%s' in argument of --prefix" \
-                    % (sys.argv[0], a[match.end()])
-                sys.exit(1)
-            prefix = a
-        elif o in ('-o', '--output-dir'):
-            output_dir = a + '/'
-        elif o in ('-c', '--source'):
-            do_c = True
-        elif o in ('-h', '--header'):
-            do_h = True
-        else:
-            extra_opts.append(oa)
-
-    if not do_c and not do_h:
-        do_c = True
-        do_h = True
-
-    if len(args) != 1:
-        print >>sys.stderr, "%s: need exactly one argument" % sys.argv[0]
-        sys.exit(1)
-    fname = args[0]
-
-    return (fname, output_dir, do_c, do_h, prefix, extra_opts)
-
-
-#
 # Accumulate and write output
 #
 
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 87+ messages in thread

* [Qemu-devel] [PATCH RFC 08/21] qapi: Touch generated files only when they change
  2018-02-02 13:03 [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code Markus Armbruster
                   ` (6 preceding siblings ...)
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 07/21] qapi: Move parse_command_line() next to its only use Markus Armbruster
@ 2018-02-02 13:03 ` Markus Armbruster
  2018-02-02 19:42   ` Eric Blake
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 09/21] qapi: Don't absolutize include file name in error messages Markus Armbruster
                   ` (20 subsequent siblings)
  28 siblings, 1 reply; 87+ messages in thread
From: Markus Armbruster @ 2018-02-02 13:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: marcandre.lureau, eblake, mdroth

A massive number of objects depends on QAPI-generated headers.  In my
"build everything" tree, it's roughly 4500 out of 4800.  This is
particularly annoying when only some of the generated files change,
say for a doc fix.

Improve qapi-gen.py to touch its output files only if they actually
change.  Rebuild time for a QAPI doc fix drops from many minutes to a
few seconds.  Rebuilds get faster for certain code changes, too.  For
instance, adding a simple QMP event now recompiles less than 200
instead of 4500 objects.  But adding a QAPI type is as bad as ever; we
clearly got more work to do.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 scripts/qapi/common.py | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py
index cfa2671ca3..be0fcc548a 100644
--- a/scripts/qapi/common.py
+++ b/scripts/qapi/common.py
@@ -1944,9 +1944,16 @@ class QAPIGen(object):
             except os.error as e:
                 if e.errno != errno.EEXIST:
                     raise
-        f = open(os.path.join(output_dir, fname), 'w')
-        f.write(self.top(fname) + self._preamble + self._body
+        fd = os.open(os.path.join(output_dir, fname),
+                     os.O_RDWR | os.O_CREAT, 0666)
+        f = os.fdopen(fd, 'r+')
+        text = (self.top(fname) + self._preamble + self._body
                 + self.bottom(fname))
+        oldtext = f.read(len(text) + 1)
+        if text != oldtext:
+            f.seek(0)
+            f.truncate(0)
+            f.write(text)
         f.close()
 
 
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 87+ messages in thread

* [Qemu-devel] [PATCH RFC 09/21] qapi: Don't absolutize include file name in error messages
  2018-02-02 13:03 [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code Markus Armbruster
                   ` (7 preceding siblings ...)
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 08/21] qapi: Touch generated files only when they change Markus Armbruster
@ 2018-02-02 13:03 ` Markus Armbruster
  2018-02-02 20:22   ` Eric Blake
  2018-02-05 13:46   ` Marc-Andre Lureau
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 10/21] qapi/common: Eliminate QAPISchema.exprs Markus Armbruster
                   ` (19 subsequent siblings)
  28 siblings, 2 replies; 87+ messages in thread
From: Markus Armbruster @ 2018-02-02 13:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: marcandre.lureau, eblake, mdroth

Error messages print absolute filenames of included files even gave a
relative one on the command line:

     PYTHONPATH=scripts python -B tests/qapi-schema/test-qapi.py tests/qapi-schema/include-cycle.json
    In file included from tests/qapi-schema/include-cycle.json:1:
    In file included from /work/armbru/qemu/tests/qapi-schema/include-cycle-b.json:1:
    /work/armbru/qemu/tests/qapi-schema/include-cycle-c.json:1: Inclusion loop for include-cycle.json

Improve this to

    In file included from tests/qapi-schema/include-cycle.json:1:
    In file included from tests/qapi-schema/include-cycle-b.json:1:
    tests/qapi-schema/include-cycle-c.json:1: Inclusion loop for include-cycle.json

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 scripts/qapi/common.py                | 12 ++++++------
 tests/qapi-schema/include-no-file.err |  2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py
index be0fcc548a..6c6962a364 100644
--- a/scripts/qapi/common.py
+++ b/scripts/qapi/common.py
@@ -255,9 +255,8 @@ class QAPIDoc(object):
 class QAPISchemaParser(object):
 
     def __init__(self, fp, previously_included=[], incl_info=None):
-        abs_fname = os.path.abspath(fp.name)
         self.fname = fp.name
-        previously_included.append(abs_fname)
+        previously_included.append(os.path.abspath(fp.name))
         self.incl_info = incl_info
         self.src = fp.read()
         if self.src == '' or self.src[-1] != '\n':
@@ -288,7 +287,7 @@ class QAPISchemaParser(object):
                 if not isinstance(include, str):
                     raise QAPISemError(info,
                                        "Value of 'include' must be a string")
-                self._include(include, info, os.path.dirname(abs_fname),
+                self._include(include, info, os.path.dirname(self.fname),
                               previously_included)
             elif "pragma" in expr:
                 self.reject_expr_doc(cur_doc)
@@ -321,7 +320,8 @@ class QAPISchemaParser(object):
                 % doc.symbol)
 
     def _include(self, include, info, base_dir, previously_included):
-        incl_abs_fname = os.path.join(base_dir, include)
+        incl_fname = os.path.join(base_dir, include)
+        incl_abs_fname = os.path.abspath(incl_fname)
         # catch inclusion cycle
         inf = info
         while inf:
@@ -333,9 +333,9 @@ class QAPISchemaParser(object):
         if incl_abs_fname in previously_included:
             return
         try:
-            fobj = open(incl_abs_fname, 'r')
+            fobj = open(incl_fname, 'r')
         except IOError as e:
-            raise QAPISemError(info, '%s: %s' % (e.strerror, include))
+            raise QAPISemError(info, '%s: %s' % (e.strerror, incl_fname))
         exprs_include = QAPISchemaParser(fobj, previously_included, info)
         self.exprs.extend(exprs_include.exprs)
         self.docs.extend(exprs_include.docs)
diff --git a/tests/qapi-schema/include-no-file.err b/tests/qapi-schema/include-no-file.err
index d5b9b22d85..e42bcf4bc1 100644
--- a/tests/qapi-schema/include-no-file.err
+++ b/tests/qapi-schema/include-no-file.err
@@ -1 +1 @@
-tests/qapi-schema/include-no-file.json:1: No such file or directory: include-no-file-sub.json
+tests/qapi-schema/include-no-file.json:1: No such file or directory: tests/qapi-schema/include-no-file-sub.json
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 87+ messages in thread

* [Qemu-devel] [PATCH RFC 10/21] qapi/common: Eliminate QAPISchema.exprs
  2018-02-02 13:03 [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code Markus Armbruster
                   ` (8 preceding siblings ...)
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 09/21] qapi: Don't absolutize include file name in error messages Markus Armbruster
@ 2018-02-02 13:03 ` Markus Armbruster
  2018-02-02 22:02   ` Eric Blake
  2018-02-05 13:45   ` Marc-Andre Lureau
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 11/21] qapi: Lift error reporting from QAPISchema.__init__() to callers Markus Armbruster
                   ` (18 subsequent siblings)
  28 siblings, 2 replies; 87+ messages in thread
From: Markus Armbruster @ 2018-02-02 13:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: marcandre.lureau, eblake, mdroth

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 scripts/qapi/common.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py
index 6c6962a364..78e960d07c 100644
--- a/scripts/qapi/common.py
+++ b/scripts/qapi/common.py
@@ -1457,13 +1457,13 @@ class QAPISchema(object):
     def __init__(self, fname):
         try:
             parser = QAPISchemaParser(open(fname, 'r'))
-            self.exprs = check_exprs(parser.exprs)
+            exprs = check_exprs(parser.exprs)
             self.docs = parser.docs
             self._entity_dict = {}
             self._predefining = True
             self._def_predefineds()
             self._predefining = False
-            self._def_exprs()
+            self._def_exprs(exprs)
             self.check()
         except QAPIError as err:
             print >>sys.stderr, err
@@ -1648,8 +1648,8 @@ class QAPISchema(object):
                 name, info, doc, 'arg', self._make_members(data, info))
         self._def_entity(QAPISchemaEvent(name, info, doc, data, boxed))
 
-    def _def_exprs(self):
-        for expr_elem in self.exprs:
+    def _def_exprs(self, exprs):
+        for expr_elem in exprs:
             expr = expr_elem['expr']
             info = expr_elem['info']
             doc = expr_elem.get('doc')
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 87+ messages in thread

* [Qemu-devel] [PATCH RFC 11/21] qapi: Lift error reporting from QAPISchema.__init__() to callers
  2018-02-02 13:03 [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code Markus Armbruster
                   ` (9 preceding siblings ...)
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 10/21] qapi/common: Eliminate QAPISchema.exprs Markus Armbruster
@ 2018-02-02 13:03 ` Markus Armbruster
  2018-02-05 13:45   ` Marc-Andre Lureau
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 12/21] qapi: Concentrate QAPISchemaParser.exprs updates in .__init__() Markus Armbruster
                   ` (17 subsequent siblings)
  28 siblings, 1 reply; 87+ messages in thread
From: Markus Armbruster @ 2018-02-02 13:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: marcandre.lureau, eblake, mdroth

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 scripts/qapi-gen.py            |  8 ++++++--
 scripts/qapi/common.py         | 23 +++++++++--------------
 tests/qapi-schema/test-qapi.py |  8 +++++++-
 3 files changed, 22 insertions(+), 17 deletions(-)

diff --git a/scripts/qapi-gen.py b/scripts/qapi-gen.py
index 6302fd0d55..ba82ca92cc 100755
--- a/scripts/qapi-gen.py
+++ b/scripts/qapi-gen.py
@@ -7,7 +7,7 @@
 import getopt
 import re
 import sys
-from qapi.common import QAPISchema
+from qapi.common import QAPIError, QAPISchema
 from qapi.types import gen_types
 from qapi.visit import gen_visit
 from qapi.commands import gen_commands
@@ -77,7 +77,11 @@ def main(argv):
         if o in ('-u', '--unmask-non-abi-names'):
             opt_unmask = True
 
-    schema = QAPISchema(input_file)
+    try:
+        schema = QAPISchema(input_file)
+    except QAPIError as err:
+        print >>sys.stderr, err
+        exit(1)
 
     gen_types(schema, output_dir, prefix, opt_builtins)
     gen_visit(schema, output_dir, prefix, opt_builtins)
diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py
index 78e960d07c..d334e1db5a 100644
--- a/scripts/qapi/common.py
+++ b/scripts/qapi/common.py
@@ -15,7 +15,6 @@ import errno
 import os
 import re
 import string
-import sys
 from ordereddict import OrderedDict
 
 builtin_types = {
@@ -1455,19 +1454,15 @@ class QAPISchemaEvent(QAPISchemaEntity):
 
 class QAPISchema(object):
     def __init__(self, fname):
-        try:
-            parser = QAPISchemaParser(open(fname, 'r'))
-            exprs = check_exprs(parser.exprs)
-            self.docs = parser.docs
-            self._entity_dict = {}
-            self._predefining = True
-            self._def_predefineds()
-            self._predefining = False
-            self._def_exprs(exprs)
-            self.check()
-        except QAPIError as err:
-            print >>sys.stderr, err
-            exit(1)
+        parser = QAPISchemaParser(open(fname, 'r'))
+        exprs = check_exprs(parser.exprs)
+        self.docs = parser.docs
+        self._entity_dict = {}
+        self._predefining = True
+        self._def_predefineds()
+        self._predefining = False
+        self._def_exprs(exprs)
+        self.check()
 
     def _def_entity(self, ent):
         # Only the predefined types are allowed to not have info
diff --git a/tests/qapi-schema/test-qapi.py b/tests/qapi-schema/test-qapi.py
index 7772d09919..d6bb8ec6a4 100644
--- a/tests/qapi-schema/test-qapi.py
+++ b/tests/qapi-schema/test-qapi.py
@@ -53,7 +53,13 @@ class QAPISchemaTestVisitor(QAPISchemaVisitor):
             for v in variants.variants:
                 print '    case %s: %s' % (v.name, v.type.name)
 
-schema = QAPISchema(sys.argv[1])
+
+try:
+    schema = QAPISchema(sys.argv[1])
+except QAPIError as err:
+    print >>sys.stderr, err
+    exit(1)
+
 schema.visit(QAPISchemaTestVisitor())
 
 for doc in schema.docs:
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 87+ messages in thread

* [Qemu-devel] [PATCH RFC 12/21] qapi: Concentrate QAPISchemaParser.exprs updates in .__init__()
  2018-02-02 13:03 [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code Markus Armbruster
                   ` (10 preceding siblings ...)
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 11/21] qapi: Lift error reporting from QAPISchema.__init__() to callers Markus Armbruster
@ 2018-02-02 13:03 ` Markus Armbruster
  2018-02-05 13:45   ` Marc-Andre Lureau
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 13/21] qapi: Record 'include' directives in parse tree Markus Armbruster
                   ` (16 subsequent siblings)
  28 siblings, 1 reply; 87+ messages in thread
From: Markus Armbruster @ 2018-02-02 13:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: marcandre.lureau, eblake, mdroth

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 scripts/qapi/common.py | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py
index d334e1db5a..7a327bfe9f 100644
--- a/scripts/qapi/common.py
+++ b/scripts/qapi/common.py
@@ -286,8 +286,12 @@ class QAPISchemaParser(object):
                 if not isinstance(include, str):
                     raise QAPISemError(info,
                                        "Value of 'include' must be a string")
-                self._include(include, info, os.path.dirname(self.fname),
-                              previously_included)
+                exprs_include = self._include(include, info,
+                                              os.path.dirname(self.fname),
+                                              previously_included)
+                if exprs_include:
+                    self.exprs.extend(exprs_include.exprs)
+                    self.docs.extend(exprs_include.docs)
             elif "pragma" in expr:
                 self.reject_expr_doc(cur_doc)
                 if len(expr) != 1:
@@ -330,14 +334,13 @@ class QAPISchemaParser(object):
 
         # skip multiple include of the same file
         if incl_abs_fname in previously_included:
-            return
+            return None
+
         try:
             fobj = open(incl_fname, 'r')
         except IOError as e:
             raise QAPISemError(info, '%s: %s' % (e.strerror, incl_fname))
-        exprs_include = QAPISchemaParser(fobj, previously_included, info)
-        self.exprs.extend(exprs_include.exprs)
-        self.docs.extend(exprs_include.docs)
+        return QAPISchemaParser(fobj, previously_included, info)
 
     def _pragma(self, name, value, info):
         global doc_required, returns_whitelist, name_case_whitelist
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 87+ messages in thread

* [Qemu-devel] [PATCH RFC 13/21] qapi: Record 'include' directives in parse tree
  2018-02-02 13:03 [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code Markus Armbruster
                   ` (11 preceding siblings ...)
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 12/21] qapi: Concentrate QAPISchemaParser.exprs updates in .__init__() Markus Armbruster
@ 2018-02-02 13:03 ` Markus Armbruster
  2018-02-05 13:45   ` Marc-Andre Lureau
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 14/21] qapi: Generate in source order Markus Armbruster
                   ` (15 subsequent siblings)
  28 siblings, 1 reply; 87+ messages in thread
From: Markus Armbruster @ 2018-02-02 13:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: marcandre.lureau, eblake, mdroth

The parse tree is a list of expressions.  Except include expressions
currently get replaced by the included file's parse tree.

Instead of throwing away the include expression, keep it with the file
name expanded so you don't have to track the including file's
directory to make sense of it.

A future commit will put this include expression to use.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 scripts/qapi/common.py | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py
index 7a327bfe9f..d5b93e7381 100644
--- a/scripts/qapi/common.py
+++ b/scripts/qapi/common.py
@@ -286,8 +286,11 @@ class QAPISchemaParser(object):
                 if not isinstance(include, str):
                     raise QAPISemError(info,
                                        "Value of 'include' must be a string")
-                exprs_include = self._include(include, info,
-                                              os.path.dirname(self.fname),
+                incl_fname = os.path.join(os.path.dirname(self.fname),
+                                          include)
+                self.exprs.append({'expr': {'include': incl_fname},
+                                   'info': info})
+                exprs_include = self._include(include, info, incl_fname,
                                               previously_included)
                 if exprs_include:
                     self.exprs.extend(exprs_include.exprs)
@@ -322,8 +325,7 @@ class QAPISchemaParser(object):
                 "Documentation for '%s' is not followed by the definition"
                 % doc.symbol)
 
-    def _include(self, include, info, base_dir, previously_included):
-        incl_fname = os.path.join(base_dir, include)
+    def _include(self, include, info, incl_fname, previously_included):
         incl_abs_fname = os.path.abspath(incl_fname)
         # catch inclusion cycle
         inf = info
@@ -889,6 +891,9 @@ def check_exprs(exprs):
         info = expr_elem['info']
         doc = expr_elem.get('doc')
 
+        if 'include' in expr:
+            continue
+
         if not doc and doc_required:
             raise QAPISemError(info,
                                "Expression missing documentation comment")
@@ -927,6 +932,9 @@ def check_exprs(exprs):
 
     # Try again for hidden UnionKind enum
     for expr_elem in exprs:
+        if 'include' in expr:
+            continue
+
         expr = expr_elem['expr']
         if 'union' in expr and not discriminator_find_enum_define(expr):
             name = '%sKind' % expr['union']
@@ -939,6 +947,9 @@ def check_exprs(exprs):
 
     # Validate that exprs make sense
     for expr_elem in exprs:
+        if 'include' in expr:
+            continue
+
         expr = expr_elem['expr']
         info = expr_elem['info']
         doc = expr_elem.get('doc')
@@ -1663,6 +1674,8 @@ class QAPISchema(object):
                 self._def_command(expr, info, doc)
             elif 'event' in expr:
                 self._def_event(expr, info, doc)
+            elif 'include' in expr:
+                pass
             else:
                 assert False
 
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 87+ messages in thread

* [Qemu-devel] [PATCH RFC 14/21] qapi: Generate in source order
  2018-02-02 13:03 [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code Markus Armbruster
                   ` (12 preceding siblings ...)
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 13/21] qapi: Record 'include' directives in parse tree Markus Armbruster
@ 2018-02-02 13:03 ` Markus Armbruster
  2018-02-05 13:45   ` Marc-Andre Lureau
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 15/21] qapi: Record 'include' directives in intermediate representation Markus Armbruster
                   ` (14 subsequent siblings)
  28 siblings, 1 reply; 87+ messages in thread
From: Markus Armbruster @ 2018-02-02 13:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: marcandre.lureau, eblake, mdroth

The generators' conversion to visitors (merge commit 9e72681d16)
changed the processing order of entities from source order to
alphabetical order.  The next commit needs source order, so change it
back.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 scripts/qapi/common.py                   |   4 +-
 tests/qapi-schema/comments.out           |   2 +-
 tests/qapi-schema/doc-bad-section.out    |   4 +-
 tests/qapi-schema/doc-good.out           |  32 ++--
 tests/qapi-schema/empty.out              |   2 +-
 tests/qapi-schema/event-case.out         |   2 +-
 tests/qapi-schema/ident-with-escape.out  |   6 +-
 tests/qapi-schema/include-relpath.out    |   2 +-
 tests/qapi-schema/include-repetition.out |   2 +-
 tests/qapi-schema/include-simple.out     |   2 +-
 tests/qapi-schema/indented-expr.out      |   2 +-
 tests/qapi-schema/qapi-schema-test.out   | 320 +++++++++++++++----------------
 12 files changed, 191 insertions(+), 189 deletions(-)

diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py
index d5b93e7381..3b97bf8702 100644
--- a/scripts/qapi/common.py
+++ b/scripts/qapi/common.py
@@ -1471,6 +1471,7 @@ class QAPISchema(object):
         parser = QAPISchemaParser(open(fname, 'r'))
         exprs = check_exprs(parser.exprs)
         self.docs = parser.docs
+        self._entity_list = []
         self._entity_dict = {}
         self._predefining = True
         self._def_predefineds()
@@ -1482,6 +1483,7 @@ class QAPISchema(object):
         # Only the predefined types are allowed to not have info
         assert ent.info or self._predefining
         assert ent.name not in self._entity_dict
+        self._entity_list.append(ent)
         self._entity_dict[ent.name] = ent
 
     def lookup_entity(self, name, typ=None):
@@ -1685,7 +1687,7 @@ class QAPISchema(object):
 
     def visit(self, visitor):
         visitor.visit_begin(self)
-        for (name, entity) in sorted(self._entity_dict.items()):
+        for entity in self._entity_list:
             if visitor.visit_needed(entity):
                 entity.visit(visitor)
         visitor.visit_end()
diff --git a/tests/qapi-schema/comments.out b/tests/qapi-schema/comments.out
index 17e652535c..0261ddf202 100644
--- a/tests/qapi-schema/comments.out
+++ b/tests/qapi-schema/comments.out
@@ -1,4 +1,4 @@
+object q_empty
 enum QType ['none', 'qnull', 'qnum', 'qstring', 'qdict', 'qlist', 'qbool']
     prefix QTYPE
 enum Status ['good', 'bad', 'ugly']
-object q_empty
diff --git a/tests/qapi-schema/doc-bad-section.out b/tests/qapi-schema/doc-bad-section.out
index 089bde1381..23bf8c71ab 100644
--- a/tests/qapi-schema/doc-bad-section.out
+++ b/tests/qapi-schema/doc-bad-section.out
@@ -1,7 +1,7 @@
-enum Enum ['one', 'two']
+object q_empty
 enum QType ['none', 'qnull', 'qnum', 'qstring', 'qdict', 'qlist', 'qbool']
     prefix QTYPE
-object q_empty
+enum Enum ['one', 'two']
 doc symbol=Enum
     body=
 == Produces *invalid* texinfo
diff --git a/tests/qapi-schema/doc-good.out b/tests/qapi-schema/doc-good.out
index 1d2c250527..0c07301f07 100644
--- a/tests/qapi-schema/doc-good.out
+++ b/tests/qapi-schema/doc-good.out
@@ -1,35 +1,35 @@
+object q_empty
+enum QType ['none', 'qnull', 'qnum', 'qstring', 'qdict', 'qlist', 'qbool']
+    prefix QTYPE
+enum Enum ['one', 'two']
 object Base
     member base1: Enum optional=False
-enum Enum ['one', 'two']
+object Variant1
+    member var1: str optional=False
+object Variant2
 object Object
     base Base
     tag base1
     case one: Variant1
     case two: Variant2
-enum QType ['none', 'qnull', 'qnum', 'qstring', 'qdict', 'qlist', 'qbool']
-    prefix QTYPE
+object q_obj_Variant1-wrapper
+    member data: Variant1 optional=False
+object q_obj_Variant2-wrapper
+    member data: Variant2 optional=False
+enum SugaredUnionKind ['one', 'two']
 object SugaredUnion
     member type: SugaredUnionKind optional=False
     tag type
     case one: q_obj_Variant1-wrapper
     case two: q_obj_Variant2-wrapper
-enum SugaredUnionKind ['one', 'two']
-object Variant1
-    member var1: str optional=False
-object Variant2
-command cmd q_obj_cmd-arg -> Object
-   gen=True success_response=True boxed=False
-command cmd-boxed Object -> None
-   gen=True success_response=True boxed=True
-object q_empty
-object q_obj_Variant1-wrapper
-    member data: Variant1 optional=False
-object q_obj_Variant2-wrapper
-    member data: Variant2 optional=False
 object q_obj_cmd-arg
     member arg1: int optional=False
     member arg2: str optional=True
     member arg3: bool optional=False
+command cmd q_obj_cmd-arg -> Object
+   gen=True success_response=True boxed=False
+command cmd-boxed Object -> None
+   gen=True success_response=True boxed=True
 doc freeform
     body=
 = Section
diff --git a/tests/qapi-schema/empty.out b/tests/qapi-schema/empty.out
index 40b886ddae..0ec234eec4 100644
--- a/tests/qapi-schema/empty.out
+++ b/tests/qapi-schema/empty.out
@@ -1,3 +1,3 @@
+object q_empty
 enum QType ['none', 'qnull', 'qnum', 'qstring', 'qdict', 'qlist', 'qbool']
     prefix QTYPE
-object q_empty
diff --git a/tests/qapi-schema/event-case.out b/tests/qapi-schema/event-case.out
index 313c0fe7be..110571b793 100644
--- a/tests/qapi-schema/event-case.out
+++ b/tests/qapi-schema/event-case.out
@@ -1,5 +1,5 @@
+object q_empty
 enum QType ['none', 'qnull', 'qnum', 'qstring', 'qdict', 'qlist', 'qbool']
     prefix QTYPE
 event oops None
    boxed=False
-object q_empty
diff --git a/tests/qapi-schema/ident-with-escape.out b/tests/qapi-schema/ident-with-escape.out
index b5637cb2e0..8336aa7629 100644
--- a/tests/qapi-schema/ident-with-escape.out
+++ b/tests/qapi-schema/ident-with-escape.out
@@ -1,7 +1,7 @@
+object q_empty
 enum QType ['none', 'qnull', 'qnum', 'qstring', 'qdict', 'qlist', 'qbool']
     prefix QTYPE
-command fooA q_obj_fooA-arg -> None
-   gen=True success_response=True boxed=False
-object q_empty
 object q_obj_fooA-arg
     member bar1: str optional=False
+command fooA q_obj_fooA-arg -> None
+   gen=True success_response=True boxed=False
diff --git a/tests/qapi-schema/include-relpath.out b/tests/qapi-schema/include-relpath.out
index 17e652535c..0261ddf202 100644
--- a/tests/qapi-schema/include-relpath.out
+++ b/tests/qapi-schema/include-relpath.out
@@ -1,4 +1,4 @@
+object q_empty
 enum QType ['none', 'qnull', 'qnum', 'qstring', 'qdict', 'qlist', 'qbool']
     prefix QTYPE
 enum Status ['good', 'bad', 'ugly']
-object q_empty
diff --git a/tests/qapi-schema/include-repetition.out b/tests/qapi-schema/include-repetition.out
index 17e652535c..0261ddf202 100644
--- a/tests/qapi-schema/include-repetition.out
+++ b/tests/qapi-schema/include-repetition.out
@@ -1,4 +1,4 @@
+object q_empty
 enum QType ['none', 'qnull', 'qnum', 'qstring', 'qdict', 'qlist', 'qbool']
     prefix QTYPE
 enum Status ['good', 'bad', 'ugly']
-object q_empty
diff --git a/tests/qapi-schema/include-simple.out b/tests/qapi-schema/include-simple.out
index 17e652535c..0261ddf202 100644
--- a/tests/qapi-schema/include-simple.out
+++ b/tests/qapi-schema/include-simple.out
@@ -1,4 +1,4 @@
+object q_empty
 enum QType ['none', 'qnull', 'qnum', 'qstring', 'qdict', 'qlist', 'qbool']
     prefix QTYPE
 enum Status ['good', 'bad', 'ugly']
-object q_empty
diff --git a/tests/qapi-schema/indented-expr.out b/tests/qapi-schema/indented-expr.out
index 586795f44d..34de8be426 100644
--- a/tests/qapi-schema/indented-expr.out
+++ b/tests/qapi-schema/indented-expr.out
@@ -1,7 +1,7 @@
+object q_empty
 enum QType ['none', 'qnull', 'qnum', 'qstring', 'qdict', 'qlist', 'qbool']
     prefix QTYPE
 command eins None -> None
    gen=True success_response=True boxed=False
-object q_empty
 command zwei None -> None
    gen=True success_response=True boxed=False
diff --git a/tests/qapi-schema/qapi-schema-test.out b/tests/qapi-schema/qapi-schema-test.out
index 3b1e9082d3..50706b0136 100644
--- a/tests/qapi-schema/qapi-schema-test.out
+++ b/tests/qapi-schema/qapi-schema-test.out
@@ -1,87 +1,129 @@
-alternate AltEnumBool
-    tag type
-    case e: EnumOne
-    case b: bool
-alternate AltEnumInt
-    tag type
-    case e: EnumOne
-    case i: int
-alternate AltEnumNum
-    tag type
-    case e: EnumOne
-    case n: number
-alternate AltNumEnum
-    tag type
-    case n: number
-    case e: EnumOne
-alternate AltStrObj
-    tag type
-    case s: str
-    case o: TestStruct
-event EVENT_A None
-   boxed=False
-event EVENT_B None
-   boxed=False
-event EVENT_C q_obj_EVENT_C-arg
-   boxed=False
-event EVENT_D q_obj_EVENT_D-arg
-   boxed=False
-event EVENT_E UserDefZero
-   boxed=True
-event EVENT_F UserDefAlternate
-   boxed=True
+object q_empty
+enum QType ['none', 'qnull', 'qnum', 'qstring', 'qdict', 'qlist', 'qbool']
+    prefix QTYPE
+object TestStruct
+    member integer: int optional=False
+    member boolean: bool optional=False
+    member string: str optional=False
+object NestedEnumsOne
+    member enum1: EnumOne optional=False
+    member enum2: EnumOne optional=True
+    member enum3: EnumOne optional=False
+    member enum4: EnumOne optional=True
+enum MyEnum []
 object Empty1
 object Empty2
     base Empty1
+command user_def_cmd0 Empty2 -> Empty2
+   gen=True success_response=True boxed=False
+enum QEnumTwo ['value1', 'value2']
+    prefix QENUM_TWO
+object UserDefOne
+    base UserDefZero
+    member string: str optional=False
+    member enum1: EnumOne optional=True
 enum EnumOne ['value1', 'value2', 'value3']
-object EventStructOne
-    member struct1: UserDefOne optional=False
+object UserDefZero
+    member integer: int optional=False
+object UserDefTwoDictDict
+    member userdef: UserDefOne optional=False
     member string: str optional=False
-    member enum2: EnumOne optional=True
+object UserDefTwoDict
+    member string1: str optional=False
+    member dict2: UserDefTwoDictDict optional=False
+    member dict3: UserDefTwoDictDict optional=True
+object UserDefTwo
+    member string0: str optional=False
+    member dict1: UserDefTwoDict optional=False
 object ForceArrays
     member unused1: UserDefOneList optional=False
     member unused2: UserDefTwoList optional=False
     member unused3: TestStructList optional=False
-enum MyEnum []
-object NestedEnumsOne
-    member enum1: EnumOne optional=False
-    member enum2: EnumOne optional=True
-    member enum3: EnumOne optional=False
-    member enum4: EnumOne optional=True
-enum QEnumTwo ['value1', 'value2']
-    prefix QENUM_TWO
-enum QType ['none', 'qnull', 'qnum', 'qstring', 'qdict', 'qlist', 'qbool']
-    prefix QTYPE
-object TestStruct
-    member integer: int optional=False
-    member boolean: bool optional=False
-    member string: str optional=False
 object UserDefA
     member boolean: bool optional=False
     member a_b: int optional=True
-alternate UserDefAlternate
-    tag type
-    case udfu: UserDefFlatUnion
-    case e: EnumOne
-    case i: int
-    case n: null
 object UserDefB
     member intb: int optional=False
     member a-b: bool optional=True
-object UserDefC
-    member string1: str optional=False
-    member string2: str optional=False
 object UserDefFlatUnion
     base UserDefUnionBase
     tag enum1
     case value1: UserDefA
     case value2: UserDefB
     case value3: UserDefB
+object UserDefUnionBase
+    base UserDefZero
+    member string: str optional=False
+    member enum1: EnumOne optional=False
+object q_obj_UserDefFlatUnion2-base
+    member integer: int optional=True
+    member string: str optional=False
+    member enum1: QEnumTwo optional=False
 object UserDefFlatUnion2
     base q_obj_UserDefFlatUnion2-base
     tag enum1
     case value1: UserDefC
     case value2: UserDefB
+object WrapAlternate
+    member alt: UserDefAlternate optional=False
+alternate UserDefAlternate
+    tag type
+    case udfu: UserDefFlatUnion
+    case e: EnumOne
+    case i: int
+    case n: null
+object UserDefC
+    member string1: str optional=False
+    member string2: str optional=False
+alternate AltEnumBool
+    tag type
+    case e: EnumOne
+    case b: bool
+alternate AltEnumNum
+    tag type
+    case e: EnumOne
+    case n: number
+alternate AltNumEnum
+    tag type
+    case n: number
+    case e: EnumOne
+alternate AltEnumInt
+    tag type
+    case e: EnumOne
+    case i: int
+alternate AltStrObj
+    tag type
+    case s: str
+    case o: TestStruct
+object q_obj_intList-wrapper
+    member data: intList optional=False
+object q_obj_int8List-wrapper
+    member data: int8List optional=False
+object q_obj_int16List-wrapper
+    member data: int16List optional=False
+object q_obj_int32List-wrapper
+    member data: int32List optional=False
+object q_obj_int64List-wrapper
+    member data: int64List optional=False
+object q_obj_uint8List-wrapper
+    member data: uint8List optional=False
+object q_obj_uint16List-wrapper
+    member data: uint16List optional=False
+object q_obj_uint32List-wrapper
+    member data: uint32List optional=False
+object q_obj_uint64List-wrapper
+    member data: uint64List optional=False
+object q_obj_numberList-wrapper
+    member data: numberList optional=False
+object q_obj_boolList-wrapper
+    member data: boolList optional=False
+object q_obj_strList-wrapper
+    member data: strList optional=False
+object q_obj_sizeList-wrapper
+    member data: sizeList optional=False
+object q_obj_anyList-wrapper
+    member data: anyList optional=False
+enum UserDefNativeListUnionKind ['integer', 's8', 's16', 's32', 's64', 'u8', 'u16', 'u32', 'u64', 'number', 'boolean', 'string', 'sizes', 'any']
 object UserDefNativeListUnion
     member type: UserDefNativeListUnionKind optional=False
     tag type
@@ -99,133 +141,91 @@ object UserDefNativeListUnion
     case string: q_obj_strList-wrapper
     case sizes: q_obj_sizeList-wrapper
     case any: q_obj_anyList-wrapper
-enum UserDefNativeListUnionKind ['integer', 's8', 's16', 's32', 's64', 'u8', 'u16', 'u32', 'u64', 'number', 'boolean', 'string', 'sizes', 'any']
-object UserDefOne
-    base UserDefZero
-    member string: str optional=False
-    member enum1: EnumOne optional=True
+command user_def_cmd None -> None
+   gen=True success_response=True boxed=False
+object q_obj_user_def_cmd1-arg
+    member ud1a: UserDefOne optional=False
+command user_def_cmd1 q_obj_user_def_cmd1-arg -> None
+   gen=True success_response=True boxed=False
+object q_obj_user_def_cmd2-arg
+    member ud1a: UserDefOne optional=False
+    member ud1b: UserDefOne optional=True
+command user_def_cmd2 q_obj_user_def_cmd2-arg -> UserDefTwo
+   gen=True success_response=True boxed=False
+object q_obj_guest-get-time-arg
+    member a: int optional=False
+    member b: int optional=True
+command guest-get-time q_obj_guest-get-time-arg -> int
+   gen=True success_response=True boxed=False
+object q_obj_guest-sync-arg
+    member arg: any optional=False
+command guest-sync q_obj_guest-sync-arg -> any
+   gen=True success_response=True boxed=False
+command boxed-struct UserDefZero -> None
+   gen=True success_response=True boxed=True
+command boxed-union UserDefNativeListUnion -> None
+   gen=True success_response=True boxed=True
 object UserDefOptions
     member i64: intList optional=True
     member u64: uint64List optional=True
     member u16: uint16List optional=True
     member i64x: int optional=True
     member u64x: uint64 optional=True
-object UserDefTwo
-    member string0: str optional=False
-    member dict1: UserDefTwoDict optional=False
-object UserDefTwoDict
-    member string1: str optional=False
-    member dict2: UserDefTwoDictDict optional=False
-    member dict3: UserDefTwoDictDict optional=True
-object UserDefTwoDictDict
-    member userdef: UserDefOne optional=False
+object EventStructOne
+    member struct1: UserDefOne optional=False
     member string: str optional=False
-object UserDefUnionBase
-    base UserDefZero
-    member string: str optional=False
-    member enum1: EnumOne optional=False
-object UserDefZero
-    member integer: int optional=False
-object WrapAlternate
-    member alt: UserDefAlternate optional=False
-event __ORG.QEMU_X-EVENT __org.qemu_x-Struct
+    member enum2: EnumOne optional=True
+event EVENT_A None
+   boxed=False
+event EVENT_B None
+   boxed=False
+object q_obj_EVENT_C-arg
+    member a: int optional=True
+    member b: UserDefOne optional=True
+    member c: str optional=False
+event EVENT_C q_obj_EVENT_C-arg
+   boxed=False
+object q_obj_EVENT_D-arg
+    member a: EventStructOne optional=False
+    member b: str optional=False
+    member c: str optional=True
+    member enum3: EnumOne optional=True
+event EVENT_D q_obj_EVENT_D-arg
    boxed=False
-alternate __org.qemu_x-Alt
-    tag type
-    case __org.qemu_x-branch: str
-    case b: __org.qemu_x-Base
+event EVENT_E UserDefZero
+   boxed=True
+event EVENT_F UserDefAlternate
+   boxed=True
+enum __org.qemu_x-Enum ['__org.qemu_x-value']
 object __org.qemu_x-Base
     member __org.qemu_x-member1: __org.qemu_x-Enum optional=False
-enum __org.qemu_x-Enum ['__org.qemu_x-value']
 object __org.qemu_x-Struct
     base __org.qemu_x-Base
     member __org.qemu_x-member2: str optional=False
     member wchar-t: int optional=True
-object __org.qemu_x-Struct2
-    member array: __org.qemu_x-Union1List optional=False
+object q_obj_str-wrapper
+    member data: str optional=False
+enum __org.qemu_x-Union1Kind ['__org.qemu_x-branch']
 object __org.qemu_x-Union1
     member type: __org.qemu_x-Union1Kind optional=False
     tag type
     case __org.qemu_x-branch: q_obj_str-wrapper
-enum __org.qemu_x-Union1Kind ['__org.qemu_x-branch']
+object __org.qemu_x-Struct2
+    member array: __org.qemu_x-Union1List optional=False
 object __org.qemu_x-Union2
     base __org.qemu_x-Base
     tag __org.qemu_x-member1
     case __org.qemu_x-value: __org.qemu_x-Struct2
-command __org.qemu_x-command q_obj___org.qemu_x-command-arg -> __org.qemu_x-Union1
-   gen=True success_response=True boxed=False
-command boxed-struct UserDefZero -> None
-   gen=True success_response=True boxed=True
-command boxed-union UserDefNativeListUnion -> None
-   gen=True success_response=True boxed=True
-command guest-get-time q_obj_guest-get-time-arg -> int
-   gen=True success_response=True boxed=False
-command guest-sync q_obj_guest-sync-arg -> any
-   gen=True success_response=True boxed=False
-object q_empty
-object q_obj_EVENT_C-arg
-    member a: int optional=True
-    member b: UserDefOne optional=True
-    member c: str optional=False
-object q_obj_EVENT_D-arg
-    member a: EventStructOne optional=False
-    member b: str optional=False
-    member c: str optional=True
-    member enum3: EnumOne optional=True
-object q_obj_UserDefFlatUnion2-base
-    member integer: int optional=True
-    member string: str optional=False
-    member enum1: QEnumTwo optional=False
+alternate __org.qemu_x-Alt
+    tag type
+    case __org.qemu_x-branch: str
+    case b: __org.qemu_x-Base
+event __ORG.QEMU_X-EVENT __org.qemu_x-Struct
+   boxed=False
 object q_obj___org.qemu_x-command-arg
     member a: __org.qemu_x-EnumList optional=False
     member b: __org.qemu_x-StructList optional=False
     member c: __org.qemu_x-Union2 optional=False
     member d: __org.qemu_x-Alt optional=False
-object q_obj_anyList-wrapper
-    member data: anyList optional=False
-object q_obj_boolList-wrapper
-    member data: boolList optional=False
-object q_obj_guest-get-time-arg
-    member a: int optional=False
-    member b: int optional=True
-object q_obj_guest-sync-arg
-    member arg: any optional=False
-object q_obj_int16List-wrapper
-    member data: int16List optional=False
-object q_obj_int32List-wrapper
-    member data: int32List optional=False
-object q_obj_int64List-wrapper
-    member data: int64List optional=False
-object q_obj_int8List-wrapper
-    member data: int8List optional=False
-object q_obj_intList-wrapper
-    member data: intList optional=False
-object q_obj_numberList-wrapper
-    member data: numberList optional=False
-object q_obj_sizeList-wrapper
-    member data: sizeList optional=False
-object q_obj_str-wrapper
-    member data: str optional=False
-object q_obj_strList-wrapper
-    member data: strList optional=False
-object q_obj_uint16List-wrapper
-    member data: uint16List optional=False
-object q_obj_uint32List-wrapper
-    member data: uint32List optional=False
-object q_obj_uint64List-wrapper
-    member data: uint64List optional=False
-object q_obj_uint8List-wrapper
-    member data: uint8List optional=False
-object q_obj_user_def_cmd1-arg
-    member ud1a: UserDefOne optional=False
-object q_obj_user_def_cmd2-arg
-    member ud1a: UserDefOne optional=False
-    member ud1b: UserDefOne optional=True
-command user_def_cmd None -> None
-   gen=True success_response=True boxed=False
-command user_def_cmd0 Empty2 -> Empty2
-   gen=True success_response=True boxed=False
-command user_def_cmd1 q_obj_user_def_cmd1-arg -> None
-   gen=True success_response=True boxed=False
-command user_def_cmd2 q_obj_user_def_cmd2-arg -> UserDefTwo
+command __org.qemu_x-command q_obj___org.qemu_x-command-arg -> __org.qemu_x-Union1
    gen=True success_response=True boxed=False
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 87+ messages in thread

* [Qemu-devel] [PATCH RFC 15/21] qapi: Record 'include' directives in intermediate representation
  2018-02-02 13:03 [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code Markus Armbruster
                   ` (13 preceding siblings ...)
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 14/21] qapi: Generate in source order Markus Armbruster
@ 2018-02-02 13:03 ` Markus Armbruster
  2018-02-05 13:45   ` Marc-Andre Lureau
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 16/21] qapi/types qapi/visit: Make visitors use QAPIGen more Markus Armbruster
                   ` (13 subsequent siblings)
  28 siblings, 1 reply; 87+ messages in thread
From: Markus Armbruster @ 2018-02-02 13:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: marcandre.lureau, eblake, mdroth

The include directive permits modular QAPI schemata, but the generated
code is monolithic all the same.  To permit generating modular code,
the front end needs to pass more information on inclusions to the back
ends.  The commit before last added the necessary information to the
parse tree.  This commit adds it to the intermediate representation
and its QAPISchemaVisitor.  A later commit will use this to to
generate modular code.

New entity QAPISchemaInclude represents inclusions.  Call new visitor
method visit_include() for it, so visitors can see the sub-modules a
module includes.

New QAPISchemaEntity attribute @module names the entity's source file.
Call new visitor method visit_module() when it changes during a visit,
so visitors can keep track of the module being visited.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 scripts/qapi/common.py                   | 44 ++++++++++++++++++++++++++++----
 tests/qapi-schema/comments.out           |  1 +
 tests/qapi-schema/doc-bad-section.out    |  1 +
 tests/qapi-schema/doc-good.out           |  1 +
 tests/qapi-schema/event-case.out         |  1 +
 tests/qapi-schema/ident-with-escape.out  |  1 +
 tests/qapi-schema/include-relpath.out    |  5 ++++
 tests/qapi-schema/include-repetition.out | 10 ++++++++
 tests/qapi-schema/include-simple.out     |  3 +++
 tests/qapi-schema/indented-expr.out      |  1 +
 tests/qapi-schema/qapi-schema-test.out   |  1 +
 tests/qapi-schema/test-qapi.py           |  7 +++++
 12 files changed, 71 insertions(+), 5 deletions(-)

diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py
index 3b97bf8702..f4e9ebbb53 100644
--- a/scripts/qapi/common.py
+++ b/scripts/qapi/common.py
@@ -981,8 +981,9 @@ def check_exprs(exprs):
 
 class QAPISchemaEntity(object):
     def __init__(self, name, info, doc):
-        assert isinstance(name, str)
+        assert name is None or isinstance(name, str)
         self.name = name
+        self.module = None
         # For explicitly defined entities, info points to the (explicit)
         # definition.  For builtins (and their arrays), info is None.
         # For implicitly defined entities, info points to a place that
@@ -1011,10 +1012,16 @@ class QAPISchemaVisitor(object):
     def visit_end(self):
         pass
 
+    def visit_module(self, fname):
+        pass
+
     def visit_needed(self, entity):
         # Default to visiting everything
         return True
 
+    def visit_include(self, fname, info):
+        pass
+
     def visit_builtin_type(self, name, info, json_type):
         pass
 
@@ -1041,6 +1048,16 @@ class QAPISchemaVisitor(object):
         pass
 
 
+class QAPISchemaInclude(QAPISchemaEntity):
+
+    def __init__(self, fname, info):
+        QAPISchemaEntity.__init__(self, None, info, None)
+        self.fname = fname
+
+    def visit(self, visitor):
+        visitor.visit_include(self.fname, self.info)
+
+
 class QAPISchemaType(QAPISchemaEntity):
     # Return the C type for common use.
     # For the types we commonly box, this is a pointer type.
@@ -1468,6 +1485,7 @@ class QAPISchemaEvent(QAPISchemaEntity):
 
 class QAPISchema(object):
     def __init__(self, fname):
+        self._fname = fname
         parser = QAPISchemaParser(open(fname, 'r'))
         exprs = check_exprs(parser.exprs)
         self.docs = parser.docs
@@ -1475,16 +1493,19 @@ class QAPISchema(object):
         self._entity_dict = {}
         self._predefining = True
         self._def_predefineds()
-        self._predefining = False
         self._def_exprs(exprs)
         self.check()
 
     def _def_entity(self, ent):
         # Only the predefined types are allowed to not have info
         assert ent.info or self._predefining
-        assert ent.name not in self._entity_dict
+        assert ent.name is None or ent.name not in self._entity_dict
         self._entity_list.append(ent)
-        self._entity_dict[ent.name] = ent
+        if ent.name is not None:
+            self._entity_dict[ent.name] = ent
+        if ent.info:
+            ent.module = os.path.relpath(ent.info['file'],
+                                         os.path.dirname(self._fname))
 
     def lookup_entity(self, name, typ=None):
         ent = self._entity_dict.get(name)
@@ -1495,6 +1516,15 @@ class QAPISchema(object):
     def lookup_type(self, name):
         return self.lookup_entity(name, QAPISchemaType)
 
+    def _def_include(self, expr, info, doc):
+        include = expr['include']
+        assert doc is None
+        main_info = info
+        while main_info['parent']:
+            main_info = main_info['parent']
+        fname = os.path.relpath(include, os.path.dirname(main_info['file']))
+        self._def_entity(QAPISchemaInclude(fname, info))
+
     def _def_builtin_type(self, name, json_type, c_type):
         self._def_entity(QAPISchemaBuiltinType(name, json_type, c_type))
         # TODO As long as we have QAPI_TYPES_BUILTIN to share multiple
@@ -1677,7 +1707,7 @@ class QAPISchema(object):
             elif 'event' in expr:
                 self._def_event(expr, info, doc)
             elif 'include' in expr:
-                pass
+                self._def_include(expr, info, doc)
             else:
                 assert False
 
@@ -1687,8 +1717,12 @@ class QAPISchema(object):
 
     def visit(self, visitor):
         visitor.visit_begin(self)
+        module = None
         for entity in self._entity_list:
             if visitor.visit_needed(entity):
+                if entity.module != module:
+                    module = entity.module
+                    visitor.visit_module(module)
                 entity.visit(visitor)
         visitor.visit_end()
 
diff --git a/tests/qapi-schema/comments.out b/tests/qapi-schema/comments.out
index 0261ddf202..8d2f1ce8a2 100644
--- a/tests/qapi-schema/comments.out
+++ b/tests/qapi-schema/comments.out
@@ -1,4 +1,5 @@
 object q_empty
 enum QType ['none', 'qnull', 'qnum', 'qstring', 'qdict', 'qlist', 'qbool']
     prefix QTYPE
+module comments.json
 enum Status ['good', 'bad', 'ugly']
diff --git a/tests/qapi-schema/doc-bad-section.out b/tests/qapi-schema/doc-bad-section.out
index 23bf8c71ab..cd28721568 100644
--- a/tests/qapi-schema/doc-bad-section.out
+++ b/tests/qapi-schema/doc-bad-section.out
@@ -1,6 +1,7 @@
 object q_empty
 enum QType ['none', 'qnull', 'qnum', 'qstring', 'qdict', 'qlist', 'qbool']
     prefix QTYPE
+module doc-bad-section.json
 enum Enum ['one', 'two']
 doc symbol=Enum
     body=
diff --git a/tests/qapi-schema/doc-good.out b/tests/qapi-schema/doc-good.out
index 0c07301f07..430b5a87db 100644
--- a/tests/qapi-schema/doc-good.out
+++ b/tests/qapi-schema/doc-good.out
@@ -1,6 +1,7 @@
 object q_empty
 enum QType ['none', 'qnull', 'qnum', 'qstring', 'qdict', 'qlist', 'qbool']
     prefix QTYPE
+module doc-good.json
 enum Enum ['one', 'two']
 object Base
     member base1: Enum optional=False
diff --git a/tests/qapi-schema/event-case.out b/tests/qapi-schema/event-case.out
index 110571b793..88c0964917 100644
--- a/tests/qapi-schema/event-case.out
+++ b/tests/qapi-schema/event-case.out
@@ -1,5 +1,6 @@
 object q_empty
 enum QType ['none', 'qnull', 'qnum', 'qstring', 'qdict', 'qlist', 'qbool']
     prefix QTYPE
+module event-case.json
 event oops None
    boxed=False
diff --git a/tests/qapi-schema/ident-with-escape.out b/tests/qapi-schema/ident-with-escape.out
index 8336aa7629..ee3b34e623 100644
--- a/tests/qapi-schema/ident-with-escape.out
+++ b/tests/qapi-schema/ident-with-escape.out
@@ -1,6 +1,7 @@
 object q_empty
 enum QType ['none', 'qnull', 'qnum', 'qstring', 'qdict', 'qlist', 'qbool']
     prefix QTYPE
+module ident-with-escape.json
 object q_obj_fooA-arg
     member bar1: str optional=False
 command fooA q_obj_fooA-arg -> None
diff --git a/tests/qapi-schema/include-relpath.out b/tests/qapi-schema/include-relpath.out
index 0261ddf202..ebbabd7a18 100644
--- a/tests/qapi-schema/include-relpath.out
+++ b/tests/qapi-schema/include-relpath.out
@@ -1,4 +1,9 @@
 object q_empty
 enum QType ['none', 'qnull', 'qnum', 'qstring', 'qdict', 'qlist', 'qbool']
     prefix QTYPE
+module include-relpath.json
+include include/relpath.json
+module include/relpath.json
+include include-relpath-sub.json
+module include-relpath-sub.json
 enum Status ['good', 'bad', 'ugly']
diff --git a/tests/qapi-schema/include-repetition.out b/tests/qapi-schema/include-repetition.out
index 0261ddf202..7235e055bc 100644
--- a/tests/qapi-schema/include-repetition.out
+++ b/tests/qapi-schema/include-repetition.out
@@ -1,4 +1,14 @@
 object q_empty
 enum QType ['none', 'qnull', 'qnum', 'qstring', 'qdict', 'qlist', 'qbool']
     prefix QTYPE
+module include-repetition.json
+include comments.json
+module comments.json
 enum Status ['good', 'bad', 'ugly']
+module include-repetition.json
+include include-repetition-sub.json
+module include-repetition-sub.json
+include comments.json
+include comments.json
+module include-repetition.json
+include comments.json
diff --git a/tests/qapi-schema/include-simple.out b/tests/qapi-schema/include-simple.out
index 0261ddf202..006f723eeb 100644
--- a/tests/qapi-schema/include-simple.out
+++ b/tests/qapi-schema/include-simple.out
@@ -1,4 +1,7 @@
 object q_empty
 enum QType ['none', 'qnull', 'qnum', 'qstring', 'qdict', 'qlist', 'qbool']
     prefix QTYPE
+module include-simple.json
+include include-simple-sub.json
+module include-simple-sub.json
 enum Status ['good', 'bad', 'ugly']
diff --git a/tests/qapi-schema/indented-expr.out b/tests/qapi-schema/indented-expr.out
index 34de8be426..a79935e8c3 100644
--- a/tests/qapi-schema/indented-expr.out
+++ b/tests/qapi-schema/indented-expr.out
@@ -1,6 +1,7 @@
 object q_empty
 enum QType ['none', 'qnull', 'qnum', 'qstring', 'qdict', 'qlist', 'qbool']
     prefix QTYPE
+module indented-expr.json
 command eins None -> None
    gen=True success_response=True boxed=False
 command zwei None -> None
diff --git a/tests/qapi-schema/qapi-schema-test.out b/tests/qapi-schema/qapi-schema-test.out
index 50706b0136..012e7fc06a 100644
--- a/tests/qapi-schema/qapi-schema-test.out
+++ b/tests/qapi-schema/qapi-schema-test.out
@@ -1,6 +1,7 @@
 object q_empty
 enum QType ['none', 'qnull', 'qnum', 'qstring', 'qdict', 'qlist', 'qbool']
     prefix QTYPE
+module qapi-schema-test.json
 object TestStruct
     member integer: int optional=False
     member boolean: bool optional=False
diff --git a/tests/qapi-schema/test-qapi.py b/tests/qapi-schema/test-qapi.py
index d6bb8ec6a4..2027eef3e5 100644
--- a/tests/qapi-schema/test-qapi.py
+++ b/tests/qapi-schema/test-qapi.py
@@ -17,6 +17,13 @@ import sys
 
 
 class QAPISchemaTestVisitor(QAPISchemaVisitor):
+
+    def visit_module(self, name):
+        print 'module %s' % name
+
+    def visit_include(self, name, info):
+        print 'include %s' % name
+
     def visit_enum_type(self, name, info, values, prefix):
         print 'enum %s %s' % (name, values)
         if prefix:
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 87+ messages in thread

* [Qemu-devel] [PATCH RFC 16/21] qapi/types qapi/visit: Make visitors use QAPIGen more
  2018-02-02 13:03 [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code Markus Armbruster
                   ` (14 preceding siblings ...)
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 15/21] qapi: Record 'include' directives in intermediate representation Markus Armbruster
@ 2018-02-02 13:03 ` Markus Armbruster
  2018-02-05 13:46   ` Marc-Andre Lureau
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 17/21] qapi/types qapi/visit: Generate built-in stuff into separate files Markus Armbruster
                   ` (12 subsequent siblings)
  28 siblings, 1 reply; 87+ messages in thread
From: Markus Armbruster @ 2018-02-02 13:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: marcandre.lureau, eblake, mdroth

The conversion is rather shallow so far: most of the output
accumulation is not converted.  Take the next step: convert output
accumulation in QAPISchemaGenTypeVisitor and
QAPISchemaGenVisitVisitor.  Helper functions outside these classes are
not converted.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 scripts/qapi/types.py | 83 +++++++++++++++++++++++----------------------------
 scripts/qapi/visit.py | 83 +++++++++++++++++++++++----------------------------
 2 files changed, 74 insertions(+), 92 deletions(-)

diff --git a/scripts/qapi/types.py b/scripts/qapi/types.py
index b2095120e0..eeffcbf32c 100644
--- a/scripts/qapi/types.py
+++ b/scripts/qapi/types.py
@@ -168,35 +168,44 @@ void qapi_free_%(c_name)s(%(c_name)s *obj)
 
 
 class QAPISchemaGenTypeVisitor(QAPISchemaVisitor):
-    def __init__(self, opt_builtins):
+    def __init__(self, opt_builtins, prefix):
         self._opt_builtins = opt_builtins
-        self.decl = None
-        self.defn = None
-        self._fwdecl = None
-        self._btin = None
+        self._prefix = prefix
+        blurb = ' * Schema-defined QAPI types'
+        self._genc = QAPIGenC(blurb, __doc__)
+        self._genh = QAPIGenH(blurb, __doc__)
+        self._genc.preamble(mcgen('''
+#include "qemu/osdep.h"
+#include "qapi/dealloc-visitor.h"
+#include "%(prefix)sqapi-types.h"
+#include "%(prefix)sqapi-visit.h"
+''',
+                                  prefix=prefix))
+        self._genh.preamble(mcgen('''
+#include "qapi/util.h"
+'''))
+        self._btin = '\n' + guardstart('QAPI_TYPES_BUILTIN')
+
+    def write(self, output_dir):
+        self._genc.write(output_dir, self._prefix + 'qapi-types.c')
+        self._genh.write(output_dir, self._prefix + 'qapi-types.h')
 
     def visit_begin(self, schema):
         # gen_object() is recursive, ensure it doesn't visit the empty type
         objects_seen.add(schema.the_empty_object_type.name)
-        self.decl = ''
-        self.defn = ''
-        self._fwdecl = ''
-        self._btin = '\n' + guardstart('QAPI_TYPES_BUILTIN')
 
     def visit_end(self):
-        self.decl = self._fwdecl + self.decl
-        self._fwdecl = None
         # To avoid header dependency hell, we always generate
         # declarations for built-in types in our header files and
         # simply guard them.  See also opt_builtins (command line
         # option -b).
         self._btin += guardend('QAPI_TYPES_BUILTIN')
-        self.decl = self._btin + self.decl
+        self._genh.preamble(self._btin)
         self._btin = None
 
     def _gen_type_cleanup(self, name):
-        self.decl += gen_type_cleanup_decl(name)
-        self.defn += gen_type_cleanup(name)
+        self._genh.body(gen_type_cleanup_decl(name))
+        self._genc.body(gen_type_cleanup(name))
 
     def visit_enum_type(self, name, info, values, prefix):
         # Special case for our lone builtin enum type
@@ -204,10 +213,10 @@ class QAPISchemaGenTypeVisitor(QAPISchemaVisitor):
         if not info:
             self._btin += gen_enum(name, values, prefix)
             if self._opt_builtins:
-                self.defn += gen_enum_lookup(name, values, prefix)
+                self._genc.body(gen_enum_lookup(name, values, prefix))
         else:
-            self._fwdecl += gen_enum(name, values, prefix)
-            self.defn += gen_enum_lookup(name, values, prefix)
+            self._genh.preamble(gen_enum(name, values, prefix))
+            self._genc.body(gen_enum_lookup(name, values, prefix))
 
     def visit_array_type(self, name, info, element_type):
         if isinstance(element_type, QAPISchemaBuiltinType):
@@ -215,20 +224,20 @@ class QAPISchemaGenTypeVisitor(QAPISchemaVisitor):
             self._btin += gen_array(name, element_type)
             self._btin += gen_type_cleanup_decl(name)
             if self._opt_builtins:
-                self.defn += gen_type_cleanup(name)
+                self._genc.body(gen_type_cleanup(name))
         else:
-            self._fwdecl += gen_fwd_object_or_array(name)
-            self.decl += gen_array(name, element_type)
+            self._genh.preamble(gen_fwd_object_or_array(name))
+            self._genh.body(gen_array(name, element_type))
             self._gen_type_cleanup(name)
 
     def visit_object_type(self, name, info, base, members, variants):
         # Nothing to do for the special empty builtin
         if name == 'q_empty':
             return
-        self._fwdecl += gen_fwd_object_or_array(name)
-        self.decl += gen_object(name, base, members, variants)
+        self._genh.preamble(gen_fwd_object_or_array(name))
+        self._genh.body(gen_object(name, base, members, variants))
         if base and not base.is_implicit():
-            self.decl += gen_upcast(name, base)
+            self._genh.body(gen_upcast(name, base))
         # TODO Worth changing the visitor signature, so we could
         # directly use rather than repeat type.is_implicit()?
         if not name.startswith('q_'):
@@ -236,31 +245,13 @@ class QAPISchemaGenTypeVisitor(QAPISchemaVisitor):
             self._gen_type_cleanup(name)
 
     def visit_alternate_type(self, name, info, variants):
-        self._fwdecl += gen_fwd_object_or_array(name)
-        self.decl += gen_object(name, None, [variants.tag_member], variants)
+        self._genh.preamble(gen_fwd_object_or_array(name))
+        self._genh.body(gen_object(name, None,
+                                   [variants.tag_member], variants))
         self._gen_type_cleanup(name)
 
 
 def gen_types(schema, output_dir, prefix, opt_builtins):
-    blurb = ' * Schema-defined QAPI types'
-    genc = QAPIGenC(blurb, __doc__)
-    genh = QAPIGenH(blurb, __doc__)
-
-    genc.body(mcgen('''
-#include "qemu/osdep.h"
-#include "qapi/dealloc-visitor.h"
-#include "%(prefix)sqapi-types.h"
-#include "%(prefix)sqapi-visit.h"
-''',
-                    prefix=prefix))
-
-    genh.body(mcgen('''
-#include "qapi/util.h"
-'''))
-
-    vis = QAPISchemaGenTypeVisitor(opt_builtins)
+    vis = QAPISchemaGenTypeVisitor(opt_builtins, prefix)
     schema.visit(vis)
-    genc.body(vis.defn)
-    genh.body(vis.decl)
-    genc.write(output_dir, prefix + 'qapi-types.c')
-    genh.write(output_dir, prefix + 'qapi-types.h')
+    vis.write(output_dir)
diff --git a/scripts/qapi/visit.py b/scripts/qapi/visit.py
index 80c0b85f8c..ee1a849574 100644
--- a/scripts/qapi/visit.py
+++ b/scripts/qapi/visit.py
@@ -264,24 +264,38 @@ out:
 
 
 class QAPISchemaGenVisitVisitor(QAPISchemaVisitor):
-    def __init__(self, opt_builtins):
+    def __init__(self, opt_builtins, prefix):
         self._opt_builtins = opt_builtins
-        self.decl = None
-        self.defn = None
-        self._btin = None
-
-    def visit_begin(self, schema):
-        self.decl = ''
-        self.defn = ''
+        self._prefix = prefix
+        blurb = ' * Schema-defined QAPI visitors'
+        self._genc = QAPIGenC(blurb, __doc__)
+        self._genh = QAPIGenH(blurb, __doc__)
+        self._genc.preamble(mcgen('''
+#include "qemu/osdep.h"
+#include "qemu-common.h"
+#include "qapi/error.h"
+#include "%(prefix)sqapi-visit.h"
+''',
+                                  prefix=prefix))
+        self._genh.preamble(mcgen('''
+#include "qapi/visitor.h"
+#include "qapi/qmp/qerror.h"
+#include "%(prefix)sqapi-types.h"
+''',
+                                  prefix=prefix))
         self._btin = guardstart('QAPI_VISIT_BUILTIN')
 
+    def write(self, output_dir):
+        self._genc.write(output_dir, self._prefix + 'qapi-visit.c')
+        self._genh.write(output_dir, self._prefix + 'qapi-visit.h')
+
     def visit_end(self):
         # To avoid header dependency hell, we always generate
         # declarations for built-in types in our header files and
         # simply guard them.  See also opt_builtins (command line
         # option -b).
         self._btin += guardend('QAPI_VISIT_BUILTIN')
-        self.decl = self._btin + self.decl
+        self._genh.preamble(self._btin)
         self._btin = None
 
     def visit_enum_type(self, name, info, values, prefix):
@@ -290,10 +304,10 @@ class QAPISchemaGenVisitVisitor(QAPISchemaVisitor):
         if not info:
             self._btin += gen_visit_decl(name, scalar=True)
             if self._opt_builtins:
-                self.defn += gen_visit_enum(name)
+                self._genc.body(gen_visit_enum(name))
         else:
-            self.decl += gen_visit_decl(name, scalar=True)
-            self.defn += gen_visit_enum(name)
+            self._genh.body(gen_visit_decl(name, scalar=True))
+            self._genc.body(gen_visit_enum(name))
 
     def visit_array_type(self, name, info, element_type):
         decl = gen_visit_decl(name)
@@ -301,53 +315,30 @@ class QAPISchemaGenVisitVisitor(QAPISchemaVisitor):
         if isinstance(element_type, QAPISchemaBuiltinType):
             self._btin += decl
             if self._opt_builtins:
-                self.defn += defn
+                self._genc.body(defn)
         else:
-            self.decl += decl
-            self.defn += defn
+            self._genh.body(decl)
+            self._genc.body(defn)
 
     def visit_object_type(self, name, info, base, members, variants):
         # Nothing to do for the special empty builtin
         if name == 'q_empty':
             return
-        self.decl += gen_visit_members_decl(name)
-        self.defn += gen_visit_object_members(name, base, members, variants)
+        self._genh.body(gen_visit_members_decl(name))
+        self._genc.body(gen_visit_object_members(name, base, members, variants))
         # TODO Worth changing the visitor signature, so we could
         # directly use rather than repeat type.is_implicit()?
         if not name.startswith('q_'):
             # only explicit types need an allocating visit
-            self.decl += gen_visit_decl(name)
-            self.defn += gen_visit_object(name, base, members, variants)
+            self._genh.body(gen_visit_decl(name))
+            self._genc.body(gen_visit_object(name, base, members, variants))
 
     def visit_alternate_type(self, name, info, variants):
-        self.decl += gen_visit_decl(name)
-        self.defn += gen_visit_alternate(name, variants)
+        self._genh.body(gen_visit_decl(name))
+        self._genc.body(gen_visit_alternate(name, variants))
 
 
 def gen_visit(schema, output_dir, prefix, opt_builtins):
-    blurb = ' * Schema-defined QAPI visitors'
-    genc = QAPIGenC(blurb, __doc__)
-    genh = QAPIGenH(blurb, __doc__)
-
-    genc.body(mcgen('''
-#include "qemu/osdep.h"
-#include "qemu-common.h"
-#include "qapi/error.h"
-#include "%(prefix)sqapi-visit.h"
-''',
-                    prefix=prefix))
-
-    genh.body(mcgen('''
-#include "qapi/visitor.h"
-#include "qapi/qmp/qerror.h"
-#include "%(prefix)sqapi-types.h"
-
-''',
-                    prefix=prefix))
-
-    vis = QAPISchemaGenVisitVisitor(opt_builtins)
+    vis = QAPISchemaGenVisitVisitor(opt_builtins, prefix)
     schema.visit(vis)
-    genc.body(vis.defn)
-    genh.body(vis.decl)
-    genc.write(output_dir, prefix + 'qapi-visit.c')
-    genh.write(output_dir, prefix + 'qapi-visit.h')
+    vis.write(output_dir)
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 87+ messages in thread

* [Qemu-devel] [PATCH RFC 17/21] qapi/types qapi/visit: Generate built-in stuff into separate files
  2018-02-02 13:03 [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code Markus Armbruster
                   ` (15 preceding siblings ...)
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 16/21] qapi/types qapi/visit: Make visitors use QAPIGen more Markus Armbruster
@ 2018-02-02 13:03 ` Markus Armbruster
  2018-02-05 13:46   ` Marc-Andre Lureau
  2018-02-06 20:54   ` Eric Blake
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 18/21] qapi/common: Fix guardname() for funny filenames Markus Armbruster
                   ` (11 subsequent siblings)
  28 siblings, 2 replies; 87+ messages in thread
From: Markus Armbruster @ 2018-02-02 13:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: marcandre.lureau, eblake, mdroth

Linking code from multiple separate QAPI schemata into the same
program is possible, but involves some weirdness around built-in
types:

* We generate code for built-in types into .c only with option
  --builtins.  The user is responsible to generate code for exactly
  one QAPI schema per program with --builtins.

* We generate code for them it into .h regardless of --builtins,
  guarded by #ifndef QAPI_VISIT_BUILTIN.  Because the code for
  built-in types is exactly the same in all of them, including any
  combination of these headers works.

Replace this contraption by something more conventional: generate code
for built-in types into their very own files: qapi-builtin-types.c,
qapi-builtin-visit.c, qapi-builtin-types.h, qapi-builtin-visit.h, but
only with --builtins.  Obey --output-dir, but ignore --prefix for
them.

Make qapi-types.h include qapi-builtin-types.h.  With multiple
schemata you now have multiple qapi-types.[ch], but only one
qapi-builtin-types.[ch].  Same for qapi-visit.[ch] and
qapi-builtin-visit.[ch].

Bonus: if all you need is built-in stuff, you can include a much
smaller header.  To be exploited shortly.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 Makefile               | 13 +++++---
 Makefile.objs          |  1 +
 scripts/qapi/common.py | 18 +++++------
 scripts/qapi/types.py  | 82 ++++++++++++++++++++++++++----------------------
 scripts/qapi/visit.py  | 84 ++++++++++++++++++++++++++++----------------------
 5 files changed, 111 insertions(+), 87 deletions(-)

diff --git a/Makefile b/Makefile
index e02f0c13ef..f9b7900330 100644
--- a/Makefile
+++ b/Makefile
@@ -88,10 +88,13 @@ endif
 include $(SRC_PATH)/rules.mak
 
 GENERATED_FILES = qemu-version.h config-host.h qemu-options.def
-GENERATED_FILES += qmp-commands.h qapi-types.h qapi-visit.h qapi-event.h
-GENERATED_FILES += qmp-marshal.c qapi-types.c qapi-visit.c qapi-event.c
-GENERATED_FILES += qmp-introspect.h
-GENERATED_FILES += qmp-introspect.c
+GENERATED_FILES += qmp-commands.h qmp-marshal.c
+GENERATED_FILES += qapi-builtin-types.h qapi-builtin-types.c
+GENERATED_FILES += qapi-types.h qapi-types.c
+GENERATED_FILES += qapi-builtin-visit.h qapi-builtin-visit.c
+GENERATED_FILES += qapi-visit.h qapi-visit.c
+GENERATED_FILES += qapi-event.h qapi-event.c
+GENERATED_FILES += qmp-introspect.c qmp-introspect.h
 GENERATED_FILES += qapi.texi
 
 GENERATED_FILES += trace/generated-tcg-tracers.h
@@ -514,7 +517,9 @@ qapi-modules = $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/qapi/common.json \
                $(SRC_PATH)/qapi/transaction.json \
                $(SRC_PATH)/qapi/ui.json
 
+qapi-builtin-types.c qapi-builtin-types.h \
 qapi-types.c qapi-types.h \
+qapi-builtin-visit.c qapi-builtin-visit.h \
 qapi-visit.c qapi-visit.h \
 qmp-commands.h qmp-marshal.c \
 qapi-event.c qapi-event.h \
diff --git a/Makefile.objs b/Makefile.objs
index 323ef12384..f16cca06e7 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -2,6 +2,7 @@
 # Common libraries for tools and emulators
 stub-obj-y = stubs/ crypto/
 util-obj-y = util/ qobject/ qapi/
+util-obj-y += qapi-builtin-types.o qapi-builtin-visit.o
 util-obj-y += qmp-introspect.o qapi-types.o qapi-visit.o qapi-event.o
 
 chardev-obj-y = chardev/
diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py
index f4e9ebbb53..7ffffc78d9 100644
--- a/scripts/qapi/common.py
+++ b/scripts/qapi/common.py
@@ -1527,11 +1527,10 @@ class QAPISchema(object):
 
     def _def_builtin_type(self, name, json_type, c_type):
         self._def_entity(QAPISchemaBuiltinType(name, json_type, c_type))
-        # TODO As long as we have QAPI_TYPES_BUILTIN to share multiple
-        # qapi-types.h from a single .c, all arrays of builtins must be
-        # declared in the first file whether or not they are used.  Nicer
-        # would be to use lazy instantiation, while figuring out how to
-        # avoid compilation issues with multiple qapi-types.h.
+        # Instantiating only the arrays that are actually used would
+        # be nice, but we can't as long as their generated code
+        # (qapi-builtin-types.[ch]) may be shared by some other
+        # schema.
         self._make_array_type(name, None)
 
     def _def_predefineds(self):
@@ -1985,14 +1984,15 @@ class QAPIGen(object):
         return ''
 
     def write(self, output_dir, fname):
-        if output_dir:
+        pathname = os.path.join(output_dir, fname)
+        dir = os.path.dirname(pathname)
+        if dir:
             try:
-                os.makedirs(output_dir)
+                os.makedirs(dir)
             except os.error as e:
                 if e.errno != errno.EEXIST:
                     raise
-        fd = os.open(os.path.join(output_dir, fname),
-                     os.O_RDWR | os.O_CREAT, 0666)
+        fd = os.open(pathname, os.O_RDWR | os.O_CREAT, 0666)
         f = os.fdopen(fd, 'r+')
         text = (self.top(fname) + self._preamble + self._body
                 + self.bottom(fname))
diff --git a/scripts/qapi/types.py b/scripts/qapi/types.py
index eeffcbf32c..f84ed17960 100644
--- a/scripts/qapi/types.py
+++ b/scripts/qapi/types.py
@@ -171,64 +171,72 @@ class QAPISchemaGenTypeVisitor(QAPISchemaVisitor):
     def __init__(self, opt_builtins, prefix):
         self._opt_builtins = opt_builtins
         self._prefix = prefix
-        blurb = ' * Schema-defined QAPI types'
-        self._genc = QAPIGenC(blurb, __doc__)
-        self._genh = QAPIGenH(blurb, __doc__)
+        self._module = {}
+        self._add_module(None, ' * Built-in QAPI types')
         self._genc.preamble(mcgen('''
 #include "qemu/osdep.h"
 #include "qapi/dealloc-visitor.h"
-#include "%(prefix)sqapi-types.h"
-#include "%(prefix)sqapi-visit.h"
-''',
-                                  prefix=prefix))
+#include "qapi-builtin-types.h"
+#include "qapi-builtin-visit.h"
+'''))
         self._genh.preamble(mcgen('''
 #include "qapi/util.h"
 '''))
-        self._btin = '\n' + guardstart('QAPI_TYPES_BUILTIN')
+
+    def _module_basename(self, name):
+        if name is None:
+            return 'qapi-builtin-types'
+        return self._prefix + 'qapi-types'
+
+    def _add_module(self, name, blurb):
+        genc = QAPIGenC(blurb, __doc__)
+        genh = QAPIGenH(blurb, __doc__)
+        self._module[name] = (genc, genh)
+        self._set_module(name)
+
+    def _set_module(self, name):
+        self._genc, self._genh = self._module[name]
 
     def write(self, output_dir):
-        self._genc.write(output_dir, self._prefix + 'qapi-types.c')
-        self._genh.write(output_dir, self._prefix + 'qapi-types.h')
+        for name in self._module:
+            if name is None and not self._opt_builtins:
+                continue
+            basename = self._module_basename(name)
+            (genc, genh) = self._module[name]
+            genc.write(output_dir, basename + '.c')
+            genh.write(output_dir, basename + '.h')
 
     def visit_begin(self, schema):
         # gen_object() is recursive, ensure it doesn't visit the empty type
         objects_seen.add(schema.the_empty_object_type.name)
 
-    def visit_end(self):
-        # To avoid header dependency hell, we always generate
-        # declarations for built-in types in our header files and
-        # simply guard them.  See also opt_builtins (command line
-        # option -b).
-        self._btin += guardend('QAPI_TYPES_BUILTIN')
-        self._genh.preamble(self._btin)
-        self._btin = None
+    def visit_module(self, name):
+        if len(self._module) != 1:
+            return
+        self._add_module(name, ' * Schema-defined QAPI types')
+        self._genc.preamble(mcgen('''
+#include "qemu/osdep.h"
+#include "qapi/dealloc-visitor.h"
+#include "%(prefix)sqapi-types.h"
+#include "%(prefix)sqapi-visit.h"
+''',
+                                  prefix=self._prefix))
+        self._genh.preamble(mcgen('''
+#include "qapi-builtin-types.h"
+'''))
 
     def _gen_type_cleanup(self, name):
         self._genh.body(gen_type_cleanup_decl(name))
         self._genc.body(gen_type_cleanup(name))
 
     def visit_enum_type(self, name, info, values, prefix):
-        # Special case for our lone builtin enum type
-        # TODO use something cleaner than existence of info
-        if not info:
-            self._btin += gen_enum(name, values, prefix)
-            if self._opt_builtins:
-                self._genc.body(gen_enum_lookup(name, values, prefix))
-        else:
-            self._genh.preamble(gen_enum(name, values, prefix))
-            self._genc.body(gen_enum_lookup(name, values, prefix))
+        self._genh.preamble(gen_enum(name, values, prefix))
+        self._genc.body(gen_enum_lookup(name, values, prefix))
 
     def visit_array_type(self, name, info, element_type):
-        if isinstance(element_type, QAPISchemaBuiltinType):
-            self._btin += gen_fwd_object_or_array(name)
-            self._btin += gen_array(name, element_type)
-            self._btin += gen_type_cleanup_decl(name)
-            if self._opt_builtins:
-                self._genc.body(gen_type_cleanup(name))
-        else:
-            self._genh.preamble(gen_fwd_object_or_array(name))
-            self._genh.body(gen_array(name, element_type))
-            self._gen_type_cleanup(name)
+        self._genh.preamble(gen_fwd_object_or_array(name))
+        self._genh.body(gen_array(name, element_type))
+        self._gen_type_cleanup(name)
 
     def visit_object_type(self, name, info, base, members, variants):
         # Nothing to do for the special empty builtin
diff --git a/scripts/qapi/visit.py b/scripts/qapi/visit.py
index ee1a849574..f23e71bb9a 100644
--- a/scripts/qapi/visit.py
+++ b/scripts/qapi/visit.py
@@ -267,58 +267,68 @@ class QAPISchemaGenVisitVisitor(QAPISchemaVisitor):
     def __init__(self, opt_builtins, prefix):
         self._opt_builtins = opt_builtins
         self._prefix = prefix
-        blurb = ' * Schema-defined QAPI visitors'
-        self._genc = QAPIGenC(blurb, __doc__)
-        self._genh = QAPIGenH(blurb, __doc__)
+        self._module = {}
+        self._add_module(None, ' * Built-in QAPI visitors')
         self._genc.preamble(mcgen('''
 #include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qapi/error.h"
-#include "%(prefix)sqapi-visit.h"
-''',
-                                  prefix=prefix))
+#include "qapi-builtin-visit.h"
+'''))
         self._genh.preamble(mcgen('''
 #include "qapi/visitor.h"
 #include "qapi/qmp/qerror.h"
-#include "%(prefix)sqapi-types.h"
+#include "qapi-builtin-types.h"
 ''',
-                                  prefix=prefix))
-        self._btin = guardstart('QAPI_VISIT_BUILTIN')
+                              prefix=prefix))
+
+    def _module_basename(self, name):
+        if name is None:
+            return 'qapi-builtin-visit'
+        return self._prefix + 'qapi-visit'
+
+    def _add_module(self, name, blurb):
+        genc = QAPIGenC(blurb, __doc__)
+        genh = QAPIGenH(blurb, __doc__)
+        self._module[name] = (genc, genh)
+        self._set_module(name)
+
+    def _set_module(self, name):
+        self._genc, self._genh = self._module[name]
 
     def write(self, output_dir):
-        self._genc.write(output_dir, self._prefix + 'qapi-visit.c')
-        self._genh.write(output_dir, self._prefix + 'qapi-visit.h')
+        for name in self._module:
+            if name is None and not self._opt_builtins:
+                continue
+            basename = self._module_basename(name)
+            (genc, genh) = self._module[name]
+            genc.write(output_dir, basename + '.c')
+            genh.write(output_dir, basename + '.h')
 
-    def visit_end(self):
-        # To avoid header dependency hell, we always generate
-        # declarations for built-in types in our header files and
-        # simply guard them.  See also opt_builtins (command line
-        # option -b).
-        self._btin += guardend('QAPI_VISIT_BUILTIN')
-        self._genh.preamble(self._btin)
-        self._btin = None
+    def visit_module(self, name):
+        if len(self._module) != 1:
+            return
+        self._add_module(name, ' * Schema-defined QAPI visitors')
+        self._genc.preamble(mcgen('''
+#include "qemu/osdep.h"
+#include "qemu-common.h"
+#include "qapi/error.h"
+#include "%(prefix)sqapi-visit.h"
+''',
+                                  prefix=self._prefix))
+        self._genh.preamble(mcgen('''
+#include "qapi-builtin-visit.h"
+#include "%(prefix)sqapi-types.h"
+''',
+                                  prefix=self._prefix))
 
     def visit_enum_type(self, name, info, values, prefix):
-        # Special case for our lone builtin enum type
-        # TODO use something cleaner than existence of info
-        if not info:
-            self._btin += gen_visit_decl(name, scalar=True)
-            if self._opt_builtins:
-                self._genc.body(gen_visit_enum(name))
-        else:
-            self._genh.body(gen_visit_decl(name, scalar=True))
-            self._genc.body(gen_visit_enum(name))
+        self._genh.body(gen_visit_decl(name, scalar=True))
+        self._genc.body(gen_visit_enum(name))
 
     def visit_array_type(self, name, info, element_type):
-        decl = gen_visit_decl(name)
-        defn = gen_visit_list(name, element_type)
-        if isinstance(element_type, QAPISchemaBuiltinType):
-            self._btin += decl
-            if self._opt_builtins:
-                self._genc.body(defn)
-        else:
-            self._genh.body(decl)
-            self._genc.body(defn)
+        self._genh.body(gen_visit_decl(name))
+        self._genc.body(gen_visit_list(name, element_type))
 
     def visit_object_type(self, name, info, base, members, variants):
         # Nothing to do for the special empty builtin
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 87+ messages in thread

* [Qemu-devel] [PATCH RFC 18/21] qapi/common: Fix guardname() for funny filenames
  2018-02-02 13:03 [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code Markus Armbruster
                   ` (16 preceding siblings ...)
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 17/21] qapi/types qapi/visit: Generate built-in stuff into separate files Markus Armbruster
@ 2018-02-02 13:03 ` Markus Armbruster
  2018-02-05 13:47   ` Marc-Andre Lureau
  2018-02-06 21:00   ` Eric Blake
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 19/21] qapi/types: Generate separate .h, .c for each module Markus Armbruster
                   ` (10 subsequent siblings)
  28 siblings, 2 replies; 87+ messages in thread
From: Markus Armbruster @ 2018-02-02 13:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: marcandre.lureau, eblake, mdroth

guardname() fails to return a valid C identifier for arguments
containing anything but [A-Za-z0-9_.-'].  Fix that.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 scripts/qapi/common.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py
index 7ffffc78d9..7d497b5b17 100644
--- a/scripts/qapi/common.py
+++ b/scripts/qapi/common.py
@@ -1860,7 +1860,7 @@ def mcgen(code, **kwds):
 
 
 def guardname(filename):
-    return c_name(filename, protect=False).upper()
+    return re.sub(r'[^A-Za-z0-9_]', '_', filename).upper()
 
 
 def guardstart(name):
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 87+ messages in thread

* [Qemu-devel] [PATCH RFC 19/21] qapi/types: Generate separate .h, .c for each module
  2018-02-02 13:03 [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code Markus Armbruster
                   ` (17 preceding siblings ...)
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 18/21] qapi/common: Fix guardname() for funny filenames Markus Armbruster
@ 2018-02-02 13:03 ` Markus Armbruster
  2018-02-05 13:58   ` Marc-Andre Lureau
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 20/21] Include less of qapi-types.h Markus Armbruster
                   ` (9 subsequent siblings)
  28 siblings, 1 reply; 87+ messages in thread
From: Markus Armbruster @ 2018-02-02 13:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: marcandre.lureau, eblake, mdroth

Our qapi-schema.json is composed of modules connected by include
directives, but the generated code is monolithic all the same: one
qapi-types.h with all the types, one qapi-visit.h with all the
visitors, and so forth.  These monolithic headers get included all
over the place.  In my "build everything" tree, adding a QAPI type
recompiles about 4500 out of 4800 objects.

Nobody would write such monolithic headers by hand.  It stands to
reason that one shouldn't generate them, either.

Split up generated qapi-types.h to mirror the schema's modular
structure: one header per module.  Name the main module's header
qapi-types.h, and sub-module D/B.json's header D/qapi-types-B.h.

Mirror the schema's includes in the headers, so that qapi-types.h gets
you everything exactly as before.  If you need less, you can include
one or more of the sub-module headers.  To be exploited shortly.

Split up qapi-types.c similarly.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 Makefile              | 30 ++++++++++++++++++++++++++++++
 Makefile.objs         | 18 +++++++++++++++++-
 scripts/qapi/types.py | 18 ++++++++++++++++--
 3 files changed, 63 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index f9b7900330..f1b68dca9b 100644
--- a/Makefile
+++ b/Makefile
@@ -91,6 +91,21 @@ GENERATED_FILES = qemu-version.h config-host.h qemu-options.def
 GENERATED_FILES += qmp-commands.h qmp-marshal.c
 GENERATED_FILES += qapi-builtin-types.h qapi-builtin-types.c
 GENERATED_FILES += qapi-types.h qapi-types.c
+GENERATED_FILES += qapi/qapi-types-block-core.h qapi/qapi-types-block-core.c
+GENERATED_FILES += qapi/qapi-types-block.h qapi/qapi-types-block.c
+GENERATED_FILES += qapi/qapi-types-char.h qapi/qapi-types-char.c
+GENERATED_FILES += qapi/qapi-types-common.h qapi/qapi-types-common.c
+GENERATED_FILES += qapi/qapi-types-crypto.h qapi/qapi-types-crypto.c
+GENERATED_FILES += qapi/qapi-types-introspect.h qapi/qapi-types-introspect.c
+GENERATED_FILES += qapi/qapi-types-migration.h qapi/qapi-types-migration.c
+GENERATED_FILES += qapi/qapi-types-net.h qapi/qapi-types-net.c
+GENERATED_FILES += qapi/qapi-types-rocker.h qapi/qapi-types-rocker.c
+GENERATED_FILES += qapi/qapi-types-run-state.h qapi/qapi-types-run-state.c
+GENERATED_FILES += qapi/qapi-types-sockets.h qapi/qapi-types-sockets.c
+GENERATED_FILES += qapi/qapi-types-tpm.h qapi/qapi-types-tpm.c
+GENERATED_FILES += qapi/qapi-types-trace.h qapi/qapi-types-trace.c
+GENERATED_FILES += qapi/qapi-types-transaction.h qapi/qapi-types-transaction.c
+GENERATED_FILES += qapi/qapi-types-ui.h qapi/qapi-types-ui.c
 GENERATED_FILES += qapi-builtin-visit.h qapi-builtin-visit.c
 GENERATED_FILES += qapi-visit.h qapi-visit.c
 GENERATED_FILES += qapi-event.h qapi-event.c
@@ -519,6 +534,21 @@ qapi-modules = $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/qapi/common.json \
 
 qapi-builtin-types.c qapi-builtin-types.h \
 qapi-types.c qapi-types.h \
+qapi/qapi-types-block-core.c qapi/qapi-types-block-core.h \
+qapi/qapi-types-block.c qapi/qapi-types-block.h \
+qapi/qapi-types-char.c qapi/qapi-types-char.h \
+qapi/qapi-types-common.c qapi/qapi-types-common.h \
+qapi/qapi-types-crypto.c qapi/qapi-types-crypto.h \
+qapi/qapi-types-introspect.c qapi/qapi-types-introspect.h \
+qapi/qapi-types-migration.c qapi/qapi-types-migration.h \
+qapi/qapi-types-net.c qapi/qapi-types-net.h \
+qapi/qapi-types-rocker.c qapi/qapi-types-rocker.h \
+qapi/qapi-types-run-state.c qapi/qapi-types-run-state.h \
+qapi/qapi-types-sockets.c qapi/qapi-types-sockets.h \
+qapi/qapi-types-tpm.c qapi/qapi-types-tpm.h \
+qapi/qapi-types-trace.c qapi/qapi-types-trace.h \
+qapi/qapi-types-transaction.c qapi/qapi-types-transaction.h \
+qapi/qapi-types-ui.c qapi/qapi-types-ui.h \
 qapi-builtin-visit.c qapi-builtin-visit.h \
 qapi-visit.c qapi-visit.h \
 qmp-commands.h qmp-marshal.c \
diff --git a/Makefile.objs b/Makefile.objs
index f16cca06e7..e7411a2658 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -3,7 +3,23 @@
 stub-obj-y = stubs/ crypto/
 util-obj-y = util/ qobject/ qapi/
 util-obj-y += qapi-builtin-types.o qapi-builtin-visit.o
-util-obj-y += qmp-introspect.o qapi-types.o qapi-visit.o qapi-event.o
+util-obj-y += qapi-types.o
+util-obj-y += qapi/qapi-types-block-core.o
+util-obj-y += qapi/qapi-types-block.o
+util-obj-y += qapi/qapi-types-char.o
+util-obj-y += qapi/qapi-types-common.o
+util-obj-y += qapi/qapi-types-crypto.o
+util-obj-y += qapi/qapi-types-introspect.o
+util-obj-y += qapi/qapi-types-migration.o
+util-obj-y += qapi/qapi-types-net.o
+util-obj-y += qapi/qapi-types-rocker.o
+util-obj-y += qapi/qapi-types-run-state.o
+util-obj-y += qapi/qapi-types-sockets.o
+util-obj-y += qapi/qapi-types-tpm.o
+util-obj-y += qapi/qapi-types-trace.o
+util-obj-y += qapi/qapi-types-transaction.o
+util-obj-y += qapi/qapi-types-ui.o
+util-obj-y += qmp-introspect.o qapi-visit.o qapi-event.o
 
 chardev-obj-y = chardev/
 
diff --git a/scripts/qapi/types.py b/scripts/qapi/types.py
index f84ed17960..7bd8e1a978 100644
--- a/scripts/qapi/types.py
+++ b/scripts/qapi/types.py
@@ -172,6 +172,7 @@ class QAPISchemaGenTypeVisitor(QAPISchemaVisitor):
         self._opt_builtins = opt_builtins
         self._prefix = prefix
         self._module = {}
+        self._main_module = None
         self._add_module(None, ' * Built-in QAPI types')
         self._genc.preamble(mcgen('''
 #include "qemu/osdep.h"
@@ -186,7 +187,11 @@ class QAPISchemaGenTypeVisitor(QAPISchemaVisitor):
     def _module_basename(self, name):
         if name is None:
             return 'qapi-builtin-types'
-        return self._prefix + 'qapi-types'
+        basename = os.path.join(os.path.dirname(name),
+                                self._prefix + 'qapi-types')
+        if name == self._main_module:
+            return basename
+        return basename + '-' + os.path.splitext(os.path.basename(name))[0]
 
     def _add_module(self, name, blurb):
         genc = QAPIGenC(blurb, __doc__)
@@ -211,7 +216,10 @@ class QAPISchemaGenTypeVisitor(QAPISchemaVisitor):
         objects_seen.add(schema.the_empty_object_type.name)
 
     def visit_module(self, name):
-        if len(self._module) != 1:
+        if self._main_module is None:
+            self._main_module = name
+        if name in self._module:
+            self._set_module(name)
             return
         self._add_module(name, ' * Schema-defined QAPI types')
         self._genc.preamble(mcgen('''
@@ -225,6 +233,12 @@ class QAPISchemaGenTypeVisitor(QAPISchemaVisitor):
 #include "qapi-builtin-types.h"
 '''))
 
+    def visit_include(self, name, info):
+        self._genh.preamble(mcgen('''
+#include "%(basename)s.h"
+''',
+                                  basename=self._module_basename(name)))
+
     def _gen_type_cleanup(self, name):
         self._genh.body(gen_type_cleanup_decl(name))
         self._genc.body(gen_type_cleanup(name))
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 87+ messages in thread

* [Qemu-devel] [PATCH RFC 20/21] Include less of qapi-types.h
  2018-02-02 13:03 [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code Markus Armbruster
                   ` (18 preceding siblings ...)
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 19/21] qapi/types: Generate separate .h, .c for each module Markus Armbruster
@ 2018-02-02 13:03 ` Markus Armbruster
  2018-02-05 13:46   ` Marc-Andre Lureau
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 21/21] qapi: Empty out qapi-schema.json Markus Armbruster
                   ` (8 subsequent siblings)
  28 siblings, 1 reply; 87+ messages in thread
From: Markus Armbruster @ 2018-02-02 13:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: marcandre.lureau, eblake, mdroth

In my "build everything" tree, a change to the types in
qapi-schema.json triggers a recompile of about 4500 out of 4800
objects.

The previous commit split up the generated qapi-types.h.  Replace
includes of qapi-types.h (i.e. all types) by includes of parts where
possible.

To illustrate the benefits: adding a type to qapi/migration.json now
recompiles some 2300 instead of 4500 objects.  The next commit will
improve it further.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 crypto/cipherpriv.h              | 2 +-
 hw/block/block.c                 | 1 +
 hw/block/hd-geometry.c           | 1 +
 hw/net/rocker/rocker_fp.c        | 2 +-
 include/block/block.h            | 2 +-
 include/block/dirty-bitmap.h     | 2 +-
 include/chardev/char.h           | 1 +
 include/crypto/cipher.h          | 2 +-
 include/crypto/hash.h            | 2 +-
 include/crypto/hmac.h            | 2 +-
 include/crypto/secret.h          | 1 +
 include/crypto/tlscreds.h        | 1 +
 include/hw/block/block.h         | 2 +-
 include/hw/block/fdc.h           | 2 +-
 include/hw/ppc/spapr_drc.h       | 1 +
 include/hw/qdev-properties.h     | 1 +
 include/io/dns-resolver.h        | 1 +
 include/migration/colo.h         | 2 +-
 include/migration/failover.h     | 2 +-
 include/migration/global_state.h | 1 +
 include/monitor/monitor.h        | 1 +
 include/net/filter.h             | 1 +
 include/net/net.h                | 2 +-
 include/qapi/error.h             | 2 +-
 include/qapi/qmp/qobject.h       | 2 +-
 include/qapi/visitor.h           | 2 +-
 include/qemu/sockets.h           | 2 +-
 include/qemu/throttle.h          | 2 +-
 include/qom/cpu.h                | 1 +
 include/qom/object.h             | 2 +-
 include/sysemu/dump.h            | 2 ++
 include/sysemu/hostmem.h         | 1 +
 include/sysemu/replay.h          | 1 +
 include/sysemu/sysemu.h          | 1 +
 include/sysemu/tpm.h             | 1 +
 include/sysemu/watchdog.h        | 2 +-
 include/ui/input.h               | 2 +-
 migration/migration.h            | 1 +
 migration/ram.h                  | 2 +-
 net/tap_int.h                    | 2 +-
 replication.h                    | 1 +
 ui/vnc.h                         | 1 +
 42 files changed, 43 insertions(+), 22 deletions(-)

diff --git a/crypto/cipherpriv.h b/crypto/cipherpriv.h
index 77da4c2f32..0823239f41 100644
--- a/crypto/cipherpriv.h
+++ b/crypto/cipherpriv.h
@@ -15,7 +15,7 @@
 #ifndef QCRYPTO_CIPHERPRIV_H
 #define QCRYPTO_CIPHERPRIV_H
 
-#include "qapi-types.h"
+#include "qapi/qapi-types-crypto.h"
 
 typedef struct QCryptoCipherDriver QCryptoCipherDriver;
 
diff --git a/hw/block/block.c b/hw/block/block.c
index b0269c857f..b91e2b6d7e 100644
--- a/hw/block/block.c
+++ b/hw/block/block.c
@@ -12,6 +12,7 @@
 #include "sysemu/block-backend.h"
 #include "hw/block/block.h"
 #include "qapi/error.h"
+#include "qapi/qapi-types-block.h"
 #include "qemu/error-report.h"
 
 void blkconf_serial(BlockConf *conf, char **serial)
diff --git a/hw/block/hd-geometry.c b/hw/block/hd-geometry.c
index 57ad5012a7..79384a2b0a 100644
--- a/hw/block/hd-geometry.c
+++ b/hw/block/hd-geometry.c
@@ -32,6 +32,7 @@
 
 #include "qemu/osdep.h"
 #include "sysemu/block-backend.h"
+#include "qapi/qapi-types-block.h"
 #include "qemu/bswap.h"
 #include "hw/block/block.h"
 #include "trace.h"
diff --git a/hw/net/rocker/rocker_fp.c b/hw/net/rocker/rocker_fp.c
index 4b3c9847db..27b17c890f 100644
--- a/hw/net/rocker/rocker_fp.c
+++ b/hw/net/rocker/rocker_fp.c
@@ -16,7 +16,7 @@
 
 #include "qemu/osdep.h"
 #include "net/clients.h"
-
+#include "qapi/qapi-types-rocker.h"
 #include "rocker.h"
 #include "rocker_hw.h"
 #include "rocker_fp.h"
diff --git a/include/block/block.h b/include/block/block.h
index ae1517f32d..70b90cd767 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -2,7 +2,7 @@
 #define BLOCK_H
 
 #include "block/aio.h"
-#include "qapi-types.h"
+#include "qapi/qapi-types-block-core.h"
 #include "qemu/iov.h"
 #include "qemu/coroutine.h"
 #include "block/accounting.h"
diff --git a/include/block/dirty-bitmap.h b/include/block/dirty-bitmap.h
index 3da8486ab1..1454be358d 100644
--- a/include/block/dirty-bitmap.h
+++ b/include/block/dirty-bitmap.h
@@ -2,7 +2,7 @@
 #define BLOCK_DIRTY_BITMAP_H
 
 #include "qemu-common.h"
-#include "qapi-types.h"
+#include "qapi/qapi-types-block-core.h"
 #include "qemu/hbitmap.h"
 
 BdrvDirtyBitmap *bdrv_create_dirty_bitmap(BlockDriverState *bs,
diff --git a/include/chardev/char.h b/include/chardev/char.h
index a381dc3df8..ebf1e0ba04 100644
--- a/include/chardev/char.h
+++ b/include/chardev/char.h
@@ -1,6 +1,7 @@
 #ifndef QEMU_CHAR_H
 #define QEMU_CHAR_H
 
+#include "qapi/qapi-types-char.h"
 #include "qemu/main-loop.h"
 #include "qemu/bitmap.h"
 #include "qom/object.h"
diff --git a/include/crypto/cipher.h b/include/crypto/cipher.h
index 984fb8243f..bce2d4c8e4 100644
--- a/include/crypto/cipher.h
+++ b/include/crypto/cipher.h
@@ -21,7 +21,7 @@
 #ifndef QCRYPTO_CIPHER_H
 #define QCRYPTO_CIPHER_H
 
-#include "qapi-types.h"
+#include "qapi/qapi-types-crypto.h"
 
 typedef struct QCryptoCipher QCryptoCipher;
 
diff --git a/include/crypto/hash.h b/include/crypto/hash.h
index ca3267f3df..077ac7bea0 100644
--- a/include/crypto/hash.h
+++ b/include/crypto/hash.h
@@ -21,7 +21,7 @@
 #ifndef QCRYPTO_HASH_H
 #define QCRYPTO_HASH_H
 
-#include "qapi-types.h"
+#include "qapi/qapi-types-crypto.h"
 
 /* See also "QCryptoHashAlgorithm" defined in qapi/crypto.json */
 
diff --git a/include/crypto/hmac.h b/include/crypto/hmac.h
index 5e88905989..aa3c97a2ff 100644
--- a/include/crypto/hmac.h
+++ b/include/crypto/hmac.h
@@ -12,7 +12,7 @@
 #ifndef QCRYPTO_HMAC_H
 #define QCRYPTO_HMAC_H
 
-#include "qapi-types.h"
+#include "qapi/qapi-types-crypto.h"
 
 typedef struct QCryptoHmac QCryptoHmac;
 struct QCryptoHmac {
diff --git a/include/crypto/secret.h b/include/crypto/secret.h
index 07a963e794..edd0e13236 100644
--- a/include/crypto/secret.h
+++ b/include/crypto/secret.h
@@ -21,6 +21,7 @@
 #ifndef QCRYPTO_SECRET_H
 #define QCRYPTO_SECRET_H
 
+#include "qapi/qapi-types-crypto.h"
 #include "qom/object.h"
 
 #define TYPE_QCRYPTO_SECRET "secret"
diff --git a/include/crypto/tlscreds.h b/include/crypto/tlscreds.h
index ad47d88be7..6b011e1dbc 100644
--- a/include/crypto/tlscreds.h
+++ b/include/crypto/tlscreds.h
@@ -21,6 +21,7 @@
 #ifndef QCRYPTO_TLSCREDS_H
 #define QCRYPTO_TLSCREDS_H
 
+#include "qapi/qapi-types-crypto.h"
 #include "qom/object.h"
 
 #ifdef CONFIG_GNUTLS
diff --git a/include/hw/block/block.h b/include/hw/block/block.h
index f532d10e35..d4f4dfffab 100644
--- a/include/hw/block/block.h
+++ b/include/hw/block/block.h
@@ -12,7 +12,7 @@
 #define HW_BLOCK_H
 
 #include "qemu-common.h"
-#include "qapi-types.h"
+#include "qapi/qapi-types-block-core.h"
 
 /* Configuration */
 
diff --git a/include/hw/block/fdc.h b/include/hw/block/fdc.h
index 68a0c904ea..3b813c7f7d 100644
--- a/include/hw/block/fdc.h
+++ b/include/hw/block/fdc.h
@@ -2,7 +2,7 @@
 #define HW_FDC_H
 
 #include "qemu-common.h"
-#include "qapi-types.h"
+#include "qapi/qapi-types-block.h"
 
 /* fdc.c */
 #define MAX_FD 2
diff --git a/include/hw/ppc/spapr_drc.h b/include/hw/ppc/spapr_drc.h
index f8d9f5b231..f6ff32e7e2 100644
--- a/include/hw/ppc/spapr_drc.h
+++ b/include/hw/ppc/spapr_drc.h
@@ -14,6 +14,7 @@
 #define HW_SPAPR_DRC_H
 
 #include <libfdt.h>
+#include "qapi/qapi-types-run-state.h"
 #include "qom/object.h"
 #include "sysemu/sysemu.h"
 #include "hw/qdev.h"
diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h
index 5bbfec634b..c5d1b1bd63 100644
--- a/include/hw/qdev-properties.h
+++ b/include/hw/qdev-properties.h
@@ -1,6 +1,7 @@
 #ifndef QEMU_QDEV_PROPERTIES_H
 #define QEMU_QDEV_PROPERTIES_H
 
+#include "qapi-types.h"
 #include "hw/qdev-core.h"
 
 /*** qdev-properties.c ***/
diff --git a/include/io/dns-resolver.h b/include/io/dns-resolver.h
index 2f69c08c13..1a162185cc 100644
--- a/include/io/dns-resolver.h
+++ b/include/io/dns-resolver.h
@@ -22,6 +22,7 @@
 #define QIO_DNS_RESOLVER_H
 
 #include "qemu-common.h"
+#include "qapi/qapi-types-sockets.h"
 #include "qom/object.h"
 #include "io/task.h"
 
diff --git a/include/migration/colo.h b/include/migration/colo.h
index 50ace16205..2fe48ad353 100644
--- a/include/migration/colo.h
+++ b/include/migration/colo.h
@@ -14,7 +14,7 @@
 #define QEMU_COLO_H
 
 #include "qemu-common.h"
-#include "qapi-types.h"
+#include "qapi/qapi-types-migration.h"
 
 void colo_info_init(void);
 
diff --git a/include/migration/failover.h b/include/migration/failover.h
index ad91ef2381..4c37218dcc 100644
--- a/include/migration/failover.h
+++ b/include/migration/failover.h
@@ -14,7 +14,7 @@
 #define QEMU_FAILOVER_H
 
 #include "qemu-common.h"
-#include "qapi-types.h"
+#include "qapi/qapi-types-migration.h"
 
 void failover_init_state(void);
 FailoverStatus failover_set_state(FailoverStatus old_state,
diff --git a/include/migration/global_state.h b/include/migration/global_state.h
index d307de8350..fd22dd3034 100644
--- a/include/migration/global_state.h
+++ b/include/migration/global_state.h
@@ -13,6 +13,7 @@
 #ifndef QEMU_MIGRATION_GLOBAL_STATE_H
 #define QEMU_MIGRATION_GLOBAL_STATE_H
 
+#include "qapi/qapi-types-run-state.h"
 #include "sysemu/sysemu.h"
 
 void register_global_state(void);
diff --git a/include/monitor/monitor.h b/include/monitor/monitor.h
index ad64ad8e68..50f7cea057 100644
--- a/include/monitor/monitor.h
+++ b/include/monitor/monitor.h
@@ -3,6 +3,7 @@
 
 #include "qemu-common.h"
 #include "block/block.h"
+#include "qapi-types.h"
 #include "qemu/readline.h"
 
 extern Monitor *cur_mon;
diff --git a/include/net/filter.h b/include/net/filter.h
index 0c4a2ea6c9..435acd6f82 100644
--- a/include/net/filter.h
+++ b/include/net/filter.h
@@ -9,6 +9,7 @@
 #ifndef QEMU_NET_FILTER_H
 #define QEMU_NET_FILTER_H
 
+#include "qapi/qapi-types-net.h"
 #include "qom/object.h"
 #include "qemu-common.h"
 #include "net/queue.h"
diff --git a/include/net/net.h b/include/net/net.h
index 3fc48e4f51..727643032c 100644
--- a/include/net/net.h
+++ b/include/net/net.h
@@ -2,7 +2,7 @@
 #define QEMU_NET_H
 
 #include "qemu/queue.h"
-#include "qapi-types.h"
+#include "qapi/qapi-types-net.h"
 #include "net/queue.h"
 #include "migration/vmstate.h"
 
diff --git a/include/qapi/error.h b/include/qapi/error.h
index 341b229066..36065da35d 100644
--- a/include/qapi/error.h
+++ b/include/qapi/error.h
@@ -115,7 +115,7 @@
 #ifndef ERROR_H
 #define ERROR_H
 
-#include "qapi-types.h"
+#include "qapi/qapi-types-common.h"
 
 /*
  * Overall category of an error.
diff --git a/include/qapi/qmp/qobject.h b/include/qapi/qmp/qobject.h
index 38ac68845c..a2964fbf25 100644
--- a/include/qapi/qmp/qobject.h
+++ b/include/qapi/qmp/qobject.h
@@ -32,7 +32,7 @@
 #ifndef QOBJECT_H
 #define QOBJECT_H
 
-#include "qapi-types.h"
+#include "qapi-builtin-types.h"
 
 struct QObject {
     QType type;
diff --git a/include/qapi/visitor.h b/include/qapi/visitor.h
index ecff296c11..9e57508446 100644
--- a/include/qapi/visitor.h
+++ b/include/qapi/visitor.h
@@ -15,7 +15,7 @@
 #ifndef QAPI_VISITOR_H
 #define QAPI_VISITOR_H
 
-#include "qapi-types.h"
+#include "qapi-builtin-types.h"
 
 /*
  * The QAPI schema defines both a set of C data types, and a QMP wire
diff --git a/include/qemu/sockets.h b/include/qemu/sockets.h
index 8889bcb1ec..e88d4c37ab 100644
--- a/include/qemu/sockets.h
+++ b/include/qemu/sockets.h
@@ -9,7 +9,7 @@ int inet_aton(const char *cp, struct in_addr *ia);
 
 #endif /* !_WIN32 */
 
-#include "qapi-types.h"
+#include "qapi/qapi-types-sockets.h"
 
 /* misc helpers */
 int qemu_socket(int domain, int type, int protocol);
diff --git a/include/qemu/throttle.h b/include/qemu/throttle.h
index 03d45f44f8..abeb886d93 100644
--- a/include/qemu/throttle.h
+++ b/include/qemu/throttle.h
@@ -26,7 +26,7 @@
 #define THROTTLE_H
 
 #include "qemu-common.h"
-#include "qapi-types.h"
+#include "qapi/qapi-types-block-core.h"
 #include "qemu/timer.h"
 
 #define THROTTLE_VALUE_MAX 1000000000000000LL
diff --git a/include/qom/cpu.h b/include/qom/cpu.h
index aff88fa16f..dc6d4956a8 100644
--- a/include/qom/cpu.h
+++ b/include/qom/cpu.h
@@ -24,6 +24,7 @@
 #include "disas/bfd.h"
 #include "exec/hwaddr.h"
 #include "exec/memattrs.h"
+#include "qapi/qapi-types-run-state.h"
 #include "qemu/bitmap.h"
 #include "qemu/queue.h"
 #include "qemu/thread.h"
diff --git a/include/qom/object.h b/include/qom/object.h
index dc73d59660..5b5c016d8f 100644
--- a/include/qom/object.h
+++ b/include/qom/object.h
@@ -14,7 +14,7 @@
 #ifndef QEMU_OBJECT_H
 #define QEMU_OBJECT_H
 
-#include "qapi-types.h"
+#include "qapi-builtin-types.h"
 #include "qemu/queue.h"
 
 struct TypeImpl;
diff --git a/include/sysemu/dump.h b/include/sysemu/dump.h
index c14bcfe8c6..2424e31425 100644
--- a/include/sysemu/dump.h
+++ b/include/sysemu/dump.h
@@ -14,6 +14,8 @@
 #ifndef DUMP_H
 #define DUMP_H
 
+#include "qapi-types.h"
+
 #define MAKEDUMPFILE_SIGNATURE      "makedumpfile"
 #define MAX_SIZE_MDF_HEADER         (4096) /* max size of makedumpfile_header */
 #define TYPE_FLAT_HEADER            (1)    /* type of flattened format */
diff --git a/include/sysemu/hostmem.h b/include/sysemu/hostmem.h
index 621a3f9d42..6424f96df9 100644
--- a/include/sysemu/hostmem.h
+++ b/include/sysemu/hostmem.h
@@ -14,6 +14,7 @@
 #define SYSEMU_HOSTMEM_H
 
 #include "sysemu/sysemu.h" /* for MAX_NODES */
+#include "qapi-types.h"
 #include "qom/object.h"
 #include "exec/memory.h"
 #include "qemu/bitmap.h"
diff --git a/include/sysemu/replay.h b/include/sysemu/replay.h
index dc8ae7b6b1..fb533ed9b6 100644
--- a/include/sysemu/replay.h
+++ b/include/sysemu/replay.h
@@ -13,6 +13,7 @@
  */
 
 #include "sysemu.h"
+#include "qapi-types.h"
 
 /* replay clock kinds */
 enum ReplayClockKind {
diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
index 77bb3da582..bfbef9e69c 100644
--- a/include/sysemu/sysemu.h
+++ b/include/sysemu/sysemu.h
@@ -2,6 +2,7 @@
 #define SYSEMU_H
 /* Misc. things related to the system emulator.  */
 
+#include "qapi/qapi-types-run-state.h"
 #include "qemu/queue.h"
 #include "qemu/timer.h"
 #include "qemu/notify.h"
diff --git a/include/sysemu/tpm.h b/include/sysemu/tpm.h
index 00be220248..20ac1b2993 100644
--- a/include/sysemu/tpm.h
+++ b/include/sysemu/tpm.h
@@ -12,6 +12,7 @@
 #ifndef QEMU_TPM_H
 #define QEMU_TPM_H
 
+#include "qapi/qapi-types-tpm.h"
 #include "qom/object.h"
 
 int tpm_config_parse(QemuOptsList *opts_list, const char *optarg);
diff --git a/include/sysemu/watchdog.h b/include/sysemu/watchdog.h
index 677ace3945..a08d16380d 100644
--- a/include/sysemu/watchdog.h
+++ b/include/sysemu/watchdog.h
@@ -23,7 +23,7 @@
 #define QEMU_WATCHDOG_H
 
 #include "qemu/queue.h"
-#include "qapi-types.h"
+#include "qapi/qapi-types-run-state.h"
 
 struct WatchdogTimerModel {
     QLIST_ENTRY(WatchdogTimerModel) entry;
diff --git a/include/ui/input.h b/include/ui/input.h
index 05aab2db5c..fc70f503fb 100644
--- a/include/ui/input.h
+++ b/include/ui/input.h
@@ -1,7 +1,7 @@
 #ifndef INPUT_H
 #define INPUT_H
 
-#include "qapi-types.h"
+#include "qapi/qapi-types-ui.h"
 
 #define INPUT_EVENT_MASK_KEY   (1<<INPUT_EVENT_KIND_KEY)
 #define INPUT_EVENT_MASK_BTN   (1<<INPUT_EVENT_KIND_BTN)
diff --git a/migration/migration.h b/migration/migration.h
index 7e3dbed057..87503f03bc 100644
--- a/migration/migration.h
+++ b/migration/migration.h
@@ -15,6 +15,7 @@
 #define QEMU_MIGRATION_H
 
 #include "qemu-common.h"
+#include "qapi/qapi-types-migration.h"
 #include "qemu/thread.h"
 #include "exec/cpu-common.h"
 #include "qemu/coroutine_int.h"
diff --git a/migration/ram.h b/migration/ram.h
index f3a227b4fc..53f0021c51 100644
--- a/migration/ram.h
+++ b/migration/ram.h
@@ -30,7 +30,7 @@
 #define QEMU_MIGRATION_RAM_H
 
 #include "qemu-common.h"
-#include "qapi-types.h"
+#include "qapi/qapi-types-migration.h"
 #include "exec/cpu-common.h"
 
 extern MigrationStats ram_counters;
diff --git a/net/tap_int.h b/net/tap_int.h
index ae6888f74a..9f931d52d6 100644
--- a/net/tap_int.h
+++ b/net/tap_int.h
@@ -27,7 +27,7 @@
 #define NET_TAP_INT_H
 
 #include "qemu-common.h"
-#include "qapi-types.h"
+#include "qapi/qapi-types-net.h"
 
 int tap_open(char *ifname, int ifname_size, int *vnet_hdr,
              int vnet_hdr_required, int mq_required, Error **errp);
diff --git a/replication.h b/replication.h
index ece6ca6133..8faefe005f 100644
--- a/replication.h
+++ b/replication.h
@@ -15,6 +15,7 @@
 #ifndef REPLICATION_H
 #define REPLICATION_H
 
+#include "qapi/qapi-types-block-core.h"
 #include "qemu/queue.h"
 
 typedef struct ReplicationOps ReplicationOps;
diff --git a/ui/vnc.h b/ui/vnc.h
index cfc3d0a570..da8495c0c8 100644
--- a/ui/vnc.h
+++ b/ui/vnc.h
@@ -28,6 +28,7 @@
 #define QEMU_VNC_H
 
 #include "qemu-common.h"
+#include "qapi/qapi-types-ui.h"
 #include "qemu/queue.h"
 #include "qemu/thread.h"
 #include "ui/console.h"
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 87+ messages in thread

* [Qemu-devel] [PATCH RFC 21/21] qapi: Empty out qapi-schema.json
  2018-02-02 13:03 [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code Markus Armbruster
                   ` (19 preceding siblings ...)
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 20/21] Include less of qapi-types.h Markus Armbruster
@ 2018-02-02 13:03 ` Markus Armbruster
  2018-02-05 13:45   ` Marc-Andre Lureau
  2018-02-02 14:52 ` [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code Markus Armbruster
                   ` (7 subsequent siblings)
  28 siblings, 1 reply; 87+ messages in thread
From: Markus Armbruster @ 2018-02-02 13:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: marcandre.lureau, eblake, mdroth

Types defined directly in qapi-schema.json end up in qapi-types.h, and
including that pulls in everything else.

Move everything but include directives from qapi-schema.json to new
sub-module qapi/misc.json, and replace the remaining includes of
qapi-types.h.

Adding a type to qapi/migration.json now recompiles less than 200
instead of 2300 out of 4500 objects.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 Makefile                     |    2 +
 Makefile.objs                |    1 +
 include/hw/qdev-properties.h |    3 +-
 include/monitor/monitor.h    |    2 +-
 include/sysemu/arch_init.h   |    2 +-
 include/sysemu/balloon.h     |    2 +-
 include/sysemu/dump.h        |    2 +-
 include/sysemu/hostmem.h     |    2 +-
 include/sysemu/replay.h      |    3 +-
 qapi-schema.json             | 3098 +-----------------------------------------
 qapi/misc.json               | 3090 +++++++++++++++++++++++++++++++++++++++++
 qapi/run-state.json          |   10 +
 12 files changed, 3113 insertions(+), 3104 deletions(-)
 create mode 100644 qapi/misc.json

diff --git a/Makefile b/Makefile
index f1b68dca9b..0cf2a9caba 100644
--- a/Makefile
+++ b/Makefile
@@ -98,6 +98,7 @@ GENERATED_FILES += qapi/qapi-types-common.h qapi/qapi-types-common.c
 GENERATED_FILES += qapi/qapi-types-crypto.h qapi/qapi-types-crypto.c
 GENERATED_FILES += qapi/qapi-types-introspect.h qapi/qapi-types-introspect.c
 GENERATED_FILES += qapi/qapi-types-migration.h qapi/qapi-types-migration.c
+GENERATED_FILES += qapi/qapi-types-misc.h qapi/qapi-types-misc.c
 GENERATED_FILES += qapi/qapi-types-net.h qapi/qapi-types-net.c
 GENERATED_FILES += qapi/qapi-types-rocker.h qapi/qapi-types-rocker.c
 GENERATED_FILES += qapi/qapi-types-run-state.h qapi/qapi-types-run-state.c
@@ -541,6 +542,7 @@ qapi/qapi-types-common.c qapi/qapi-types-common.h \
 qapi/qapi-types-crypto.c qapi/qapi-types-crypto.h \
 qapi/qapi-types-introspect.c qapi/qapi-types-introspect.h \
 qapi/qapi-types-migration.c qapi/qapi-types-migration.h \
+qapi/qapi-types-misc.c qapi/qapi-types-misc.h \
 qapi/qapi-types-net.c qapi/qapi-types-net.h \
 qapi/qapi-types-rocker.c qapi/qapi-types-rocker.h \
 qapi/qapi-types-run-state.c qapi/qapi-types-run-state.h \
diff --git a/Makefile.objs b/Makefile.objs
index e7411a2658..efef7f095b 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -11,6 +11,7 @@ util-obj-y += qapi/qapi-types-common.o
 util-obj-y += qapi/qapi-types-crypto.o
 util-obj-y += qapi/qapi-types-introspect.o
 util-obj-y += qapi/qapi-types-migration.o
+util-obj-y += qapi/qapi-types-misc.o
 util-obj-y += qapi/qapi-types-net.o
 util-obj-y += qapi/qapi-types-rocker.o
 util-obj-y += qapi/qapi-types-run-state.o
diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h
index c5d1b1bd63..2f6bd7d73d 100644
--- a/include/hw/qdev-properties.h
+++ b/include/hw/qdev-properties.h
@@ -1,7 +1,8 @@
 #ifndef QEMU_QDEV_PROPERTIES_H
 #define QEMU_QDEV_PROPERTIES_H
 
-#include "qapi-types.h"
+#include "qapi/qapi-types-block.h"
+#include "qapi/qapi-types-misc.h"
 #include "hw/qdev-core.h"
 
 /*** qdev-properties.c ***/
diff --git a/include/monitor/monitor.h b/include/monitor/monitor.h
index 50f7cea057..d1024d4bdc 100644
--- a/include/monitor/monitor.h
+++ b/include/monitor/monitor.h
@@ -3,7 +3,7 @@
 
 #include "qemu-common.h"
 #include "block/block.h"
-#include "qapi-types.h"
+#include "qapi/qapi-types-misc.h"
 #include "qemu/readline.h"
 
 extern Monitor *cur_mon;
diff --git a/include/sysemu/arch_init.h b/include/sysemu/arch_init.h
index ced67c7842..979fd022d0 100644
--- a/include/sysemu/arch_init.h
+++ b/include/sysemu/arch_init.h
@@ -1,7 +1,7 @@
 #ifndef QEMU_ARCH_INIT_H
 #define QEMU_ARCH_INIT_H
 
-#include "qapi-types.h"
+#include "qapi/qapi-types-misc.h"
 
 enum {
     QEMU_ARCH_ALL = -1,
diff --git a/include/sysemu/balloon.h b/include/sysemu/balloon.h
index af49e19c78..66543ae8f4 100644
--- a/include/sysemu/balloon.h
+++ b/include/sysemu/balloon.h
@@ -14,7 +14,7 @@
 #ifndef QEMU_BALLOON_H
 #define QEMU_BALLOON_H
 
-#include "qapi-types.h"
+#include "qapi/qapi-types-misc.h"
 
 typedef void (QEMUBalloonEvent)(void *opaque, ram_addr_t target);
 typedef void (QEMUBalloonStatus)(void *opaque, BalloonInfo *info);
diff --git a/include/sysemu/dump.h b/include/sysemu/dump.h
index 2424e31425..d824bc0941 100644
--- a/include/sysemu/dump.h
+++ b/include/sysemu/dump.h
@@ -14,7 +14,7 @@
 #ifndef DUMP_H
 #define DUMP_H
 
-#include "qapi-types.h"
+#include "qapi/qapi-types-misc.h"
 
 #define MAKEDUMPFILE_SIGNATURE      "makedumpfile"
 #define MAX_SIZE_MDF_HEADER         (4096) /* max size of makedumpfile_header */
diff --git a/include/sysemu/hostmem.h b/include/sysemu/hostmem.h
index 6424f96df9..dc3ac3d301 100644
--- a/include/sysemu/hostmem.h
+++ b/include/sysemu/hostmem.h
@@ -14,7 +14,7 @@
 #define SYSEMU_HOSTMEM_H
 
 #include "sysemu/sysemu.h" /* for MAX_NODES */
-#include "qapi-types.h"
+#include "qapi/qapi-types-misc.h"
 #include "qom/object.h"
 #include "exec/memory.h"
 #include "qemu/bitmap.h"
diff --git a/include/sysemu/replay.h b/include/sysemu/replay.h
index fb533ed9b6..c0204e641c 100644
--- a/include/sysemu/replay.h
+++ b/include/sysemu/replay.h
@@ -13,7 +13,8 @@
  */
 
 #include "sysemu.h"
-#include "qapi-types.h"
+#include "qapi/qapi-types-misc.h"
+#include "qapi/qapi-types-ui.h"
 
 /* replay clock kinds */
 enum ReplayClockKind {
diff --git a/qapi-schema.json b/qapi-schema.json
index 5c06745c79..541e0c3fcb 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -92,3100 +92,4 @@
 { 'include': 'qapi/transaction.json' }
 { 'include': 'qapi/trace.json' }
 { 'include': 'qapi/introspect.json' }
-
-##
-# = Miscellanea
-##
-
-##
-# @qmp_capabilities:
-#
-# Enable QMP capabilities.
-#
-# Arguments: None.
-#
-# Example:
-#
-# -> { "execute": "qmp_capabilities" }
-# <- { "return": {} }
-#
-# Notes: This command is valid exactly when first connecting: it must be
-# issued before any other command will be accepted, and will fail once the
-# monitor is accepting other commands. (see qemu docs/interop/qmp-spec.txt)
-#
-# Since: 0.13
-#
-##
-{ 'command': 'qmp_capabilities' }
-
-##
-# @VersionTriple:
-#
-# A three-part version number.
-#
-# @major:  The major version number.
-#
-# @minor:  The minor version number.
-#
-# @micro:  The micro version number.
-#
-# Since: 2.4
-##
-{ 'struct': 'VersionTriple',
-  'data': {'major': 'int', 'minor': 'int', 'micro': 'int'} }
-
-
-##
-# @VersionInfo:
-#
-# A description of QEMU's version.
-#
-# @qemu:        The version of QEMU.  By current convention, a micro
-#               version of 50 signifies a development branch.  A micro version
-#               greater than or equal to 90 signifies a release candidate for
-#               the next minor version.  A micro version of less than 50
-#               signifies a stable release.
-#
-# @package:     QEMU will always set this field to an empty string.  Downstream
-#               versions of QEMU should set this to a non-empty string.  The
-#               exact format depends on the downstream however it highly
-#               recommended that a unique name is used.
-#
-# Since: 0.14.0
-##
-{ 'struct': 'VersionInfo',
-  'data': {'qemu': 'VersionTriple', 'package': 'str'} }
-
-##
-# @query-version:
-#
-# Returns the current version of QEMU.
-#
-# Returns:  A @VersionInfo object describing the current version of QEMU.
-#
-# Since: 0.14.0
-#
-# Example:
-#
-# -> { "execute": "query-version" }
-# <- {
-#       "return":{
-#          "qemu":{
-#             "major":0,
-#             "minor":11,
-#             "micro":5
-#          },
-#          "package":""
-#       }
-#    }
-#
-##
-{ 'command': 'query-version', 'returns': 'VersionInfo' }
-
-##
-# @CommandInfo:
-#
-# Information about a QMP command
-#
-# @name: The command name
-#
-# Since: 0.14.0
-##
-{ 'struct': 'CommandInfo', 'data': {'name': 'str'} }
-
-##
-# @query-commands:
-#
-# Return a list of supported QMP commands by this server
-#
-# Returns: A list of @CommandInfo for all supported commands
-#
-# Since: 0.14.0
-#
-# Example:
-#
-# -> { "execute": "query-commands" }
-# <- {
-#      "return":[
-#         {
-#            "name":"query-balloon"
-#         },
-#         {
-#            "name":"system_powerdown"
-#         }
-#      ]
-#    }
-#
-# Note: This example has been shortened as the real response is too long.
-#
-##
-{ 'command': 'query-commands', 'returns': ['CommandInfo'] }
-
-##
-# @LostTickPolicy:
-#
-# Policy for handling lost ticks in timer devices.
-#
-# @discard: throw away the missed tick(s) and continue with future injection
-#           normally.  Guest time may be delayed, unless the OS has explicit
-#           handling of lost ticks
-#
-# @delay: continue to deliver ticks at the normal rate.  Guest time will be
-#         delayed due to the late tick
-#
-# @merge: merge the missed tick(s) into one tick and inject.  Guest time
-#         may be delayed, depending on how the OS reacts to the merging
-#         of ticks
-#
-# @slew: deliver ticks at a higher rate to catch up with the missed tick. The
-#        guest time should not be delayed once catchup is complete.
-#
-# Since: 2.0
-##
-{ 'enum': 'LostTickPolicy',
-  'data': ['discard', 'delay', 'merge', 'slew' ] }
-
-##
-# @add_client:
-#
-# Allow client connections for VNC, Spice and socket based
-# character devices to be passed in to QEMU via SCM_RIGHTS.
-#
-# @protocol: protocol name. Valid names are "vnc", "spice" or the
-#            name of a character device (eg. from -chardev id=XXXX)
-#
-# @fdname: file descriptor name previously passed via 'getfd' command
-#
-# @skipauth: whether to skip authentication. Only applies
-#            to "vnc" and "spice" protocols
-#
-# @tls: whether to perform TLS. Only applies to the "spice"
-#       protocol
-#
-# Returns: nothing on success.
-#
-# Since: 0.14.0
-#
-# Example:
-#
-# -> { "execute": "add_client", "arguments": { "protocol": "vnc",
-#                                              "fdname": "myclient" } }
-# <- { "return": {} }
-#
-##
-{ 'command': 'add_client',
-  'data': { 'protocol': 'str', 'fdname': 'str', '*skipauth': 'bool',
-            '*tls': 'bool' } }
-
-##
-# @NameInfo:
-#
-# Guest name information.
-#
-# @name: The name of the guest
-#
-# Since: 0.14.0
-##
-{ 'struct': 'NameInfo', 'data': {'*name': 'str'} }
-
-##
-# @query-name:
-#
-# Return the name information of a guest.
-#
-# Returns: @NameInfo of the guest
-#
-# Since: 0.14.0
-#
-# Example:
-#
-# -> { "execute": "query-name" }
-# <- { "return": { "name": "qemu-name" } }
-#
-##
-{ 'command': 'query-name', 'returns': 'NameInfo' }
-
-##
-# @KvmInfo:
-#
-# Information about support for KVM acceleration
-#
-# @enabled: true if KVM acceleration is active
-#
-# @present: true if KVM acceleration is built into this executable
-#
-# Since: 0.14.0
-##
-{ 'struct': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool'} }
-
-##
-# @query-kvm:
-#
-# Returns information about KVM acceleration
-#
-# Returns: @KvmInfo
-#
-# Since: 0.14.0
-#
-# Example:
-#
-# -> { "execute": "query-kvm" }
-# <- { "return": { "enabled": true, "present": true } }
-#
-##
-{ 'command': 'query-kvm', 'returns': 'KvmInfo' }
-
-##
-# @UuidInfo:
-#
-# Guest UUID information (Universally Unique Identifier).
-#
-# @UUID: the UUID of the guest
-#
-# Since: 0.14.0
-#
-# Notes: If no UUID was specified for the guest, a null UUID is returned.
-##
-{ 'struct': 'UuidInfo', 'data': {'UUID': 'str'} }
-
-##
-# @query-uuid:
-#
-# Query the guest UUID information.
-#
-# Returns: The @UuidInfo for the guest
-#
-# Since: 0.14.0
-#
-# Example:
-#
-# -> { "execute": "query-uuid" }
-# <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
-#
-##
-{ 'command': 'query-uuid', 'returns': 'UuidInfo' }
-
-##
-# @EventInfo:
-#
-# Information about a QMP event
-#
-# @name: The event name
-#
-# Since: 1.2.0
-##
-{ 'struct': 'EventInfo', 'data': {'name': 'str'} }
-
-##
-# @query-events:
-#
-# Return a list of supported QMP events by this server
-#
-# Returns: A list of @EventInfo for all supported events
-#
-# Since: 1.2.0
-#
-# Example:
-#
-# -> { "execute": "query-events" }
-# <- {
-#      "return": [
-#          {
-#             "name":"SHUTDOWN"
-#          },
-#          {
-#             "name":"RESET"
-#          }
-#       ]
-#    }
-#
-# Note: This example has been shortened as the real response is too long.
-#
-##
-{ 'command': 'query-events', 'returns': ['EventInfo'] }
-
-##
-# @CpuInfoArch:
-#
-# An enumeration of cpu types that enable additional information during
-# @query-cpus.
-#
-# Since: 2.6
-##
-{ 'enum': 'CpuInfoArch',
-  'data': ['x86', 'sparc', 'ppc', 'mips', 'tricore', 'other' ] }
-
-##
-# @CpuInfo:
-#
-# Information about a virtual CPU
-#
-# @CPU: the index of the virtual CPU
-#
-# @current: this only exists for backwards compatibility and should be ignored
-#
-# @halted: true if the virtual CPU is in the halt state.  Halt usually refers
-#          to a processor specific low power mode.
-#
-# @qom_path: path to the CPU object in the QOM tree (since 2.4)
-#
-# @thread_id: ID of the underlying host thread
-#
-# @props: properties describing to which node/socket/core/thread
-#         virtual CPU belongs to, provided if supported by board (since 2.10)
-#
-# @arch: architecture of the cpu, which determines which additional fields
-#        will be listed (since 2.6)
-#
-# Since: 0.14.0
-#
-# Notes: @halted is a transient state that changes frequently.  By the time the
-#        data is sent to the client, the guest may no longer be halted.
-##
-{ 'union': 'CpuInfo',
-  'base': {'CPU': 'int', 'current': 'bool', 'halted': 'bool',
-           'qom_path': 'str', 'thread_id': 'int',
-           '*props': 'CpuInstanceProperties', 'arch': 'CpuInfoArch' },
-  'discriminator': 'arch',
-  'data': { 'x86': 'CpuInfoX86',
-            'sparc': 'CpuInfoSPARC',
-            'ppc': 'CpuInfoPPC',
-            'mips': 'CpuInfoMIPS',
-            'tricore': 'CpuInfoTricore',
-            'other': 'CpuInfoOther' } }
-
-##
-# @CpuInfoX86:
-#
-# Additional information about a virtual i386 or x86_64 CPU
-#
-# @pc: the 64-bit instruction pointer
-#
-# Since: 2.6
-##
-{ 'struct': 'CpuInfoX86', 'data': { 'pc': 'int' } }
-
-##
-# @CpuInfoSPARC:
-#
-# Additional information about a virtual SPARC CPU
-#
-# @pc: the PC component of the instruction pointer
-#
-# @npc: the NPC component of the instruction pointer
-#
-# Since: 2.6
-##
-{ 'struct': 'CpuInfoSPARC', 'data': { 'pc': 'int', 'npc': 'int' } }
-
-##
-# @CpuInfoPPC:
-#
-# Additional information about a virtual PPC CPU
-#
-# @nip: the instruction pointer
-#
-# Since: 2.6
-##
-{ 'struct': 'CpuInfoPPC', 'data': { 'nip': 'int' } }
-
-##
-# @CpuInfoMIPS:
-#
-# Additional information about a virtual MIPS CPU
-#
-# @PC: the instruction pointer
-#
-# Since: 2.6
-##
-{ 'struct': 'CpuInfoMIPS', 'data': { 'PC': 'int' } }
-
-##
-# @CpuInfoTricore:
-#
-# Additional information about a virtual Tricore CPU
-#
-# @PC: the instruction pointer
-#
-# Since: 2.6
-##
-{ 'struct': 'CpuInfoTricore', 'data': { 'PC': 'int' } }
-
-##
-# @CpuInfoOther:
-#
-# No additional information is available about the virtual CPU
-#
-# Since: 2.6
-#
-##
-{ 'struct': 'CpuInfoOther', 'data': { } }
-
-##
-# @query-cpus:
-#
-# Returns a list of information about each virtual CPU.
-#
-# Returns: a list of @CpuInfo for each virtual CPU
-#
-# Since: 0.14.0
-#
-# Example:
-#
-# -> { "execute": "query-cpus" }
-# <- { "return": [
-#          {
-#             "CPU":0,
-#             "current":true,
-#             "halted":false,
-#             "qom_path":"/machine/unattached/device[0]",
-#             "arch":"x86",
-#             "pc":3227107138,
-#             "thread_id":3134
-#          },
-#          {
-#             "CPU":1,
-#             "current":false,
-#             "halted":true,
-#             "qom_path":"/machine/unattached/device[2]",
-#             "arch":"x86",
-#             "pc":7108165,
-#             "thread_id":3135
-#          }
-#       ]
-#    }
-#
-##
-{ 'command': 'query-cpus', 'returns': ['CpuInfo'] }
-
-##
-# @IOThreadInfo:
-#
-# Information about an iothread
-#
-# @id: the identifier of the iothread
-#
-# @thread-id: ID of the underlying host thread
-#
-# @poll-max-ns: maximum polling time in ns, 0 means polling is disabled
-#               (since 2.9)
-#
-# @poll-grow: how many ns will be added to polling time, 0 means that it's not
-#             configured (since 2.9)
-#
-# @poll-shrink: how many ns will be removed from polling time, 0 means that
-#               it's not configured (since 2.9)
-#
-# Since: 2.0
-##
-{ 'struct': 'IOThreadInfo',
-  'data': {'id': 'str',
-           'thread-id': 'int',
-           'poll-max-ns': 'int',
-           'poll-grow': 'int',
-           'poll-shrink': 'int' } }
-
-##
-# @query-iothreads:
-#
-# Returns a list of information about each iothread.
-#
-# Note: this list excludes the QEMU main loop thread, which is not declared
-# using the -object iothread command-line option.  It is always the main thread
-# of the process.
-#
-# Returns: a list of @IOThreadInfo for each iothread
-#
-# Since: 2.0
-#
-# Example:
-#
-# -> { "execute": "query-iothreads" }
-# <- { "return": [
-#          {
-#             "id":"iothread0",
-#             "thread-id":3134
-#          },
-#          {
-#             "id":"iothread1",
-#             "thread-id":3135
-#          }
-#       ]
-#    }
-#
-##
-{ 'command': 'query-iothreads', 'returns': ['IOThreadInfo'] }
-
-##
-# @BalloonInfo:
-#
-# Information about the guest balloon device.
-#
-# @actual: the number of bytes the balloon currently contains
-#
-# Since: 0.14.0
-#
-##
-{ 'struct': 'BalloonInfo', 'data': {'actual': 'int' } }
-
-##
-# @query-balloon:
-#
-# Return information about the balloon device.
-#
-# Returns: @BalloonInfo on success
-#
-#          If the balloon driver is enabled but not functional because the KVM
-#          kernel module cannot support it, KvmMissingCap
-#
-#          If no balloon device is present, DeviceNotActive
-#
-# Since: 0.14.0
-#
-# Example:
-#
-# -> { "execute": "query-balloon" }
-# <- { "return": {
-#          "actual": 1073741824,
-#       }
-#    }
-#
-##
-{ 'command': 'query-balloon', 'returns': 'BalloonInfo' }
-
-##
-# @BALLOON_CHANGE:
-#
-# Emitted when the guest changes the actual BALLOON level. This value is
-# equivalent to the @actual field return by the 'query-balloon' command
-#
-# @actual: actual level of the guest memory balloon in bytes
-#
-# Note: this event is rate-limited.
-#
-# Since: 1.2
-#
-# Example:
-#
-# <- { "event": "BALLOON_CHANGE",
-#      "data": { "actual": 944766976 },
-#      "timestamp": { "seconds": 1267020223, "microseconds": 435656 } }
-#
-##
-{ 'event': 'BALLOON_CHANGE',
-  'data': { 'actual': 'int' } }
-
-##
-# @PciMemoryRange:
-#
-# A PCI device memory region
-#
-# @base: the starting address (guest physical)
-#
-# @limit: the ending address (guest physical)
-#
-# Since: 0.14.0
-##
-{ 'struct': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} }
-
-##
-# @PciMemoryRegion:
-#
-# Information about a PCI device I/O region.
-#
-# @bar: the index of the Base Address Register for this region
-#
-# @type: 'io' if the region is a PIO region
-#        'memory' if the region is a MMIO region
-#
-# @size: memory size
-#
-# @prefetch: if @type is 'memory', true if the memory is prefetchable
-#
-# @mem_type_64: if @type is 'memory', true if the BAR is 64-bit
-#
-# Since: 0.14.0
-##
-{ 'struct': 'PciMemoryRegion',
-  'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int',
-           '*prefetch': 'bool', '*mem_type_64': 'bool' } }
-
-##
-# @PciBusInfo:
-#
-# Information about a bus of a PCI Bridge device
-#
-# @number: primary bus interface number.  This should be the number of the
-#          bus the device resides on.
-#
-# @secondary: secondary bus interface number.  This is the number of the
-#             main bus for the bridge
-#
-# @subordinate: This is the highest number bus that resides below the
-#               bridge.
-#
-# @io_range: The PIO range for all devices on this bridge
-#
-# @memory_range: The MMIO range for all devices on this bridge
-#
-# @prefetchable_range: The range of prefetchable MMIO for all devices on
-#                      this bridge
-#
-# Since: 2.4
-##
-{ 'struct': 'PciBusInfo',
-  'data': {'number': 'int', 'secondary': 'int', 'subordinate': 'int',
-           'io_range': 'PciMemoryRange',
-           'memory_range': 'PciMemoryRange',
-           'prefetchable_range': 'PciMemoryRange' } }
-
-##
-# @PciBridgeInfo:
-#
-# Information about a PCI Bridge device
-#
-# @bus: information about the bus the device resides on
-#
-# @devices: a list of @PciDeviceInfo for each device on this bridge
-#
-# Since: 0.14.0
-##
-{ 'struct': 'PciBridgeInfo',
-  'data': {'bus': 'PciBusInfo', '*devices': ['PciDeviceInfo']} }
-
-##
-# @PciDeviceClass:
-#
-# Information about the Class of a PCI device
-#
-# @desc: a string description of the device's class
-#
-# @class: the class code of the device
-#
-# Since: 2.4
-##
-{ 'struct': 'PciDeviceClass',
-  'data': {'*desc': 'str', 'class': 'int'} }
-
-##
-# @PciDeviceId:
-#
-# Information about the Id of a PCI device
-#
-# @device: the PCI device id
-#
-# @vendor: the PCI vendor id
-#
-# Since: 2.4
-##
-{ 'struct': 'PciDeviceId',
-  'data': {'device': 'int', 'vendor': 'int'} }
-
-##
-# @PciDeviceInfo:
-#
-# Information about a PCI device
-#
-# @bus: the bus number of the device
-#
-# @slot: the slot the device is located in
-#
-# @function: the function of the slot used by the device
-#
-# @class_info: the class of the device
-#
-# @id: the PCI device id
-#
-# @irq: if an IRQ is assigned to the device, the IRQ number
-#
-# @qdev_id: the device name of the PCI device
-#
-# @pci_bridge: if the device is a PCI bridge, the bridge information
-#
-# @regions: a list of the PCI I/O regions associated with the device
-#
-# Notes: the contents of @class_info.desc are not stable and should only be
-#        treated as informational.
-#
-# Since: 0.14.0
-##
-{ 'struct': 'PciDeviceInfo',
-  'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
-           'class_info': 'PciDeviceClass', 'id': 'PciDeviceId',
-           '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo',
-           'regions': ['PciMemoryRegion']} }
-
-##
-# @PciInfo:
-#
-# Information about a PCI bus
-#
-# @bus: the bus index
-#
-# @devices: a list of devices on this bus
-#
-# Since: 0.14.0
-##
-{ 'struct': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
-
-##
-# @query-pci:
-#
-# Return information about the PCI bus topology of the guest.
-#
-# Returns: a list of @PciInfo for each PCI bus. Each bus is
-# represented by a json-object, which has a key with a json-array of
-# all PCI devices attached to it. Each device is represented by a
-# json-object.
-#
-# Since: 0.14.0
-#
-# Example:
-#
-# -> { "execute": "query-pci" }
-# <- { "return": [
-#          {
-#             "bus": 0,
-#             "devices": [
-#                {
-#                   "bus": 0,
-#                   "qdev_id": "",
-#                   "slot": 0,
-#                   "class_info": {
-#                      "class": 1536,
-#                      "desc": "Host bridge"
-#                   },
-#                   "id": {
-#                      "device": 32902,
-#                      "vendor": 4663
-#                   },
-#                   "function": 0,
-#                   "regions": [
-#                   ]
-#                },
-#                {
-#                   "bus": 0,
-#                   "qdev_id": "",
-#                   "slot": 1,
-#                   "class_info": {
-#                      "class": 1537,
-#                      "desc": "ISA bridge"
-#                   },
-#                   "id": {
-#                      "device": 32902,
-#                      "vendor": 28672
-#                   },
-#                   "function": 0,
-#                   "regions": [
-#                   ]
-#                },
-#                {
-#                   "bus": 0,
-#                   "qdev_id": "",
-#                   "slot": 1,
-#                   "class_info": {
-#                      "class": 257,
-#                      "desc": "IDE controller"
-#                   },
-#                   "id": {
-#                      "device": 32902,
-#                      "vendor": 28688
-#                   },
-#                   "function": 1,
-#                   "regions": [
-#                      {
-#                         "bar": 4,
-#                         "size": 16,
-#                         "address": 49152,
-#                         "type": "io"
-#                      }
-#                   ]
-#                },
-#                {
-#                   "bus": 0,
-#                   "qdev_id": "",
-#                   "slot": 2,
-#                   "class_info": {
-#                      "class": 768,
-#                      "desc": "VGA controller"
-#                   },
-#                   "id": {
-#                      "device": 4115,
-#                      "vendor": 184
-#                   },
-#                   "function": 0,
-#                   "regions": [
-#                      {
-#                         "prefetch": true,
-#                         "mem_type_64": false,
-#                         "bar": 0,
-#                         "size": 33554432,
-#                         "address": 4026531840,
-#                         "type": "memory"
-#                      },
-#                      {
-#                         "prefetch": false,
-#                         "mem_type_64": false,
-#                         "bar": 1,
-#                         "size": 4096,
-#                         "address": 4060086272,
-#                         "type": "memory"
-#                      },
-#                      {
-#                         "prefetch": false,
-#                         "mem_type_64": false,
-#                         "bar": 6,
-#                         "size": 65536,
-#                         "address": -1,
-#                         "type": "memory"
-#                      }
-#                   ]
-#                },
-#                {
-#                   "bus": 0,
-#                   "qdev_id": "",
-#                   "irq": 11,
-#                   "slot": 4,
-#                   "class_info": {
-#                      "class": 1280,
-#                      "desc": "RAM controller"
-#                   },
-#                   "id": {
-#                      "device": 6900,
-#                      "vendor": 4098
-#                   },
-#                   "function": 0,
-#                   "regions": [
-#                      {
-#                         "bar": 0,
-#                         "size": 32,
-#                         "address": 49280,
-#                         "type": "io"
-#                      }
-#                   ]
-#                }
-#             ]
-#          }
-#       ]
-#    }
-#
-# Note: This example has been shortened as the real response is too long.
-#
-##
-{ 'command': 'query-pci', 'returns': ['PciInfo'] }
-
-##
-# @quit:
-#
-# This command will cause the QEMU process to exit gracefully.  While every
-# attempt is made to send the QMP response before terminating, this is not
-# guaranteed.  When using this interface, a premature EOF would not be
-# unexpected.
-#
-# Since: 0.14.0
-#
-# Example:
-#
-# -> { "execute": "quit" }
-# <- { "return": {} }
-##
-{ 'command': 'quit' }
-
-##
-# @stop:
-#
-# Stop all guest VCPU execution.
-#
-# Since:  0.14.0
-#
-# Notes:  This function will succeed even if the guest is already in the stopped
-#         state.  In "inmigrate" state, it will ensure that the guest
-#         remains paused once migration finishes, as if the -S option was
-#         passed on the command line.
-#
-# Example:
-#
-# -> { "execute": "stop" }
-# <- { "return": {} }
-#
-##
-{ 'command': 'stop' }
-
-##
-# @system_reset:
-#
-# Performs a hard reset of a guest.
-#
-# Since: 0.14.0
-#
-# Example:
-#
-# -> { "execute": "system_reset" }
-# <- { "return": {} }
-#
-##
-{ 'command': 'system_reset' }
-
-##
-# @system_powerdown:
-#
-# Requests that a guest perform a powerdown operation.
-#
-# Since: 0.14.0
-#
-# Notes: A guest may or may not respond to this command.  This command
-#        returning does not indicate that a guest has accepted the request or
-#        that it has shut down.  Many guests will respond to this command by
-#        prompting the user in some way.
-# Example:
-#
-# -> { "execute": "system_powerdown" }
-# <- { "return": {} }
-#
-##
-{ 'command': 'system_powerdown' }
-
-##
-# @cpu-add:
-#
-# Adds CPU with specified ID
-#
-# @id: ID of CPU to be created, valid values [0..max_cpus)
-#
-# Returns: Nothing on success
-#
-# Since: 1.5
-#
-# Example:
-#
-# -> { "execute": "cpu-add", "arguments": { "id": 2 } }
-# <- { "return": {} }
-#
-##
-{ 'command': 'cpu-add', 'data': {'id': 'int'} }
-
-##
-# @memsave:
-#
-# Save a portion of guest memory to a file.
-#
-# @val: the virtual address of the guest to start from
-#
-# @size: the size of memory region to save
-#
-# @filename: the file to save the memory to as binary data
-#
-# @cpu-index: the index of the virtual CPU to use for translating the
-#                       virtual address (defaults to CPU 0)
-#
-# Returns: Nothing on success
-#
-# Since: 0.14.0
-#
-# Notes: Errors were not reliably returned until 1.1
-#
-# Example:
-#
-# -> { "execute": "memsave",
-#      "arguments": { "val": 10,
-#                     "size": 100,
-#                     "filename": "/tmp/virtual-mem-dump" } }
-# <- { "return": {} }
-#
-##
-{ 'command': 'memsave',
-  'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
-
-##
-# @pmemsave:
-#
-# Save a portion of guest physical memory to a file.
-#
-# @val: the physical address of the guest to start from
-#
-# @size: the size of memory region to save
-#
-# @filename: the file to save the memory to as binary data
-#
-# Returns: Nothing on success
-#
-# Since: 0.14.0
-#
-# Notes: Errors were not reliably returned until 1.1
-#
-# Example:
-#
-# -> { "execute": "pmemsave",
-#      "arguments": { "val": 10,
-#                     "size": 100,
-#                     "filename": "/tmp/physical-mem-dump" } }
-# <- { "return": {} }
-#
-##
-{ 'command': 'pmemsave',
-  'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
-
-##
-# @cont:
-#
-# Resume guest VCPU execution.
-#
-# Since:  0.14.0
-#
-# Returns:  If successful, nothing
-#
-# Notes:  This command will succeed if the guest is currently running.  It
-#         will also succeed if the guest is in the "inmigrate" state; in
-#         this case, the effect of the command is to make sure the guest
-#         starts once migration finishes, removing the effect of the -S
-#         command line option if it was passed.
-#
-# Example:
-#
-# -> { "execute": "cont" }
-# <- { "return": {} }
-#
-##
-{ 'command': 'cont' }
-
-##
-# @system_wakeup:
-#
-# Wakeup guest from suspend.  Does nothing in case the guest isn't suspended.
-#
-# Since:  1.1
-#
-# Returns:  nothing.
-#
-# Example:
-#
-# -> { "execute": "system_wakeup" }
-# <- { "return": {} }
-#
-##
-{ 'command': 'system_wakeup' }
-
-##
-# @inject-nmi:
-#
-# Injects a Non-Maskable Interrupt into the default CPU (x86/s390) or all CPUs (ppc64).
-# The command fails when the guest doesn't support injecting.
-#
-# Returns:  If successful, nothing
-#
-# Since:  0.14.0
-#
-# Note: prior to 2.1, this command was only supported for x86 and s390 VMs
-#
-# Example:
-#
-# -> { "execute": "inject-nmi" }
-# <- { "return": {} }
-#
-##
-{ 'command': 'inject-nmi' }
-
-##
-# @balloon:
-#
-# Request the balloon driver to change its balloon size.
-#
-# @value: the target size of the balloon in bytes
-#
-# Returns: Nothing on success
-#          If the balloon driver is enabled but not functional because the KVM
-#            kernel module cannot support it, KvmMissingCap
-#          If no balloon device is present, DeviceNotActive
-#
-# Notes: This command just issues a request to the guest.  When it returns,
-#        the balloon size may not have changed.  A guest can change the balloon
-#        size independent of this command.
-#
-# Since: 0.14.0
-#
-# Example:
-#
-# -> { "execute": "balloon", "arguments": { "value": 536870912 } }
-# <- { "return": {} }
-#
-##
-{ 'command': 'balloon', 'data': {'value': 'int'} }
-
-##
-# @human-monitor-command:
-#
-# Execute a command on the human monitor and return the output.
-#
-# @command-line: the command to execute in the human monitor
-#
-# @cpu-index: The CPU to use for commands that require an implicit CPU
-#
-# Returns: the output of the command as a string
-#
-# Since: 0.14.0
-#
-# Notes: This command only exists as a stop-gap.  Its use is highly
-#        discouraged.  The semantics of this command are not
-#        guaranteed: this means that command names, arguments and
-#        responses can change or be removed at ANY time.  Applications
-#        that rely on long term stability guarantees should NOT
-#        use this command.
-#
-#        Known limitations:
-#
-#        * This command is stateless, this means that commands that depend
-#          on state information (such as getfd) might not work
-#
-#        * Commands that prompt the user for data don't currently work
-#
-# Example:
-#
-# -> { "execute": "human-monitor-command",
-#      "arguments": { "command-line": "info kvm" } }
-# <- { "return": "kvm support: enabled\r\n" }
-#
-##
-{ 'command': 'human-monitor-command',
-  'data': {'command-line': 'str', '*cpu-index': 'int'},
-  'returns': 'str' }
-
-##
-# @ObjectPropertyInfo:
-#
-# @name: the name of the property
-#
-# @type: the type of the property.  This will typically come in one of four
-#        forms:
-#
-#        1) A primitive type such as 'u8', 'u16', 'bool', 'str', or 'double'.
-#           These types are mapped to the appropriate JSON type.
-#
-#        2) A child type in the form 'child<subtype>' where subtype is a qdev
-#           device type name.  Child properties create the composition tree.
-#
-#        3) A link type in the form 'link<subtype>' where subtype is a qdev
-#           device type name.  Link properties form the device model graph.
-#
-# Since: 1.2
-##
-{ 'struct': 'ObjectPropertyInfo',
-  'data': { 'name': 'str', 'type': 'str' } }
-
-##
-# @qom-list:
-#
-# This command will list any properties of a object given a path in the object
-# model.
-#
-# @path: the path within the object model.  See @qom-get for a description of
-#        this parameter.
-#
-# Returns: a list of @ObjectPropertyInfo that describe the properties of the
-#          object.
-#
-# Since: 1.2
-##
-{ 'command': 'qom-list',
-  'data': { 'path': 'str' },
-  'returns': [ 'ObjectPropertyInfo' ] }
-
-##
-# @qom-get:
-#
-# This command will get a property from a object model path and return the
-# value.
-#
-# @path: The path within the object model.  There are two forms of supported
-#        paths--absolute and partial paths.
-#
-#        Absolute paths are derived from the root object and can follow child<>
-#        or link<> properties.  Since they can follow link<> properties, they
-#        can be arbitrarily long.  Absolute paths look like absolute filenames
-#        and are prefixed  with a leading slash.
-#
-#        Partial paths look like relative filenames.  They do not begin
-#        with a prefix.  The matching rules for partial paths are subtle but
-#        designed to make specifying objects easy.  At each level of the
-#        composition tree, the partial path is matched as an absolute path.
-#        The first match is not returned.  At least two matches are searched
-#        for.  A successful result is only returned if only one match is
-#        found.  If more than one match is found, a flag is return to
-#        indicate that the match was ambiguous.
-#
-# @property: The property name to read
-#
-# Returns: The property value.  The type depends on the property
-#          type. child<> and link<> properties are returned as #str
-#          pathnames.  All integer property types (u8, u16, etc) are
-#          returned as #int.
-#
-# Since: 1.2
-##
-{ 'command': 'qom-get',
-  'data': { 'path': 'str', 'property': 'str' },
-  'returns': 'any' }
-
-##
-# @qom-set:
-#
-# This command will set a property from a object model path.
-#
-# @path: see @qom-get for a description of this parameter
-#
-# @property: the property name to set
-#
-# @value: a value who's type is appropriate for the property type.  See @qom-get
-#         for a description of type mapping.
-#
-# Since: 1.2
-##
-{ 'command': 'qom-set',
-  'data': { 'path': 'str', 'property': 'str', 'value': 'any' } }
-
-##
-# @change:
-#
-# This command is multiple commands multiplexed together.
-#
-# @device: This is normally the name of a block device but it may also be 'vnc'.
-#          when it's 'vnc', then sub command depends on @target
-#
-# @target: If @device is a block device, then this is the new filename.
-#          If @device is 'vnc', then if the value 'password' selects the vnc
-#          change password command.   Otherwise, this specifies a new server URI
-#          address to listen to for VNC connections.
-#
-# @arg:    If @device is a block device, then this is an optional format to open
-#          the device with.
-#          If @device is 'vnc' and @target is 'password', this is the new VNC
-#          password to set.  See change-vnc-password for additional notes.
-#
-# Returns: Nothing on success.
-#          If @device is not a valid block device, DeviceNotFound
-#
-# Notes:  This interface is deprecated, and it is strongly recommended that you
-#         avoid using it.  For changing block devices, use
-#         blockdev-change-medium; for changing VNC parameters, use
-#         change-vnc-password.
-#
-# Since: 0.14.0
-#
-# Example:
-#
-# 1. Change a removable medium
-#
-# -> { "execute": "change",
-#      "arguments": { "device": "ide1-cd0",
-#                     "target": "/srv/images/Fedora-12-x86_64-DVD.iso" } }
-# <- { "return": {} }
-#
-# 2. Change VNC password
-#
-# -> { "execute": "change",
-#      "arguments": { "device": "vnc", "target": "password",
-#                     "arg": "foobar1" } }
-# <- { "return": {} }
-#
-##
-{ 'command': 'change',
-  'data': {'device': 'str', 'target': 'str', '*arg': 'str'} }
-
-##
-# @ObjectTypeInfo:
-#
-# This structure describes a search result from @qom-list-types
-#
-# @name: the type name found in the search
-#
-# @abstract: the type is abstract and can't be directly instantiated.
-#            Omitted if false. (since 2.10)
-#
-# @parent: Name of parent type, if any (since 2.10)
-#
-# Since: 1.1
-##
-{ 'struct': 'ObjectTypeInfo',
-  'data': { 'name': 'str', '*abstract': 'bool', '*parent': 'str' } }
-
-##
-# @qom-list-types:
-#
-# This command will return a list of types given search parameters
-#
-# @implements: if specified, only return types that implement this type name
-#
-# @abstract: if true, include abstract types in the results
-#
-# Returns: a list of @ObjectTypeInfo or an empty list if no results are found
-#
-# Since: 1.1
-##
-{ 'command': 'qom-list-types',
-  'data': { '*implements': 'str', '*abstract': 'bool' },
-  'returns': [ 'ObjectTypeInfo' ] }
-
-##
-# @DevicePropertyInfo:
-#
-# Information about device properties.
-#
-# @name: the name of the property
-# @type: the typename of the property
-# @description: if specified, the description of the property.
-#               (since 2.2)
-#
-# Since: 1.2
-##
-{ 'struct': 'DevicePropertyInfo',
-  'data': { 'name': 'str', 'type': 'str', '*description': 'str' } }
-
-##
-# @device-list-properties:
-#
-# List properties associated with a device.
-#
-# @typename: the type name of a device
-#
-# Returns: a list of DevicePropertyInfo describing a devices properties
-#
-# Since: 1.2
-##
-{ 'command': 'device-list-properties',
-  'data': { 'typename': 'str'},
-  'returns': [ 'DevicePropertyInfo' ] }
-
-##
-# @xen-set-global-dirty-log:
-#
-# Enable or disable the global dirty log mode.
-#
-# @enable: true to enable, false to disable.
-#
-# Returns: nothing
-#
-# Since: 1.3
-#
-# Example:
-#
-# -> { "execute": "xen-set-global-dirty-log",
-#      "arguments": { "enable": true } }
-# <- { "return": {} }
-#
-##
-{ 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
-
-##
-# @device_add:
-#
-# @driver: the name of the new device's driver
-#
-# @bus: the device's parent bus (device tree path)
-#
-# @id: the device's ID, must be unique
-#
-# Additional arguments depend on the type.
-#
-# Add a device.
-#
-# Notes:
-# 1. For detailed information about this command, please refer to the
-#    'docs/qdev-device-use.txt' file.
-#
-# 2. It's possible to list device properties by running QEMU with the
-#    "-device DEVICE,help" command-line argument, where DEVICE is the
-#    device's name
-#
-# Example:
-#
-# -> { "execute": "device_add",
-#      "arguments": { "driver": "e1000", "id": "net1",
-#                     "bus": "pci.0",
-#                     "mac": "52:54:00:12:34:56" } }
-# <- { "return": {} }
-#
-# TODO: This command effectively bypasses QAPI completely due to its
-# "additional arguments" business.  It shouldn't have been added to
-# the schema in this form.  It should be qapified properly, or
-# replaced by a properly qapified command.
-#
-# Since: 0.13
-##
-{ 'command': 'device_add',
-  'data': {'driver': 'str', '*bus': 'str', '*id': 'str'},
-  'gen': false } # so we can get the additional arguments
-
-##
-# @device_del:
-#
-# Remove a device from a guest
-#
-# @id: the device's ID or QOM path
-#
-# Returns: Nothing on success
-#          If @id is not a valid device, DeviceNotFound
-#
-# Notes: When this command completes, the device may not be removed from the
-#        guest.  Hot removal is an operation that requires guest cooperation.
-#        This command merely requests that the guest begin the hot removal
-#        process.  Completion of the device removal process is signaled with a
-#        DEVICE_DELETED event. Guest reset will automatically complete removal
-#        for all devices.
-#
-# Since: 0.14.0
-#
-# Example:
-#
-# -> { "execute": "device_del",
-#      "arguments": { "id": "net1" } }
-# <- { "return": {} }
-#
-# -> { "execute": "device_del",
-#      "arguments": { "id": "/machine/peripheral-anon/device[0]" } }
-# <- { "return": {} }
-#
-##
-{ 'command': 'device_del', 'data': {'id': 'str'} }
-
-##
-# @DEVICE_DELETED:
-#
-# Emitted whenever the device removal completion is acknowledged by the guest.
-# At this point, it's safe to reuse the specified device ID. Device removal can
-# be initiated by the guest or by HMP/QMP commands.
-#
-# @device: device name
-#
-# @path: device path
-#
-# Since: 1.5
-#
-# Example:
-#
-# <- { "event": "DEVICE_DELETED",
-#      "data": { "device": "virtio-net-pci-0",
-#                "path": "/machine/peripheral/virtio-net-pci-0" },
-#      "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
-#
-##
-{ 'event': 'DEVICE_DELETED',
-  'data': { '*device': 'str', 'path': 'str' } }
-
-##
-# @DumpGuestMemoryFormat:
-#
-# An enumeration of guest-memory-dump's format.
-#
-# @elf: elf format
-#
-# @kdump-zlib: kdump-compressed format with zlib-compressed
-#
-# @kdump-lzo: kdump-compressed format with lzo-compressed
-#
-# @kdump-snappy: kdump-compressed format with snappy-compressed
-#
-# Since: 2.0
-##
-{ 'enum': 'DumpGuestMemoryFormat',
-  'data': [ 'elf', 'kdump-zlib', 'kdump-lzo', 'kdump-snappy' ] }
-
-##
-# @dump-guest-memory:
-#
-# Dump guest's memory to vmcore. It is a synchronous operation that can take
-# very long depending on the amount of guest memory.
-#
-# @paging: if true, do paging to get guest's memory mapping. This allows
-#          using gdb to process the core file.
-#
-#          IMPORTANT: this option can make QEMU allocate several gigabytes
-#                     of RAM. This can happen for a large guest, or a
-#                     malicious guest pretending to be large.
-#
-#          Also, paging=true has the following limitations:
-#
-#             1. The guest may be in a catastrophic state or can have corrupted
-#                memory, which cannot be trusted
-#             2. The guest can be in real-mode even if paging is enabled. For
-#                example, the guest uses ACPI to sleep, and ACPI sleep state
-#                goes in real-mode
-#             3. Currently only supported on i386 and x86_64.
-#
-# @protocol: the filename or file descriptor of the vmcore. The supported
-#            protocols are:
-#
-#            1. file: the protocol starts with "file:", and the following
-#               string is the file's path.
-#            2. fd: the protocol starts with "fd:", and the following string
-#               is the fd's name.
-#
-# @detach: if true, QMP will return immediately rather than
-#          waiting for the dump to finish. The user can track progress
-#          using "query-dump". (since 2.6).
-#
-# @begin: if specified, the starting physical address.
-#
-# @length: if specified, the memory size, in bytes. If you don't
-#          want to dump all guest's memory, please specify the start @begin
-#          and @length
-#
-# @format: if specified, the format of guest memory dump. But non-elf
-#          format is conflict with paging and filter, ie. @paging, @begin and
-#          @length is not allowed to be specified with non-elf @format at the
-#          same time (since 2.0)
-#
-# Note: All boolean arguments default to false
-#
-# Returns: nothing on success
-#
-# Since: 1.2
-#
-# Example:
-#
-# -> { "execute": "dump-guest-memory",
-#      "arguments": { "protocol": "fd:dump" } }
-# <- { "return": {} }
-#
-##
-{ 'command': 'dump-guest-memory',
-  'data': { 'paging': 'bool', 'protocol': 'str', '*detach': 'bool',
-            '*begin': 'int', '*length': 'int',
-            '*format': 'DumpGuestMemoryFormat'} }
-
-##
-# @DumpStatus:
-#
-# Describe the status of a long-running background guest memory dump.
-#
-# @none: no dump-guest-memory has started yet.
-#
-# @active: there is one dump running in background.
-#
-# @completed: the last dump has finished successfully.
-#
-# @failed: the last dump has failed.
-#
-# Since: 2.6
-##
-{ 'enum': 'DumpStatus',
-  'data': [ 'none', 'active', 'completed', 'failed' ] }
-
-##
-# @DumpQueryResult:
-#
-# The result format for 'query-dump'.
-#
-# @status: enum of @DumpStatus, which shows current dump status
-#
-# @completed: bytes written in latest dump (uncompressed)
-#
-# @total: total bytes to be written in latest dump (uncompressed)
-#
-# Since: 2.6
-##
-{ 'struct': 'DumpQueryResult',
-  'data': { 'status': 'DumpStatus',
-            'completed': 'int',
-            'total': 'int' } }
-
-##
-# @query-dump:
-#
-# Query latest dump status.
-#
-# Returns: A @DumpStatus object showing the dump status.
-#
-# Since: 2.6
-#
-# Example:
-#
-# -> { "execute": "query-dump" }
-# <- { "return": { "status": "active", "completed": 1024000,
-#                  "total": 2048000 } }
-#
-##
-{ 'command': 'query-dump', 'returns': 'DumpQueryResult' }
-
-##
-# @DUMP_COMPLETED:
-#
-# Emitted when background dump has completed
-#
-# @result: DumpQueryResult type described in qapi-schema.json.
-#
-# @error: human-readable error string that provides
-#         hint on why dump failed. Only presents on failure. The
-#         user should not try to interpret the error string.
-#
-# Since: 2.6
-#
-# Example:
-#
-# { "event": "DUMP_COMPLETED",
-#   "data": {"result": {"total": 1090650112, "status": "completed",
-#                       "completed": 1090650112} } }
-#
-##
-{ 'event': 'DUMP_COMPLETED' ,
-  'data': { 'result': 'DumpQueryResult', '*error': 'str' } }
-
-##
-# @DumpGuestMemoryCapability:
-#
-# A list of the available formats for dump-guest-memory
-#
-# Since: 2.0
-##
-{ 'struct': 'DumpGuestMemoryCapability',
-  'data': {
-      'formats': ['DumpGuestMemoryFormat'] } }
-
-##
-# @query-dump-guest-memory-capability:
-#
-# Returns the available formats for dump-guest-memory
-#
-# Returns:  A @DumpGuestMemoryCapability object listing available formats for
-#           dump-guest-memory
-#
-# Since: 2.0
-#
-# Example:
-#
-# -> { "execute": "query-dump-guest-memory-capability" }
-# <- { "return": { "formats":
-#                  ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
-#
-##
-{ 'command': 'query-dump-guest-memory-capability',
-  'returns': 'DumpGuestMemoryCapability' }
-
-##
-# @dump-skeys:
-#
-# Dump guest's storage keys
-#
-# @filename: the path to the file to dump to
-#
-# This command is only supported on s390 architecture.
-#
-# Since: 2.5
-#
-# Example:
-#
-# -> { "execute": "dump-skeys",
-#      "arguments": { "filename": "/tmp/skeys" } }
-# <- { "return": {} }
-#
-##
-{ 'command': 'dump-skeys',
-  'data': { 'filename': 'str' } }
-
-##
-# @object-add:
-#
-# Create a QOM object.
-#
-# @qom-type: the class name for the object to be created
-#
-# @id: the name of the new object
-#
-# @props: a dictionary of properties to be passed to the backend
-#
-# Returns: Nothing on success
-#          Error if @qom-type is not a valid class name
-#
-# Since: 2.0
-#
-# Example:
-#
-# -> { "execute": "object-add",
-#      "arguments": { "qom-type": "rng-random", "id": "rng1",
-#                     "props": { "filename": "/dev/hwrng" } } }
-# <- { "return": {} }
-#
-##
-{ 'command': 'object-add',
-  'data': {'qom-type': 'str', 'id': 'str', '*props': 'any'} }
-
-##
-# @object-del:
-#
-# Remove a QOM object.
-#
-# @id: the name of the QOM object to remove
-#
-# Returns: Nothing on success
-#          Error if @id is not a valid id for a QOM object
-#
-# Since: 2.0
-#
-# Example:
-#
-# -> { "execute": "object-del", "arguments": { "id": "rng1" } }
-# <- { "return": {} }
-#
-##
-{ 'command': 'object-del', 'data': {'id': 'str'} }
-
-##
-# @getfd:
-#
-# Receive a file descriptor via SCM rights and assign it a name
-#
-# @fdname: file descriptor name
-#
-# Returns: Nothing on success
-#
-# Since: 0.14.0
-#
-# Notes: If @fdname already exists, the file descriptor assigned to
-#        it will be closed and replaced by the received file
-#        descriptor.
-#
-#        The 'closefd' command can be used to explicitly close the
-#        file descriptor when it is no longer needed.
-#
-# Example:
-#
-# -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
-# <- { "return": {} }
-#
-##
-{ 'command': 'getfd', 'data': {'fdname': 'str'} }
-
-##
-# @closefd:
-#
-# Close a file descriptor previously passed via SCM rights
-#
-# @fdname: file descriptor name
-#
-# Returns: Nothing on success
-#
-# Since: 0.14.0
-#
-# Example:
-#
-# -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
-# <- { "return": {} }
-#
-##
-{ 'command': 'closefd', 'data': {'fdname': 'str'} }
-
-##
-# @MachineInfo:
-#
-# Information describing a machine.
-#
-# @name: the name of the machine
-#
-# @alias: an alias for the machine name
-#
-# @is-default: whether the machine is default
-#
-# @cpu-max: maximum number of CPUs supported by the machine type
-#           (since 1.5.0)
-#
-# @hotpluggable-cpus: cpu hotplug via -device is supported (since 2.7.0)
-#
-# Since: 1.2.0
-##
-{ 'struct': 'MachineInfo',
-  'data': { 'name': 'str', '*alias': 'str',
-            '*is-default': 'bool', 'cpu-max': 'int',
-            'hotpluggable-cpus': 'bool'} }
-
-##
-# @query-machines:
-#
-# Return a list of supported machines
-#
-# Returns: a list of MachineInfo
-#
-# Since: 1.2.0
-##
-{ 'command': 'query-machines', 'returns': ['MachineInfo'] }
-
-##
-# @CpuDefinitionInfo:
-#
-# Virtual CPU definition.
-#
-# @name: the name of the CPU definition
-#
-# @migration-safe: whether a CPU definition can be safely used for
-#                  migration in combination with a QEMU compatibility machine
-#                  when migrating between different QMU versions and between
-#                  hosts with different sets of (hardware or software)
-#                  capabilities. If not provided, information is not available
-#                  and callers should not assume the CPU definition to be
-#                  migration-safe. (since 2.8)
-#
-# @static: whether a CPU definition is static and will not change depending on
-#          QEMU version, machine type, machine options and accelerator options.
-#          A static model is always migration-safe. (since 2.8)
-#
-# @unavailable-features: List of properties that prevent
-#                        the CPU model from running in the current
-#                        host. (since 2.8)
-# @typename: Type name that can be used as argument to @device-list-properties,
-#            to introspect properties configurable using -cpu or -global.
-#            (since 2.9)
-#
-# @unavailable-features is a list of QOM property names that
-# represent CPU model attributes that prevent the CPU from running.
-# If the QOM property is read-only, that means there's no known
-# way to make the CPU model run in the current host. Implementations
-# that choose not to provide specific information return the
-# property name "type".
-# If the property is read-write, it means that it MAY be possible
-# to run the CPU model in the current host if that property is
-# changed. Management software can use it as hints to suggest or
-# choose an alternative for the user, or just to generate meaningful
-# error messages explaining why the CPU model can't be used.
-# If @unavailable-features is an empty list, the CPU model is
-# runnable using the current host and machine-type.
-# If @unavailable-features is not present, runnability
-# information for the CPU is not available.
-#
-# Since: 1.2.0
-##
-{ 'struct': 'CpuDefinitionInfo',
-  'data': { 'name': 'str', '*migration-safe': 'bool', 'static': 'bool',
-            '*unavailable-features': [ 'str' ], 'typename': 'str' } }
-
-##
-# @MemoryInfo:
-#
-# Actual memory information in bytes.
-#
-# @base-memory: size of "base" memory specified with command line
-#               option -m.
-#
-# @plugged-memory: size of memory that can be hot-unplugged. This field
-#                  is omitted if target doesn't support memory hotplug
-#                  (i.e. CONFIG_MEM_HOTPLUG not defined on build time).
-#
-# Since: 2.11.0
-##
-{ 'struct': 'MemoryInfo',
-  'data'  : { 'base-memory': 'size', '*plugged-memory': 'size' } }
-
-##
-# @query-memory-size-summary:
-#
-# Return the amount of initially allocated and present hotpluggable (if
-# enabled) memory in bytes.
-#
-# Example:
-#
-# -> { "execute": "query-memory-size-summary" }
-# <- { "return": { "base-memory": 4294967296, "plugged-memory": 0 } }
-#
-# Since: 2.11.0
-##
-{ 'command': 'query-memory-size-summary', 'returns': 'MemoryInfo' }
-
-##
-# @query-cpu-definitions:
-#
-# Return a list of supported virtual CPU definitions
-#
-# Returns: a list of CpuDefInfo
-#
-# Since: 1.2.0
-##
-{ 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'] }
-
-##
-# @CpuModelInfo:
-#
-# Virtual CPU model.
-#
-# A CPU model consists of the name of a CPU definition, to which
-# delta changes are applied (e.g. features added/removed). Most magic values
-# that an architecture might require should be hidden behind the name.
-# However, if required, architectures can expose relevant properties.
-#
-# @name: the name of the CPU definition the model is based on
-# @props: a dictionary of QOM properties to be applied
-#
-# Since: 2.8.0
-##
-{ 'struct': 'CpuModelInfo',
-  'data': { 'name': 'str',
-            '*props': 'any' } }
-
-##
-# @CpuModelExpansionType:
-#
-# An enumeration of CPU model expansion types.
-#
-# @static: Expand to a static CPU model, a combination of a static base
-#          model name and property delta changes. As the static base model will
-#          never change, the expanded CPU model will be the same, independant of
-#          independent of QEMU version, machine type, machine options, and
-#          accelerator options. Therefore, the resulting model can be used by
-#          tooling without having to specify a compatibility machine - e.g. when
-#          displaying the "host" model. static CPU models are migration-safe.
-#
-# @full: Expand all properties. The produced model is not guaranteed to be
-#        migration-safe, but allows tooling to get an insight and work with
-#        model details.
-#
-# Note: When a non-migration-safe CPU model is expanded in static mode, some
-# features enabled by the CPU model may be omitted, because they can't be
-# implemented by a static CPU model definition (e.g. cache info passthrough and
-# PMU passthrough in x86). If you need an accurate representation of the
-# features enabled by a non-migration-safe CPU model, use @full. If you need a
-# static representation that will keep ABI compatibility even when changing QEMU
-# version or machine-type, use @static (but keep in mind that some features may
-# be omitted).
-#
-# Since: 2.8.0
-##
-{ 'enum': 'CpuModelExpansionType',
-  'data': [ 'static', 'full' ] }
-
-
-##
-# @CpuModelExpansionInfo:
-#
-# The result of a cpu model expansion.
-#
-# @model: the expanded CpuModelInfo.
-#
-# Since: 2.8.0
-##
-{ 'struct': 'CpuModelExpansionInfo',
-  'data': { 'model': 'CpuModelInfo' } }
-
-
-##
-# @query-cpu-model-expansion:
-#
-# Expands a given CPU model (or a combination of CPU model + additional options)
-# to different granularities, allowing tooling to get an understanding what a
-# specific CPU model looks like in QEMU under a certain configuration.
-#
-# This interface can be used to query the "host" CPU model.
-#
-# The data returned by this command may be affected by:
-#
-# * QEMU version: CPU models may look different depending on the QEMU version.
-#   (Except for CPU models reported as "static" in query-cpu-definitions.)
-# * machine-type: CPU model  may look different depending on the machine-type.
-#   (Except for CPU models reported as "static" in query-cpu-definitions.)
-# * machine options (including accelerator): in some architectures, CPU models
-#   may look different depending on machine and accelerator options. (Except for
-#   CPU models reported as "static" in query-cpu-definitions.)
-# * "-cpu" arguments and global properties: arguments to the -cpu option and
-#   global properties may affect expansion of CPU models. Using
-#   query-cpu-model-expansion while using these is not advised.
-#
-# Some architectures may not support all expansion types. s390x supports
-# "full" and "static".
-#
-# Returns: a CpuModelExpansionInfo. Returns an error if expanding CPU models is
-#          not supported, if the model cannot be expanded, if the model contains
-#          an unknown CPU definition name, unknown properties or properties
-#          with a wrong type. Also returns an error if an expansion type is
-#          not supported.
-#
-# Since: 2.8.0
-##
-{ 'command': 'query-cpu-model-expansion',
-  'data': { 'type': 'CpuModelExpansionType',
-            'model': 'CpuModelInfo' },
-  'returns': 'CpuModelExpansionInfo' }
-
-##
-# @CpuModelCompareResult:
-#
-# An enumeration of CPU model comparation results. The result is usually
-# calculated using e.g. CPU features or CPU generations.
-#
-# @incompatible: If model A is incompatible to model B, model A is not
-#                guaranteed to run where model B runs and the other way around.
-#
-# @identical: If model A is identical to model B, model A is guaranteed to run
-#             where model B runs and the other way around.
-#
-# @superset: If model A is a superset of model B, model B is guaranteed to run
-#            where model A runs. There are no guarantees about the other way.
-#
-# @subset: If model A is a subset of model B, model A is guaranteed to run
-#          where model B runs. There are no guarantees about the other way.
-#
-# Since: 2.8.0
-##
-{ 'enum': 'CpuModelCompareResult',
-  'data': [ 'incompatible', 'identical', 'superset', 'subset' ] }
-
-##
-# @CpuModelCompareInfo:
-#
-# The result of a CPU model comparison.
-#
-# @result: The result of the compare operation.
-# @responsible-properties: List of properties that led to the comparison result
-#                          not being identical.
-#
-# @responsible-properties is a list of QOM property names that led to
-# both CPUs not being detected as identical. For identical models, this
-# list is empty.
-# If a QOM property is read-only, that means there's no known way to make the
-# CPU models identical. If the special property name "type" is included, the
-# models are by definition not identical and cannot be made identical.
-#
-# Since: 2.8.0
-##
-{ 'struct': 'CpuModelCompareInfo',
-  'data': {'result': 'CpuModelCompareResult',
-           'responsible-properties': ['str']
-          }
-}
-
-##
-# @query-cpu-model-comparison:
-#
-# Compares two CPU models, returning how they compare in a specific
-# configuration. The results indicates how both models compare regarding
-# runnability. This result can be used by tooling to make decisions if a
-# certain CPU model will run in a certain configuration or if a compatible
-# CPU model has to be created by baselining.
-#
-# Usually, a CPU model is compared against the maximum possible CPU model
-# of a certain configuration (e.g. the "host" model for KVM). If that CPU
-# model is identical or a subset, it will run in that configuration.
-#
-# The result returned by this command may be affected by:
-#
-# * QEMU version: CPU models may look different depending on the QEMU version.
-#   (Except for CPU models reported as "static" in query-cpu-definitions.)
-# * machine-type: CPU model may look different depending on the machine-type.
-#   (Except for CPU models reported as "static" in query-cpu-definitions.)
-# * machine options (including accelerator): in some architectures, CPU models
-#   may look different depending on machine and accelerator options. (Except for
-#   CPU models reported as "static" in query-cpu-definitions.)
-# * "-cpu" arguments and global properties: arguments to the -cpu option and
-#   global properties may affect expansion of CPU models. Using
-#   query-cpu-model-expansion while using these is not advised.
-#
-# Some architectures may not support comparing CPU models. s390x supports
-# comparing CPU models.
-#
-# Returns: a CpuModelBaselineInfo. Returns an error if comparing CPU models is
-#          not supported, if a model cannot be used, if a model contains
-#          an unknown cpu definition name, unknown properties or properties
-#          with wrong types.
-#
-# Since: 2.8.0
-##
-{ 'command': 'query-cpu-model-comparison',
-  'data': { 'modela': 'CpuModelInfo', 'modelb': 'CpuModelInfo' },
-  'returns': 'CpuModelCompareInfo' }
-
-##
-# @CpuModelBaselineInfo:
-#
-# The result of a CPU model baseline.
-#
-# @model: the baselined CpuModelInfo.
-#
-# Since: 2.8.0
-##
-{ 'struct': 'CpuModelBaselineInfo',
-  'data': { 'model': 'CpuModelInfo' } }
-
-##
-# @query-cpu-model-baseline:
-#
-# Baseline two CPU models, creating a compatible third model. The created
-# model will always be a static, migration-safe CPU model (see "static"
-# CPU model expansion for details).
-#
-# This interface can be used by tooling to create a compatible CPU model out
-# two CPU models. The created CPU model will be identical to or a subset of
-# both CPU models when comparing them. Therefore, the created CPU model is
-# guaranteed to run where the given CPU models run.
-#
-# The result returned by this command may be affected by:
-#
-# * QEMU version: CPU models may look different depending on the QEMU version.
-#   (Except for CPU models reported as "static" in query-cpu-definitions.)
-# * machine-type: CPU model may look different depending on the machine-type.
-#   (Except for CPU models reported as "static" in query-cpu-definitions.)
-# * machine options (including accelerator): in some architectures, CPU models
-#   may look different depending on machine and accelerator options. (Except for
-#   CPU models reported as "static" in query-cpu-definitions.)
-# * "-cpu" arguments and global properties: arguments to the -cpu option and
-#   global properties may affect expansion of CPU models. Using
-#   query-cpu-model-expansion while using these is not advised.
-#
-# Some architectures may not support baselining CPU models. s390x supports
-# baselining CPU models.
-#
-# Returns: a CpuModelBaselineInfo. Returns an error if baselining CPU models is
-#          not supported, if a model cannot be used, if a model contains
-#          an unknown cpu definition name, unknown properties or properties
-#          with wrong types.
-#
-# Since: 2.8.0
-##
-{ 'command': 'query-cpu-model-baseline',
-  'data': { 'modela': 'CpuModelInfo',
-            'modelb': 'CpuModelInfo' },
-  'returns': 'CpuModelBaselineInfo' }
-
-##
-# @AddfdInfo:
-#
-# Information about a file descriptor that was added to an fd set.
-#
-# @fdset-id: The ID of the fd set that @fd was added to.
-#
-# @fd: The file descriptor that was received via SCM rights and
-#      added to the fd set.
-#
-# Since: 1.2.0
-##
-{ 'struct': 'AddfdInfo', 'data': {'fdset-id': 'int', 'fd': 'int'} }
-
-##
-# @add-fd:
-#
-# Add a file descriptor, that was passed via SCM rights, to an fd set.
-#
-# @fdset-id: The ID of the fd set to add the file descriptor to.
-#
-# @opaque: A free-form string that can be used to describe the fd.
-#
-# Returns: @AddfdInfo on success
-#
-#          If file descriptor was not received, FdNotSupplied
-#
-#          If @fdset-id is a negative value, InvalidParameterValue
-#
-# Notes: The list of fd sets is shared by all monitor connections.
-#
-#        If @fdset-id is not specified, a new fd set will be created.
-#
-# Since: 1.2.0
-#
-# Example:
-#
-# -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
-# <- { "return": { "fdset-id": 1, "fd": 3 } }
-#
-##
-{ 'command': 'add-fd', 'data': {'*fdset-id': 'int', '*opaque': 'str'},
-  'returns': 'AddfdInfo' }
-
-##
-# @remove-fd:
-#
-# Remove a file descriptor from an fd set.
-#
-# @fdset-id: The ID of the fd set that the file descriptor belongs to.
-#
-# @fd: The file descriptor that is to be removed.
-#
-# Returns: Nothing on success
-#          If @fdset-id or @fd is not found, FdNotFound
-#
-# Since: 1.2.0
-#
-# Notes: The list of fd sets is shared by all monitor connections.
-#
-#        If @fd is not specified, all file descriptors in @fdset-id
-#        will be removed.
-#
-# Example:
-#
-# -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
-# <- { "return": {} }
-#
-##
-{ 'command': 'remove-fd', 'data': {'fdset-id': 'int', '*fd': 'int'} }
-
-##
-# @FdsetFdInfo:
-#
-# Information about a file descriptor that belongs to an fd set.
-#
-# @fd: The file descriptor value.
-#
-# @opaque: A free-form string that can be used to describe the fd.
-#
-# Since: 1.2.0
-##
-{ 'struct': 'FdsetFdInfo',
-  'data': {'fd': 'int', '*opaque': 'str'} }
-
-##
-# @FdsetInfo:
-#
-# Information about an fd set.
-#
-# @fdset-id: The ID of the fd set.
-#
-# @fds: A list of file descriptors that belong to this fd set.
-#
-# Since: 1.2.0
-##
-{ 'struct': 'FdsetInfo',
-  'data': {'fdset-id': 'int', 'fds': ['FdsetFdInfo']} }
-
-##
-# @query-fdsets:
-#
-# Return information describing all fd sets.
-#
-# Returns: A list of @FdsetInfo
-#
-# Since: 1.2.0
-#
-# Note: The list of fd sets is shared by all monitor connections.
-#
-# Example:
-#
-# -> { "execute": "query-fdsets" }
-# <- { "return": [
-#        {
-#          "fds": [
-#            {
-#              "fd": 30,
-#              "opaque": "rdonly:/path/to/file"
-#            },
-#            {
-#              "fd": 24,
-#              "opaque": "rdwr:/path/to/file"
-#            }
-#          ],
-#          "fdset-id": 1
-#        },
-#        {
-#          "fds": [
-#            {
-#              "fd": 28
-#            },
-#            {
-#              "fd": 29
-#            }
-#          ],
-#          "fdset-id": 0
-#        }
-#      ]
-#    }
-#
-##
-{ 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
-
-##
-# @TargetInfo:
-#
-# Information describing the QEMU target.
-#
-# @arch: the target architecture (eg "x86_64", "i386", etc)
-#
-# Since: 1.2.0
-##
-{ 'struct': 'TargetInfo',
-  'data': { 'arch': 'str' } }
-
-##
-# @query-target:
-#
-# Return information about the target for this QEMU
-#
-# Returns: TargetInfo
-#
-# Since: 1.2.0
-##
-{ 'command': 'query-target', 'returns': 'TargetInfo' }
-
-##
-# @AcpiTableOptions:
-#
-# Specify an ACPI table on the command line to load.
-#
-# At most one of @file and @data can be specified. The list of files specified
-# by any one of them is loaded and concatenated in order. If both are omitted,
-# @data is implied.
-#
-# Other fields / optargs can be used to override fields of the generic ACPI
-# table header; refer to the ACPI specification 5.0, section 5.2.6 System
-# Description Table Header. If a header field is not overridden, then the
-# corresponding value from the concatenated blob is used (in case of @file), or
-# it is filled in with a hard-coded value (in case of @data).
-#
-# String fields are copied into the matching ACPI member from lowest address
-# upwards, and silently truncated / NUL-padded to length.
-#
-# @sig: table signature / identifier (4 bytes)
-#
-# @rev: table revision number (dependent on signature, 1 byte)
-#
-# @oem_id: OEM identifier (6 bytes)
-#
-# @oem_table_id: OEM table identifier (8 bytes)
-#
-# @oem_rev: OEM-supplied revision number (4 bytes)
-#
-# @asl_compiler_id: identifier of the utility that created the table
-#                   (4 bytes)
-#
-# @asl_compiler_rev: revision number of the utility that created the
-#                    table (4 bytes)
-#
-# @file: colon (:) separated list of pathnames to load and
-#        concatenate as table data. The resultant binary blob is expected to
-#        have an ACPI table header. At least one file is required. This field
-#        excludes @data.
-#
-# @data: colon (:) separated list of pathnames to load and
-#        concatenate as table data. The resultant binary blob must not have an
-#        ACPI table header. At least one file is required. This field excludes
-#        @file.
-#
-# Since: 1.5
-##
-{ 'struct': 'AcpiTableOptions',
-  'data': {
-    '*sig':               'str',
-    '*rev':               'uint8',
-    '*oem_id':            'str',
-    '*oem_table_id':      'str',
-    '*oem_rev':           'uint32',
-    '*asl_compiler_id':   'str',
-    '*asl_compiler_rev':  'uint32',
-    '*file':              'str',
-    '*data':              'str' }}
-
-##
-# @CommandLineParameterType:
-#
-# Possible types for an option parameter.
-#
-# @string: accepts a character string
-#
-# @boolean: accepts "on" or "off"
-#
-# @number: accepts a number
-#
-# @size: accepts a number followed by an optional suffix (K)ilo,
-#        (M)ega, (G)iga, (T)era
-#
-# Since: 1.5
-##
-{ 'enum': 'CommandLineParameterType',
-  'data': ['string', 'boolean', 'number', 'size'] }
-
-##
-# @CommandLineParameterInfo:
-#
-# Details about a single parameter of a command line option.
-#
-# @name: parameter name
-#
-# @type: parameter @CommandLineParameterType
-#
-# @help: human readable text string, not suitable for parsing.
-#
-# @default: default value string (since 2.1)
-#
-# Since: 1.5
-##
-{ 'struct': 'CommandLineParameterInfo',
-  'data': { 'name': 'str',
-            'type': 'CommandLineParameterType',
-            '*help': 'str',
-            '*default': 'str' } }
-
-##
-# @CommandLineOptionInfo:
-#
-# Details about a command line option, including its list of parameter details
-#
-# @option: option name
-#
-# @parameters: an array of @CommandLineParameterInfo
-#
-# Since: 1.5
-##
-{ 'struct': 'CommandLineOptionInfo',
-  'data': { 'option': 'str', 'parameters': ['CommandLineParameterInfo'] } }
-
-##
-# @query-command-line-options:
-#
-# Query command line option schema.
-#
-# @option: option name
-#
-# Returns: list of @CommandLineOptionInfo for all options (or for the given
-#          @option).  Returns an error if the given @option doesn't exist.
-#
-# Since: 1.5
-#
-# Example:
-#
-# -> { "execute": "query-command-line-options",
-#      "arguments": { "option": "option-rom" } }
-# <- { "return": [
-#         {
-#             "parameters": [
-#                 {
-#                     "name": "romfile",
-#                     "type": "string"
-#                 },
-#                 {
-#                     "name": "bootindex",
-#                     "type": "number"
-#                 }
-#             ],
-#             "option": "option-rom"
-#         }
-#      ]
-#    }
-#
-##
-{'command': 'query-command-line-options', 'data': { '*option': 'str' },
- 'returns': ['CommandLineOptionInfo'] }
-
-##
-# @X86CPURegister32:
-#
-# A X86 32-bit register
-#
-# Since: 1.5
-##
-{ 'enum': 'X86CPURegister32',
-  'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
-
-##
-# @X86CPUFeatureWordInfo:
-#
-# Information about a X86 CPU feature word
-#
-# @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word
-#
-# @cpuid-input-ecx: Input ECX value for CPUID instruction for that
-#                   feature word
-#
-# @cpuid-register: Output register containing the feature bits
-#
-# @features: value of output register, containing the feature bits
-#
-# Since: 1.5
-##
-{ 'struct': 'X86CPUFeatureWordInfo',
-  'data': { 'cpuid-input-eax': 'int',
-            '*cpuid-input-ecx': 'int',
-            'cpuid-register': 'X86CPURegister32',
-            'features': 'int' } }
-
-##
-# @DummyForceArrays:
-#
-# Not used by QMP; hack to let us use X86CPUFeatureWordInfoList internally
-#
-# Since: 2.5
-##
-{ 'struct': 'DummyForceArrays',
-  'data': { 'unused': ['X86CPUFeatureWordInfo'] } }
-
-
-##
-# @NumaOptionsType:
-#
-# @node: NUMA nodes configuration
-#
-# @dist: NUMA distance configuration (since 2.10)
-#
-# @cpu: property based CPU(s) to node mapping (Since: 2.10)
-#
-# Since: 2.1
-##
-{ 'enum': 'NumaOptionsType',
-  'data': [ 'node', 'dist', 'cpu' ] }
-
-##
-# @NumaOptions:
-#
-# A discriminated record of NUMA options. (for OptsVisitor)
-#
-# Since: 2.1
-##
-{ 'union': 'NumaOptions',
-  'base': { 'type': 'NumaOptionsType' },
-  'discriminator': 'type',
-  'data': {
-    'node': 'NumaNodeOptions',
-    'dist': 'NumaDistOptions',
-    'cpu': 'NumaCpuOptions' }}
-
-##
-# @NumaNodeOptions:
-#
-# Create a guest NUMA node. (for OptsVisitor)
-#
-# @nodeid: NUMA node ID (increase by 1 from 0 if omitted)
-#
-# @cpus: VCPUs belonging to this node (assign VCPUS round-robin
-#         if omitted)
-#
-# @mem: memory size of this node; mutually exclusive with @memdev.
-#       Equally divide total memory among nodes if both @mem and @memdev are
-#       omitted.
-#
-# @memdev: memory backend object.  If specified for one node,
-#          it must be specified for all nodes.
-#
-# Since: 2.1
-##
-{ 'struct': 'NumaNodeOptions',
-  'data': {
-   '*nodeid': 'uint16',
-   '*cpus':   ['uint16'],
-   '*mem':    'size',
-   '*memdev': 'str' }}
-
-##
-# @NumaDistOptions:
-#
-# Set the distance between 2 NUMA nodes.
-#
-# @src: source NUMA node.
-#
-# @dst: destination NUMA node.
-#
-# @val: NUMA distance from source node to destination node.
-#       When a node is unreachable from another node, set the distance
-#       between them to 255.
-#
-# Since: 2.10
-##
-{ 'struct': 'NumaDistOptions',
-  'data': {
-   'src': 'uint16',
-   'dst': 'uint16',
-   'val': 'uint8' }}
-
-##
-# @NumaCpuOptions:
-#
-# Option "-numa cpu" overrides default cpu to node mapping.
-# It accepts the same set of cpu properties as returned by
-# query-hotpluggable-cpus[].props, where node-id could be used to
-# override default node mapping.
-#
-# Since: 2.10
-##
-{ 'struct': 'NumaCpuOptions',
-   'base': 'CpuInstanceProperties',
-   'data' : {} }
-
-##
-# @HostMemPolicy:
-#
-# Host memory policy types
-#
-# @default: restore default policy, remove any nondefault policy
-#
-# @preferred: set the preferred host nodes for allocation
-#
-# @bind: a strict policy that restricts memory allocation to the
-#        host nodes specified
-#
-# @interleave: memory allocations are interleaved across the set
-#              of host nodes specified
-#
-# Since: 2.1
-##
-{ 'enum': 'HostMemPolicy',
-  'data': [ 'default', 'preferred', 'bind', 'interleave' ] }
-
-##
-# @Memdev:
-#
-# Information about memory backend
-#
-# @id: backend's ID if backend has 'id' property (since 2.9)
-#
-# @size: memory backend size
-#
-# @merge: enables or disables memory merge support
-#
-# @dump: includes memory backend's memory in a core dump or not
-#
-# @prealloc: enables or disables memory preallocation
-#
-# @host-nodes: host nodes for its memory policy
-#
-# @policy: memory policy of memory backend
-#
-# Since: 2.1
-##
-{ 'struct': 'Memdev',
-  'data': {
-    '*id':        'str',
-    'size':       'size',
-    'merge':      'bool',
-    'dump':       'bool',
-    'prealloc':   'bool',
-    'host-nodes': ['uint16'],
-    'policy':     'HostMemPolicy' }}
-
-##
-# @query-memdev:
-#
-# Returns information for all memory backends.
-#
-# Returns: a list of @Memdev.
-#
-# Since: 2.1
-#
-# Example:
-#
-# -> { "execute": "query-memdev" }
-# <- { "return": [
-#        {
-#          "id": "mem1",
-#          "size": 536870912,
-#          "merge": false,
-#          "dump": true,
-#          "prealloc": false,
-#          "host-nodes": [0, 1],
-#          "policy": "bind"
-#        },
-#        {
-#          "size": 536870912,
-#          "merge": false,
-#          "dump": true,
-#          "prealloc": true,
-#          "host-nodes": [2, 3],
-#          "policy": "preferred"
-#        }
-#      ]
-#    }
-#
-##
-{ 'command': 'query-memdev', 'returns': ['Memdev'] }
-
-##
-# @PCDIMMDeviceInfo:
-#
-# PCDIMMDevice state information
-#
-# @id: device's ID
-#
-# @addr: physical address, where device is mapped
-#
-# @size: size of memory that the device provides
-#
-# @slot: slot number at which device is plugged in
-#
-# @node: NUMA node number where device is plugged in
-#
-# @memdev: memory backend linked with device
-#
-# @hotplugged: true if device was hotplugged
-#
-# @hotpluggable: true if device if could be added/removed while machine is running
-#
-# Since: 2.1
-##
-{ 'struct': 'PCDIMMDeviceInfo',
-  'data': { '*id': 'str',
-            'addr': 'int',
-            'size': 'int',
-            'slot': 'int',
-            'node': 'int',
-            'memdev': 'str',
-            'hotplugged': 'bool',
-            'hotpluggable': 'bool'
-          }
-}
-
-##
-# @MemoryDeviceInfo:
-#
-# Union containing information about a memory device
-#
-# Since: 2.1
-##
-{ 'union': 'MemoryDeviceInfo', 'data': {'dimm': 'PCDIMMDeviceInfo'} }
-
-##
-# @query-memory-devices:
-#
-# Lists available memory devices and their state
-#
-# Since: 2.1
-#
-# Example:
-#
-# -> { "execute": "query-memory-devices" }
-# <- { "return": [ { "data":
-#                       { "addr": 5368709120,
-#                         "hotpluggable": true,
-#                         "hotplugged": true,
-#                         "id": "d1",
-#                         "memdev": "/objects/memX",
-#                         "node": 0,
-#                         "size": 1073741824,
-#                         "slot": 0},
-#                    "type": "dimm"
-#                  } ] }
-#
-##
-{ 'command': 'query-memory-devices', 'returns': ['MemoryDeviceInfo'] }
-
-##
-# @MEM_UNPLUG_ERROR:
-#
-# Emitted when memory hot unplug error occurs.
-#
-# @device: device name
-#
-# @msg: Informative message
-#
-# Since: 2.4
-#
-# Example:
-#
-# <- { "event": "MEM_UNPLUG_ERROR"
-#      "data": { "device": "dimm1",
-#                "msg": "acpi: device unplug for unsupported device"
-#      },
-#      "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
-#
-##
-{ 'event': 'MEM_UNPLUG_ERROR',
-  'data': { 'device': 'str', 'msg': 'str' } }
-
-##
-# @ACPISlotType:
-#
-# @DIMM: memory slot
-# @CPU: logical CPU slot (since 2.7)
-##
-{ 'enum': 'ACPISlotType', 'data': [ 'DIMM', 'CPU' ] }
-
-##
-# @ACPIOSTInfo:
-#
-# OSPM Status Indication for a device
-# For description of possible values of @source and @status fields
-# see "_OST (OSPM Status Indication)" chapter of ACPI5.0 spec.
-#
-# @device: device ID associated with slot
-#
-# @slot: slot ID, unique per slot of a given @slot-type
-#
-# @slot-type: type of the slot
-#
-# @source: an integer containing the source event
-#
-# @status: an integer containing the status code
-#
-# Since: 2.1
-##
-{ 'struct': 'ACPIOSTInfo',
-  'data'  : { '*device': 'str',
-              'slot': 'str',
-              'slot-type': 'ACPISlotType',
-              'source': 'int',
-              'status': 'int' } }
-
-##
-# @query-acpi-ospm-status:
-#
-# Return a list of ACPIOSTInfo for devices that support status
-# reporting via ACPI _OST method.
-#
-# Since: 2.1
-#
-# Example:
-#
-# -> { "execute": "query-acpi-ospm-status" }
-# <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
-#                  { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
-#                  { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
-#                  { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
-#    ]}
-#
-##
-{ 'command': 'query-acpi-ospm-status', 'returns': ['ACPIOSTInfo'] }
-
-##
-# @ACPI_DEVICE_OST:
-#
-# Emitted when guest executes ACPI _OST method.
-#
-# @info: ACPIOSTInfo type as described in qapi-schema.json
-#
-# Since: 2.1
-#
-# Example:
-#
-# <- { "event": "ACPI_DEVICE_OST",
-#      "data": { "device": "d1", "slot": "0",
-#                "slot-type": "DIMM", "source": 1, "status": 0 } }
-#
-##
-{ 'event': 'ACPI_DEVICE_OST',
-     'data': { 'info': 'ACPIOSTInfo' } }
-
-##
-# @rtc-reset-reinjection:
-#
-# This command will reset the RTC interrupt reinjection backlog.
-# Can be used if another mechanism to synchronize guest time
-# is in effect, for example QEMU guest agent's guest-set-time
-# command.
-#
-# Since: 2.1
-#
-# Example:
-#
-# -> { "execute": "rtc-reset-reinjection" }
-# <- { "return": {} }
-#
-##
-{ 'command': 'rtc-reset-reinjection' }
-
-##
-# @RTC_CHANGE:
-#
-# Emitted when the guest changes the RTC time.
-#
-# @offset: offset between base RTC clock (as specified by -rtc base), and
-#          new RTC clock value
-#
-# Note: This event is rate-limited.
-#
-# Since: 0.13.0
-#
-# Example:
-#
-# <-   { "event": "RTC_CHANGE",
-#        "data": { "offset": 78 },
-#        "timestamp": { "seconds": 1267020223, "microseconds": 435656 } }
-#
-##
-{ 'event': 'RTC_CHANGE',
-  'data': { 'offset': 'int' } }
-
-##
-# @ReplayMode:
-#
-# Mode of the replay subsystem.
-#
-# @none: normal execution mode. Replay or record are not enabled.
-#
-# @record: record mode. All non-deterministic data is written into the
-#          replay log.
-#
-# @play: replay mode. Non-deterministic data required for system execution
-#        is read from the log.
-#
-# Since: 2.5
-##
-{ 'enum': 'ReplayMode',
-  'data': [ 'none', 'record', 'play' ] }
-
-##
-# @xen-load-devices-state:
-#
-# Load the state of all devices from file. The RAM and the block devices
-# of the VM are not loaded by this command.
-#
-# @filename: the file to load the state of the devices from as binary
-# data. See xen-save-devices-state.txt for a description of the binary
-# format.
-#
-# Since: 2.7
-#
-# Example:
-#
-# -> { "execute": "xen-load-devices-state",
-#      "arguments": { "filename": "/tmp/resume" } }
-# <- { "return": {} }
-#
-##
-{ 'command': 'xen-load-devices-state', 'data': {'filename': 'str'} }
-
-##
-# @GICCapability:
-#
-# The struct describes capability for a specific GIC (Generic
-# Interrupt Controller) version. These bits are not only decided by
-# QEMU/KVM software version, but also decided by the hardware that
-# the program is running upon.
-#
-# @version:  version of GIC to be described. Currently, only 2 and 3
-#            are supported.
-#
-# @emulated: whether current QEMU/hardware supports emulated GIC
-#            device in user space.
-#
-# @kernel:   whether current QEMU/hardware supports hardware
-#            accelerated GIC device in kernel.
-#
-# Since: 2.6
-##
-{ 'struct': 'GICCapability',
-  'data': { 'version': 'int',
-            'emulated': 'bool',
-            'kernel': 'bool' } }
-
-##
-# @query-gic-capabilities:
-#
-# This command is ARM-only. It will return a list of GICCapability
-# objects that describe its capability bits.
-#
-# Returns: a list of GICCapability objects.
-#
-# Since: 2.6
-#
-# Example:
-#
-# -> { "execute": "query-gic-capabilities" }
-# <- { "return": [{ "version": 2, "emulated": true, "kernel": false },
-#                 { "version": 3, "emulated": false, "kernel": true } ] }
-#
-##
-{ 'command': 'query-gic-capabilities', 'returns': ['GICCapability'] }
-
-##
-# @CpuInstanceProperties:
-#
-# List of properties to be used for hotplugging a CPU instance,
-# it should be passed by management with device_add command when
-# a CPU is being hotplugged.
-#
-# @node-id: NUMA node ID the CPU belongs to
-# @socket-id: socket number within node/board the CPU belongs to
-# @core-id: core number within socket the CPU belongs to
-# @thread-id: thread number within core the CPU belongs to
-#
-# Note: currently there are 4 properties that could be present
-# but management should be prepared to pass through other
-# properties with device_add command to allow for future
-# interface extension. This also requires the filed names to be kept in
-# sync with the properties passed to -device/device_add.
-#
-# Since: 2.7
-##
-{ 'struct': 'CpuInstanceProperties',
-  'data': { '*node-id': 'int',
-            '*socket-id': 'int',
-            '*core-id': 'int',
-            '*thread-id': 'int'
-  }
-}
-
-##
-# @HotpluggableCPU:
-#
-# @type: CPU object type for usage with device_add command
-# @props: list of properties to be used for hotplugging CPU
-# @vcpus-count: number of logical VCPU threads @HotpluggableCPU provides
-# @qom-path: link to existing CPU object if CPU is present or
-#            omitted if CPU is not present.
-#
-# Since: 2.7
-##
-{ 'struct': 'HotpluggableCPU',
-  'data': { 'type': 'str',
-            'vcpus-count': 'int',
-            'props': 'CpuInstanceProperties',
-            '*qom-path': 'str'
-          }
-}
-
-##
-# @query-hotpluggable-cpus:
-#
-# Returns: a list of HotpluggableCPU objects.
-#
-# Since: 2.7
-#
-# Example:
-#
-# For pseries machine type started with -smp 2,cores=2,maxcpus=4 -cpu POWER8:
-#
-# -> { "execute": "query-hotpluggable-cpus" }
-# <- {"return": [
-#      { "props": { "core": 8 }, "type": "POWER8-spapr-cpu-core",
-#        "vcpus-count": 1 },
-#      { "props": { "core": 0 }, "type": "POWER8-spapr-cpu-core",
-#        "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
-#    ]}'
-#
-# For pc machine type started with -smp 1,maxcpus=2:
-#
-# -> { "execute": "query-hotpluggable-cpus" }
-# <- {"return": [
-#      {
-#         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
-#         "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
-#      },
-#      {
-#         "qom-path": "/machine/unattached/device[0]",
-#         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
-#         "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}
-#      }
-#    ]}
-#
-# For s390x-virtio-ccw machine type started with -smp 1,maxcpus=2 -cpu qemu
-# (Since: 2.11):
-#
-# -> { "execute": "query-hotpluggable-cpus" }
-# <- {"return": [
-#      {
-#         "type": "qemu-s390x-cpu", "vcpus-count": 1,
-#         "props": { "core-id": 1 }
-#      },
-#      {
-#         "qom-path": "/machine/unattached/device[0]",
-#         "type": "qemu-s390x-cpu", "vcpus-count": 1,
-#         "props": { "core-id": 0 }
-#      }
-#    ]}
-#
-##
-{ 'command': 'query-hotpluggable-cpus', 'returns': ['HotpluggableCPU'] }
-
-##
-# @GuidInfo:
-#
-# GUID information.
-#
-# @guid: the globally unique identifier
-#
-# Since: 2.9
-##
-{ 'struct': 'GuidInfo', 'data': {'guid': 'str'} }
-
-##
-# @query-vm-generation-id:
-#
-# Show Virtual Machine Generation ID
-#
-# Since: 2.9
-##
-{ 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' }
-
-##
-# @watchdog-set-action:
-#
-# Set watchdog action
-#
-# Since: 2.11
-##
-{ 'command': 'watchdog-set-action', 'data' : {'action': 'WatchdogAction'} }
+{ 'include': 'qapi/misc.json' }
diff --git a/qapi/misc.json b/qapi/misc.json
new file mode 100644
index 0000000000..225631bf7d
--- /dev/null
+++ b/qapi/misc.json
@@ -0,0 +1,3090 @@
+# -*- Mode: Python -*-
+#
+
+##
+# = Miscellanea
+##
+
+##
+# @qmp_capabilities:
+#
+# Enable QMP capabilities.
+#
+# Arguments: None.
+#
+# Example:
+#
+# -> { "execute": "qmp_capabilities" }
+# <- { "return": {} }
+#
+# Notes: This command is valid exactly when first connecting: it must be
+# issued before any other command will be accepted, and will fail once the
+# monitor is accepting other commands. (see qemu docs/interop/qmp-spec.txt)
+#
+# Since: 0.13
+#
+##
+{ 'command': 'qmp_capabilities' }
+
+##
+# @VersionTriple:
+#
+# A three-part version number.
+#
+# @major:  The major version number.
+#
+# @minor:  The minor version number.
+#
+# @micro:  The micro version number.
+#
+# Since: 2.4
+##
+{ 'struct': 'VersionTriple',
+  'data': {'major': 'int', 'minor': 'int', 'micro': 'int'} }
+
+
+##
+# @VersionInfo:
+#
+# A description of QEMU's version.
+#
+# @qemu:        The version of QEMU.  By current convention, a micro
+#               version of 50 signifies a development branch.  A micro version
+#               greater than or equal to 90 signifies a release candidate for
+#               the next minor version.  A micro version of less than 50
+#               signifies a stable release.
+#
+# @package:     QEMU will always set this field to an empty string.  Downstream
+#               versions of QEMU should set this to a non-empty string.  The
+#               exact format depends on the downstream however it highly
+#               recommended that a unique name is used.
+#
+# Since: 0.14.0
+##
+{ 'struct': 'VersionInfo',
+  'data': {'qemu': 'VersionTriple', 'package': 'str'} }
+
+##
+# @query-version:
+#
+# Returns the current version of QEMU.
+#
+# Returns:  A @VersionInfo object describing the current version of QEMU.
+#
+# Since: 0.14.0
+#
+# Example:
+#
+# -> { "execute": "query-version" }
+# <- {
+#       "return":{
+#          "qemu":{
+#             "major":0,
+#             "minor":11,
+#             "micro":5
+#          },
+#          "package":""
+#       }
+#    }
+#
+##
+{ 'command': 'query-version', 'returns': 'VersionInfo' }
+
+##
+# @CommandInfo:
+#
+# Information about a QMP command
+#
+# @name: The command name
+#
+# Since: 0.14.0
+##
+{ 'struct': 'CommandInfo', 'data': {'name': 'str'} }
+
+##
+# @query-commands:
+#
+# Return a list of supported QMP commands by this server
+#
+# Returns: A list of @CommandInfo for all supported commands
+#
+# Since: 0.14.0
+#
+# Example:
+#
+# -> { "execute": "query-commands" }
+# <- {
+#      "return":[
+#         {
+#            "name":"query-balloon"
+#         },
+#         {
+#            "name":"system_powerdown"
+#         }
+#      ]
+#    }
+#
+# Note: This example has been shortened as the real response is too long.
+#
+##
+{ 'command': 'query-commands', 'returns': ['CommandInfo'] }
+
+##
+# @LostTickPolicy:
+#
+# Policy for handling lost ticks in timer devices.
+#
+# @discard: throw away the missed tick(s) and continue with future injection
+#           normally.  Guest time may be delayed, unless the OS has explicit
+#           handling of lost ticks
+#
+# @delay: continue to deliver ticks at the normal rate.  Guest time will be
+#         delayed due to the late tick
+#
+# @merge: merge the missed tick(s) into one tick and inject.  Guest time
+#         may be delayed, depending on how the OS reacts to the merging
+#         of ticks
+#
+# @slew: deliver ticks at a higher rate to catch up with the missed tick. The
+#        guest time should not be delayed once catchup is complete.
+#
+# Since: 2.0
+##
+{ 'enum': 'LostTickPolicy',
+  'data': ['discard', 'delay', 'merge', 'slew' ] }
+
+##
+# @add_client:
+#
+# Allow client connections for VNC, Spice and socket based
+# character devices to be passed in to QEMU via SCM_RIGHTS.
+#
+# @protocol: protocol name. Valid names are "vnc", "spice" or the
+#            name of a character device (eg. from -chardev id=XXXX)
+#
+# @fdname: file descriptor name previously passed via 'getfd' command
+#
+# @skipauth: whether to skip authentication. Only applies
+#            to "vnc" and "spice" protocols
+#
+# @tls: whether to perform TLS. Only applies to the "spice"
+#       protocol
+#
+# Returns: nothing on success.
+#
+# Since: 0.14.0
+#
+# Example:
+#
+# -> { "execute": "add_client", "arguments": { "protocol": "vnc",
+#                                              "fdname": "myclient" } }
+# <- { "return": {} }
+#
+##
+{ 'command': 'add_client',
+  'data': { 'protocol': 'str', 'fdname': 'str', '*skipauth': 'bool',
+            '*tls': 'bool' } }
+
+##
+# @NameInfo:
+#
+# Guest name information.
+#
+# @name: The name of the guest
+#
+# Since: 0.14.0
+##
+{ 'struct': 'NameInfo', 'data': {'*name': 'str'} }
+
+##
+# @query-name:
+#
+# Return the name information of a guest.
+#
+# Returns: @NameInfo of the guest
+#
+# Since: 0.14.0
+#
+# Example:
+#
+# -> { "execute": "query-name" }
+# <- { "return": { "name": "qemu-name" } }
+#
+##
+{ 'command': 'query-name', 'returns': 'NameInfo' }
+
+##
+# @KvmInfo:
+#
+# Information about support for KVM acceleration
+#
+# @enabled: true if KVM acceleration is active
+#
+# @present: true if KVM acceleration is built into this executable
+#
+# Since: 0.14.0
+##
+{ 'struct': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool'} }
+
+##
+# @query-kvm:
+#
+# Returns information about KVM acceleration
+#
+# Returns: @KvmInfo
+#
+# Since: 0.14.0
+#
+# Example:
+#
+# -> { "execute": "query-kvm" }
+# <- { "return": { "enabled": true, "present": true } }
+#
+##
+{ 'command': 'query-kvm', 'returns': 'KvmInfo' }
+
+##
+# @UuidInfo:
+#
+# Guest UUID information (Universally Unique Identifier).
+#
+# @UUID: the UUID of the guest
+#
+# Since: 0.14.0
+#
+# Notes: If no UUID was specified for the guest, a null UUID is returned.
+##
+{ 'struct': 'UuidInfo', 'data': {'UUID': 'str'} }
+
+##
+# @query-uuid:
+#
+# Query the guest UUID information.
+#
+# Returns: The @UuidInfo for the guest
+#
+# Since: 0.14.0
+#
+# Example:
+#
+# -> { "execute": "query-uuid" }
+# <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
+#
+##
+{ 'command': 'query-uuid', 'returns': 'UuidInfo' }
+
+##
+# @EventInfo:
+#
+# Information about a QMP event
+#
+# @name: The event name
+#
+# Since: 1.2.0
+##
+{ 'struct': 'EventInfo', 'data': {'name': 'str'} }
+
+##
+# @query-events:
+#
+# Return a list of supported QMP events by this server
+#
+# Returns: A list of @EventInfo for all supported events
+#
+# Since: 1.2.0
+#
+# Example:
+#
+# -> { "execute": "query-events" }
+# <- {
+#      "return": [
+#          {
+#             "name":"SHUTDOWN"
+#          },
+#          {
+#             "name":"RESET"
+#          }
+#       ]
+#    }
+#
+# Note: This example has been shortened as the real response is too long.
+#
+##
+{ 'command': 'query-events', 'returns': ['EventInfo'] }
+
+##
+# @CpuInfoArch:
+#
+# An enumeration of cpu types that enable additional information during
+# @query-cpus.
+#
+# Since: 2.6
+##
+{ 'enum': 'CpuInfoArch',
+  'data': ['x86', 'sparc', 'ppc', 'mips', 'tricore', 'other' ] }
+
+##
+# @CpuInfo:
+#
+# Information about a virtual CPU
+#
+# @CPU: the index of the virtual CPU
+#
+# @current: this only exists for backwards compatibility and should be ignored
+#
+# @halted: true if the virtual CPU is in the halt state.  Halt usually refers
+#          to a processor specific low power mode.
+#
+# @qom_path: path to the CPU object in the QOM tree (since 2.4)
+#
+# @thread_id: ID of the underlying host thread
+#
+# @props: properties describing to which node/socket/core/thread
+#         virtual CPU belongs to, provided if supported by board (since 2.10)
+#
+# @arch: architecture of the cpu, which determines which additional fields
+#        will be listed (since 2.6)
+#
+# Since: 0.14.0
+#
+# Notes: @halted is a transient state that changes frequently.  By the time the
+#        data is sent to the client, the guest may no longer be halted.
+##
+{ 'union': 'CpuInfo',
+  'base': {'CPU': 'int', 'current': 'bool', 'halted': 'bool',
+           'qom_path': 'str', 'thread_id': 'int',
+           '*props': 'CpuInstanceProperties', 'arch': 'CpuInfoArch' },
+  'discriminator': 'arch',
+  'data': { 'x86': 'CpuInfoX86',
+            'sparc': 'CpuInfoSPARC',
+            'ppc': 'CpuInfoPPC',
+            'mips': 'CpuInfoMIPS',
+            'tricore': 'CpuInfoTricore',
+            'other': 'CpuInfoOther' } }
+
+##
+# @CpuInfoX86:
+#
+# Additional information about a virtual i386 or x86_64 CPU
+#
+# @pc: the 64-bit instruction pointer
+#
+# Since: 2.6
+##
+{ 'struct': 'CpuInfoX86', 'data': { 'pc': 'int' } }
+
+##
+# @CpuInfoSPARC:
+#
+# Additional information about a virtual SPARC CPU
+#
+# @pc: the PC component of the instruction pointer
+#
+# @npc: the NPC component of the instruction pointer
+#
+# Since: 2.6
+##
+{ 'struct': 'CpuInfoSPARC', 'data': { 'pc': 'int', 'npc': 'int' } }
+
+##
+# @CpuInfoPPC:
+#
+# Additional information about a virtual PPC CPU
+#
+# @nip: the instruction pointer
+#
+# Since: 2.6
+##
+{ 'struct': 'CpuInfoPPC', 'data': { 'nip': 'int' } }
+
+##
+# @CpuInfoMIPS:
+#
+# Additional information about a virtual MIPS CPU
+#
+# @PC: the instruction pointer
+#
+# Since: 2.6
+##
+{ 'struct': 'CpuInfoMIPS', 'data': { 'PC': 'int' } }
+
+##
+# @CpuInfoTricore:
+#
+# Additional information about a virtual Tricore CPU
+#
+# @PC: the instruction pointer
+#
+# Since: 2.6
+##
+{ 'struct': 'CpuInfoTricore', 'data': { 'PC': 'int' } }
+
+##
+# @CpuInfoOther:
+#
+# No additional information is available about the virtual CPU
+#
+# Since: 2.6
+#
+##
+{ 'struct': 'CpuInfoOther', 'data': { } }
+
+##
+# @query-cpus:
+#
+# Returns a list of information about each virtual CPU.
+#
+# Returns: a list of @CpuInfo for each virtual CPU
+#
+# Since: 0.14.0
+#
+# Example:
+#
+# -> { "execute": "query-cpus" }
+# <- { "return": [
+#          {
+#             "CPU":0,
+#             "current":true,
+#             "halted":false,
+#             "qom_path":"/machine/unattached/device[0]",
+#             "arch":"x86",
+#             "pc":3227107138,
+#             "thread_id":3134
+#          },
+#          {
+#             "CPU":1,
+#             "current":false,
+#             "halted":true,
+#             "qom_path":"/machine/unattached/device[2]",
+#             "arch":"x86",
+#             "pc":7108165,
+#             "thread_id":3135
+#          }
+#       ]
+#    }
+#
+##
+{ 'command': 'query-cpus', 'returns': ['CpuInfo'] }
+
+##
+# @IOThreadInfo:
+#
+# Information about an iothread
+#
+# @id: the identifier of the iothread
+#
+# @thread-id: ID of the underlying host thread
+#
+# @poll-max-ns: maximum polling time in ns, 0 means polling is disabled
+#               (since 2.9)
+#
+# @poll-grow: how many ns will be added to polling time, 0 means that it's not
+#             configured (since 2.9)
+#
+# @poll-shrink: how many ns will be removed from polling time, 0 means that
+#               it's not configured (since 2.9)
+#
+# Since: 2.0
+##
+{ 'struct': 'IOThreadInfo',
+  'data': {'id': 'str',
+           'thread-id': 'int',
+           'poll-max-ns': 'int',
+           'poll-grow': 'int',
+           'poll-shrink': 'int' } }
+
+##
+# @query-iothreads:
+#
+# Returns a list of information about each iothread.
+#
+# Note: this list excludes the QEMU main loop thread, which is not declared
+# using the -object iothread command-line option.  It is always the main thread
+# of the process.
+#
+# Returns: a list of @IOThreadInfo for each iothread
+#
+# Since: 2.0
+#
+# Example:
+#
+# -> { "execute": "query-iothreads" }
+# <- { "return": [
+#          {
+#             "id":"iothread0",
+#             "thread-id":3134
+#          },
+#          {
+#             "id":"iothread1",
+#             "thread-id":3135
+#          }
+#       ]
+#    }
+#
+##
+{ 'command': 'query-iothreads', 'returns': ['IOThreadInfo'] }
+
+##
+# @BalloonInfo:
+#
+# Information about the guest balloon device.
+#
+# @actual: the number of bytes the balloon currently contains
+#
+# Since: 0.14.0
+#
+##
+{ 'struct': 'BalloonInfo', 'data': {'actual': 'int' } }
+
+##
+# @query-balloon:
+#
+# Return information about the balloon device.
+#
+# Returns: @BalloonInfo on success
+#
+#          If the balloon driver is enabled but not functional because the KVM
+#          kernel module cannot support it, KvmMissingCap
+#
+#          If no balloon device is present, DeviceNotActive
+#
+# Since: 0.14.0
+#
+# Example:
+#
+# -> { "execute": "query-balloon" }
+# <- { "return": {
+#          "actual": 1073741824,
+#       }
+#    }
+#
+##
+{ 'command': 'query-balloon', 'returns': 'BalloonInfo' }
+
+##
+# @BALLOON_CHANGE:
+#
+# Emitted when the guest changes the actual BALLOON level. This value is
+# equivalent to the @actual field return by the 'query-balloon' command
+#
+# @actual: actual level of the guest memory balloon in bytes
+#
+# Note: this event is rate-limited.
+#
+# Since: 1.2
+#
+# Example:
+#
+# <- { "event": "BALLOON_CHANGE",
+#      "data": { "actual": 944766976 },
+#      "timestamp": { "seconds": 1267020223, "microseconds": 435656 } }
+#
+##
+{ 'event': 'BALLOON_CHANGE',
+  'data': { 'actual': 'int' } }
+
+##
+# @PciMemoryRange:
+#
+# A PCI device memory region
+#
+# @base: the starting address (guest physical)
+#
+# @limit: the ending address (guest physical)
+#
+# Since: 0.14.0
+##
+{ 'struct': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} }
+
+##
+# @PciMemoryRegion:
+#
+# Information about a PCI device I/O region.
+#
+# @bar: the index of the Base Address Register for this region
+#
+# @type: 'io' if the region is a PIO region
+#        'memory' if the region is a MMIO region
+#
+# @size: memory size
+#
+# @prefetch: if @type is 'memory', true if the memory is prefetchable
+#
+# @mem_type_64: if @type is 'memory', true if the BAR is 64-bit
+#
+# Since: 0.14.0
+##
+{ 'struct': 'PciMemoryRegion',
+  'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int',
+           '*prefetch': 'bool', '*mem_type_64': 'bool' } }
+
+##
+# @PciBusInfo:
+#
+# Information about a bus of a PCI Bridge device
+#
+# @number: primary bus interface number.  This should be the number of the
+#          bus the device resides on.
+#
+# @secondary: secondary bus interface number.  This is the number of the
+#             main bus for the bridge
+#
+# @subordinate: This is the highest number bus that resides below the
+#               bridge.
+#
+# @io_range: The PIO range for all devices on this bridge
+#
+# @memory_range: The MMIO range for all devices on this bridge
+#
+# @prefetchable_range: The range of prefetchable MMIO for all devices on
+#                      this bridge
+#
+# Since: 2.4
+##
+{ 'struct': 'PciBusInfo',
+  'data': {'number': 'int', 'secondary': 'int', 'subordinate': 'int',
+           'io_range': 'PciMemoryRange',
+           'memory_range': 'PciMemoryRange',
+           'prefetchable_range': 'PciMemoryRange' } }
+
+##
+# @PciBridgeInfo:
+#
+# Information about a PCI Bridge device
+#
+# @bus: information about the bus the device resides on
+#
+# @devices: a list of @PciDeviceInfo for each device on this bridge
+#
+# Since: 0.14.0
+##
+{ 'struct': 'PciBridgeInfo',
+  'data': {'bus': 'PciBusInfo', '*devices': ['PciDeviceInfo']} }
+
+##
+# @PciDeviceClass:
+#
+# Information about the Class of a PCI device
+#
+# @desc: a string description of the device's class
+#
+# @class: the class code of the device
+#
+# Since: 2.4
+##
+{ 'struct': 'PciDeviceClass',
+  'data': {'*desc': 'str', 'class': 'int'} }
+
+##
+# @PciDeviceId:
+#
+# Information about the Id of a PCI device
+#
+# @device: the PCI device id
+#
+# @vendor: the PCI vendor id
+#
+# Since: 2.4
+##
+{ 'struct': 'PciDeviceId',
+  'data': {'device': 'int', 'vendor': 'int'} }
+
+##
+# @PciDeviceInfo:
+#
+# Information about a PCI device
+#
+# @bus: the bus number of the device
+#
+# @slot: the slot the device is located in
+#
+# @function: the function of the slot used by the device
+#
+# @class_info: the class of the device
+#
+# @id: the PCI device id
+#
+# @irq: if an IRQ is assigned to the device, the IRQ number
+#
+# @qdev_id: the device name of the PCI device
+#
+# @pci_bridge: if the device is a PCI bridge, the bridge information
+#
+# @regions: a list of the PCI I/O regions associated with the device
+#
+# Notes: the contents of @class_info.desc are not stable and should only be
+#        treated as informational.
+#
+# Since: 0.14.0
+##
+{ 'struct': 'PciDeviceInfo',
+  'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
+           'class_info': 'PciDeviceClass', 'id': 'PciDeviceId',
+           '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo',
+           'regions': ['PciMemoryRegion']} }
+
+##
+# @PciInfo:
+#
+# Information about a PCI bus
+#
+# @bus: the bus index
+#
+# @devices: a list of devices on this bus
+#
+# Since: 0.14.0
+##
+{ 'struct': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
+
+##
+# @query-pci:
+#
+# Return information about the PCI bus topology of the guest.
+#
+# Returns: a list of @PciInfo for each PCI bus. Each bus is
+# represented by a json-object, which has a key with a json-array of
+# all PCI devices attached to it. Each device is represented by a
+# json-object.
+#
+# Since: 0.14.0
+#
+# Example:
+#
+# -> { "execute": "query-pci" }
+# <- { "return": [
+#          {
+#             "bus": 0,
+#             "devices": [
+#                {
+#                   "bus": 0,
+#                   "qdev_id": "",
+#                   "slot": 0,
+#                   "class_info": {
+#                      "class": 1536,
+#                      "desc": "Host bridge"
+#                   },
+#                   "id": {
+#                      "device": 32902,
+#                      "vendor": 4663
+#                   },
+#                   "function": 0,
+#                   "regions": [
+#                   ]
+#                },
+#                {
+#                   "bus": 0,
+#                   "qdev_id": "",
+#                   "slot": 1,
+#                   "class_info": {
+#                      "class": 1537,
+#                      "desc": "ISA bridge"
+#                   },
+#                   "id": {
+#                      "device": 32902,
+#                      "vendor": 28672
+#                   },
+#                   "function": 0,
+#                   "regions": [
+#                   ]
+#                },
+#                {
+#                   "bus": 0,
+#                   "qdev_id": "",
+#                   "slot": 1,
+#                   "class_info": {
+#                      "class": 257,
+#                      "desc": "IDE controller"
+#                   },
+#                   "id": {
+#                      "device": 32902,
+#                      "vendor": 28688
+#                   },
+#                   "function": 1,
+#                   "regions": [
+#                      {
+#                         "bar": 4,
+#                         "size": 16,
+#                         "address": 49152,
+#                         "type": "io"
+#                      }
+#                   ]
+#                },
+#                {
+#                   "bus": 0,
+#                   "qdev_id": "",
+#                   "slot": 2,
+#                   "class_info": {
+#                      "class": 768,
+#                      "desc": "VGA controller"
+#                   },
+#                   "id": {
+#                      "device": 4115,
+#                      "vendor": 184
+#                   },
+#                   "function": 0,
+#                   "regions": [
+#                      {
+#                         "prefetch": true,
+#                         "mem_type_64": false,
+#                         "bar": 0,
+#                         "size": 33554432,
+#                         "address": 4026531840,
+#                         "type": "memory"
+#                      },
+#                      {
+#                         "prefetch": false,
+#                         "mem_type_64": false,
+#                         "bar": 1,
+#                         "size": 4096,
+#                         "address": 4060086272,
+#                         "type": "memory"
+#                      },
+#                      {
+#                         "prefetch": false,
+#                         "mem_type_64": false,
+#                         "bar": 6,
+#                         "size": 65536,
+#                         "address": -1,
+#                         "type": "memory"
+#                      }
+#                   ]
+#                },
+#                {
+#                   "bus": 0,
+#                   "qdev_id": "",
+#                   "irq": 11,
+#                   "slot": 4,
+#                   "class_info": {
+#                      "class": 1280,
+#                      "desc": "RAM controller"
+#                   },
+#                   "id": {
+#                      "device": 6900,
+#                      "vendor": 4098
+#                   },
+#                   "function": 0,
+#                   "regions": [
+#                      {
+#                         "bar": 0,
+#                         "size": 32,
+#                         "address": 49280,
+#                         "type": "io"
+#                      }
+#                   ]
+#                }
+#             ]
+#          }
+#       ]
+#    }
+#
+# Note: This example has been shortened as the real response is too long.
+#
+##
+{ 'command': 'query-pci', 'returns': ['PciInfo'] }
+
+##
+# @quit:
+#
+# This command will cause the QEMU process to exit gracefully.  While every
+# attempt is made to send the QMP response before terminating, this is not
+# guaranteed.  When using this interface, a premature EOF would not be
+# unexpected.
+#
+# Since: 0.14.0
+#
+# Example:
+#
+# -> { "execute": "quit" }
+# <- { "return": {} }
+##
+{ 'command': 'quit' }
+
+##
+# @stop:
+#
+# Stop all guest VCPU execution.
+#
+# Since:  0.14.0
+#
+# Notes:  This function will succeed even if the guest is already in the stopped
+#         state.  In "inmigrate" state, it will ensure that the guest
+#         remains paused once migration finishes, as if the -S option was
+#         passed on the command line.
+#
+# Example:
+#
+# -> { "execute": "stop" }
+# <- { "return": {} }
+#
+##
+{ 'command': 'stop' }
+
+##
+# @system_reset:
+#
+# Performs a hard reset of a guest.
+#
+# Since: 0.14.0
+#
+# Example:
+#
+# -> { "execute": "system_reset" }
+# <- { "return": {} }
+#
+##
+{ 'command': 'system_reset' }
+
+##
+# @system_powerdown:
+#
+# Requests that a guest perform a powerdown operation.
+#
+# Since: 0.14.0
+#
+# Notes: A guest may or may not respond to this command.  This command
+#        returning does not indicate that a guest has accepted the request or
+#        that it has shut down.  Many guests will respond to this command by
+#        prompting the user in some way.
+# Example:
+#
+# -> { "execute": "system_powerdown" }
+# <- { "return": {} }
+#
+##
+{ 'command': 'system_powerdown' }
+
+##
+# @cpu-add:
+#
+# Adds CPU with specified ID
+#
+# @id: ID of CPU to be created, valid values [0..max_cpus)
+#
+# Returns: Nothing on success
+#
+# Since: 1.5
+#
+# Example:
+#
+# -> { "execute": "cpu-add", "arguments": { "id": 2 } }
+# <- { "return": {} }
+#
+##
+{ 'command': 'cpu-add', 'data': {'id': 'int'} }
+
+##
+# @memsave:
+#
+# Save a portion of guest memory to a file.
+#
+# @val: the virtual address of the guest to start from
+#
+# @size: the size of memory region to save
+#
+# @filename: the file to save the memory to as binary data
+#
+# @cpu-index: the index of the virtual CPU to use for translating the
+#                       virtual address (defaults to CPU 0)
+#
+# Returns: Nothing on success
+#
+# Since: 0.14.0
+#
+# Notes: Errors were not reliably returned until 1.1
+#
+# Example:
+#
+# -> { "execute": "memsave",
+#      "arguments": { "val": 10,
+#                     "size": 100,
+#                     "filename": "/tmp/virtual-mem-dump" } }
+# <- { "return": {} }
+#
+##
+{ 'command': 'memsave',
+  'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
+
+##
+# @pmemsave:
+#
+# Save a portion of guest physical memory to a file.
+#
+# @val: the physical address of the guest to start from
+#
+# @size: the size of memory region to save
+#
+# @filename: the file to save the memory to as binary data
+#
+# Returns: Nothing on success
+#
+# Since: 0.14.0
+#
+# Notes: Errors were not reliably returned until 1.1
+#
+# Example:
+#
+# -> { "execute": "pmemsave",
+#      "arguments": { "val": 10,
+#                     "size": 100,
+#                     "filename": "/tmp/physical-mem-dump" } }
+# <- { "return": {} }
+#
+##
+{ 'command': 'pmemsave',
+  'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
+
+##
+# @cont:
+#
+# Resume guest VCPU execution.
+#
+# Since:  0.14.0
+#
+# Returns:  If successful, nothing
+#
+# Notes:  This command will succeed if the guest is currently running.  It
+#         will also succeed if the guest is in the "inmigrate" state; in
+#         this case, the effect of the command is to make sure the guest
+#         starts once migration finishes, removing the effect of the -S
+#         command line option if it was passed.
+#
+# Example:
+#
+# -> { "execute": "cont" }
+# <- { "return": {} }
+#
+##
+{ 'command': 'cont' }
+
+##
+# @system_wakeup:
+#
+# Wakeup guest from suspend.  Does nothing in case the guest isn't suspended.
+#
+# Since:  1.1
+#
+# Returns:  nothing.
+#
+# Example:
+#
+# -> { "execute": "system_wakeup" }
+# <- { "return": {} }
+#
+##
+{ 'command': 'system_wakeup' }
+
+##
+# @inject-nmi:
+#
+# Injects a Non-Maskable Interrupt into the default CPU (x86/s390) or all CPUs (ppc64).
+# The command fails when the guest doesn't support injecting.
+#
+# Returns:  If successful, nothing
+#
+# Since:  0.14.0
+#
+# Note: prior to 2.1, this command was only supported for x86 and s390 VMs
+#
+# Example:
+#
+# -> { "execute": "inject-nmi" }
+# <- { "return": {} }
+#
+##
+{ 'command': 'inject-nmi' }
+
+##
+# @balloon:
+#
+# Request the balloon driver to change its balloon size.
+#
+# @value: the target size of the balloon in bytes
+#
+# Returns: Nothing on success
+#          If the balloon driver is enabled but not functional because the KVM
+#            kernel module cannot support it, KvmMissingCap
+#          If no balloon device is present, DeviceNotActive
+#
+# Notes: This command just issues a request to the guest.  When it returns,
+#        the balloon size may not have changed.  A guest can change the balloon
+#        size independent of this command.
+#
+# Since: 0.14.0
+#
+# Example:
+#
+# -> { "execute": "balloon", "arguments": { "value": 536870912 } }
+# <- { "return": {} }
+#
+##
+{ 'command': 'balloon', 'data': {'value': 'int'} }
+
+##
+# @human-monitor-command:
+#
+# Execute a command on the human monitor and return the output.
+#
+# @command-line: the command to execute in the human monitor
+#
+# @cpu-index: The CPU to use for commands that require an implicit CPU
+#
+# Returns: the output of the command as a string
+#
+# Since: 0.14.0
+#
+# Notes: This command only exists as a stop-gap.  Its use is highly
+#        discouraged.  The semantics of this command are not
+#        guaranteed: this means that command names, arguments and
+#        responses can change or be removed at ANY time.  Applications
+#        that rely on long term stability guarantees should NOT
+#        use this command.
+#
+#        Known limitations:
+#
+#        * This command is stateless, this means that commands that depend
+#          on state information (such as getfd) might not work
+#
+#        * Commands that prompt the user for data don't currently work
+#
+# Example:
+#
+# -> { "execute": "human-monitor-command",
+#      "arguments": { "command-line": "info kvm" } }
+# <- { "return": "kvm support: enabled\r\n" }
+#
+##
+{ 'command': 'human-monitor-command',
+  'data': {'command-line': 'str', '*cpu-index': 'int'},
+  'returns': 'str' }
+
+##
+# @ObjectPropertyInfo:
+#
+# @name: the name of the property
+#
+# @type: the type of the property.  This will typically come in one of four
+#        forms:
+#
+#        1) A primitive type such as 'u8', 'u16', 'bool', 'str', or 'double'.
+#           These types are mapped to the appropriate JSON type.
+#
+#        2) A child type in the form 'child<subtype>' where subtype is a qdev
+#           device type name.  Child properties create the composition tree.
+#
+#        3) A link type in the form 'link<subtype>' where subtype is a qdev
+#           device type name.  Link properties form the device model graph.
+#
+# Since: 1.2
+##
+{ 'struct': 'ObjectPropertyInfo',
+  'data': { 'name': 'str', 'type': 'str' } }
+
+##
+# @qom-list:
+#
+# This command will list any properties of a object given a path in the object
+# model.
+#
+# @path: the path within the object model.  See @qom-get for a description of
+#        this parameter.
+#
+# Returns: a list of @ObjectPropertyInfo that describe the properties of the
+#          object.
+#
+# Since: 1.2
+##
+{ 'command': 'qom-list',
+  'data': { 'path': 'str' },
+  'returns': [ 'ObjectPropertyInfo' ] }
+
+##
+# @qom-get:
+#
+# This command will get a property from a object model path and return the
+# value.
+#
+# @path: The path within the object model.  There are two forms of supported
+#        paths--absolute and partial paths.
+#
+#        Absolute paths are derived from the root object and can follow child<>
+#        or link<> properties.  Since they can follow link<> properties, they
+#        can be arbitrarily long.  Absolute paths look like absolute filenames
+#        and are prefixed  with a leading slash.
+#
+#        Partial paths look like relative filenames.  They do not begin
+#        with a prefix.  The matching rules for partial paths are subtle but
+#        designed to make specifying objects easy.  At each level of the
+#        composition tree, the partial path is matched as an absolute path.
+#        The first match is not returned.  At least two matches are searched
+#        for.  A successful result is only returned if only one match is
+#        found.  If more than one match is found, a flag is return to
+#        indicate that the match was ambiguous.
+#
+# @property: The property name to read
+#
+# Returns: The property value.  The type depends on the property
+#          type. child<> and link<> properties are returned as #str
+#          pathnames.  All integer property types (u8, u16, etc) are
+#          returned as #int.
+#
+# Since: 1.2
+##
+{ 'command': 'qom-get',
+  'data': { 'path': 'str', 'property': 'str' },
+  'returns': 'any' }
+
+##
+# @qom-set:
+#
+# This command will set a property from a object model path.
+#
+# @path: see @qom-get for a description of this parameter
+#
+# @property: the property name to set
+#
+# @value: a value who's type is appropriate for the property type.  See @qom-get
+#         for a description of type mapping.
+#
+# Since: 1.2
+##
+{ 'command': 'qom-set',
+  'data': { 'path': 'str', 'property': 'str', 'value': 'any' } }
+
+##
+# @change:
+#
+# This command is multiple commands multiplexed together.
+#
+# @device: This is normally the name of a block device but it may also be 'vnc'.
+#          when it's 'vnc', then sub command depends on @target
+#
+# @target: If @device is a block device, then this is the new filename.
+#          If @device is 'vnc', then if the value 'password' selects the vnc
+#          change password command.   Otherwise, this specifies a new server URI
+#          address to listen to for VNC connections.
+#
+# @arg:    If @device is a block device, then this is an optional format to open
+#          the device with.
+#          If @device is 'vnc' and @target is 'password', this is the new VNC
+#          password to set.  See change-vnc-password for additional notes.
+#
+# Returns: Nothing on success.
+#          If @device is not a valid block device, DeviceNotFound
+#
+# Notes:  This interface is deprecated, and it is strongly recommended that you
+#         avoid using it.  For changing block devices, use
+#         blockdev-change-medium; for changing VNC parameters, use
+#         change-vnc-password.
+#
+# Since: 0.14.0
+#
+# Example:
+#
+# 1. Change a removable medium
+#
+# -> { "execute": "change",
+#      "arguments": { "device": "ide1-cd0",
+#                     "target": "/srv/images/Fedora-12-x86_64-DVD.iso" } }
+# <- { "return": {} }
+#
+# 2. Change VNC password
+#
+# -> { "execute": "change",
+#      "arguments": { "device": "vnc", "target": "password",
+#                     "arg": "foobar1" } }
+# <- { "return": {} }
+#
+##
+{ 'command': 'change',
+  'data': {'device': 'str', 'target': 'str', '*arg': 'str'} }
+
+##
+# @ObjectTypeInfo:
+#
+# This structure describes a search result from @qom-list-types
+#
+# @name: the type name found in the search
+#
+# @abstract: the type is abstract and can't be directly instantiated.
+#            Omitted if false. (since 2.10)
+#
+# @parent: Name of parent type, if any (since 2.10)
+#
+# Since: 1.1
+##
+{ 'struct': 'ObjectTypeInfo',
+  'data': { 'name': 'str', '*abstract': 'bool', '*parent': 'str' } }
+
+##
+# @qom-list-types:
+#
+# This command will return a list of types given search parameters
+#
+# @implements: if specified, only return types that implement this type name
+#
+# @abstract: if true, include abstract types in the results
+#
+# Returns: a list of @ObjectTypeInfo or an empty list if no results are found
+#
+# Since: 1.1
+##
+{ 'command': 'qom-list-types',
+  'data': { '*implements': 'str', '*abstract': 'bool' },
+  'returns': [ 'ObjectTypeInfo' ] }
+
+##
+# @DevicePropertyInfo:
+#
+# Information about device properties.
+#
+# @name: the name of the property
+# @type: the typename of the property
+# @description: if specified, the description of the property.
+#               (since 2.2)
+#
+# Since: 1.2
+##
+{ 'struct': 'DevicePropertyInfo',
+  'data': { 'name': 'str', 'type': 'str', '*description': 'str' } }
+
+##
+# @device-list-properties:
+#
+# List properties associated with a device.
+#
+# @typename: the type name of a device
+#
+# Returns: a list of DevicePropertyInfo describing a devices properties
+#
+# Since: 1.2
+##
+{ 'command': 'device-list-properties',
+  'data': { 'typename': 'str'},
+  'returns': [ 'DevicePropertyInfo' ] }
+
+##
+# @xen-set-global-dirty-log:
+#
+# Enable or disable the global dirty log mode.
+#
+# @enable: true to enable, false to disable.
+#
+# Returns: nothing
+#
+# Since: 1.3
+#
+# Example:
+#
+# -> { "execute": "xen-set-global-dirty-log",
+#      "arguments": { "enable": true } }
+# <- { "return": {} }
+#
+##
+{ 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
+
+##
+# @device_add:
+#
+# @driver: the name of the new device's driver
+#
+# @bus: the device's parent bus (device tree path)
+#
+# @id: the device's ID, must be unique
+#
+# Additional arguments depend on the type.
+#
+# Add a device.
+#
+# Notes:
+# 1. For detailed information about this command, please refer to the
+#    'docs/qdev-device-use.txt' file.
+#
+# 2. It's possible to list device properties by running QEMU with the
+#    "-device DEVICE,help" command-line argument, where DEVICE is the
+#    device's name
+#
+# Example:
+#
+# -> { "execute": "device_add",
+#      "arguments": { "driver": "e1000", "id": "net1",
+#                     "bus": "pci.0",
+#                     "mac": "52:54:00:12:34:56" } }
+# <- { "return": {} }
+#
+# TODO: This command effectively bypasses QAPI completely due to its
+# "additional arguments" business.  It shouldn't have been added to
+# the schema in this form.  It should be qapified properly, or
+# replaced by a properly qapified command.
+#
+# Since: 0.13
+##
+{ 'command': 'device_add',
+  'data': {'driver': 'str', '*bus': 'str', '*id': 'str'},
+  'gen': false } # so we can get the additional arguments
+
+##
+# @device_del:
+#
+# Remove a device from a guest
+#
+# @id: the device's ID or QOM path
+#
+# Returns: Nothing on success
+#          If @id is not a valid device, DeviceNotFound
+#
+# Notes: When this command completes, the device may not be removed from the
+#        guest.  Hot removal is an operation that requires guest cooperation.
+#        This command merely requests that the guest begin the hot removal
+#        process.  Completion of the device removal process is signaled with a
+#        DEVICE_DELETED event. Guest reset will automatically complete removal
+#        for all devices.
+#
+# Since: 0.14.0
+#
+# Example:
+#
+# -> { "execute": "device_del",
+#      "arguments": { "id": "net1" } }
+# <- { "return": {} }
+#
+# -> { "execute": "device_del",
+#      "arguments": { "id": "/machine/peripheral-anon/device[0]" } }
+# <- { "return": {} }
+#
+##
+{ 'command': 'device_del', 'data': {'id': 'str'} }
+
+##
+# @DEVICE_DELETED:
+#
+# Emitted whenever the device removal completion is acknowledged by the guest.
+# At this point, it's safe to reuse the specified device ID. Device removal can
+# be initiated by the guest or by HMP/QMP commands.
+#
+# @device: device name
+#
+# @path: device path
+#
+# Since: 1.5
+#
+# Example:
+#
+# <- { "event": "DEVICE_DELETED",
+#      "data": { "device": "virtio-net-pci-0",
+#                "path": "/machine/peripheral/virtio-net-pci-0" },
+#      "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
+#
+##
+{ 'event': 'DEVICE_DELETED',
+  'data': { '*device': 'str', 'path': 'str' } }
+
+##
+# @DumpGuestMemoryFormat:
+#
+# An enumeration of guest-memory-dump's format.
+#
+# @elf: elf format
+#
+# @kdump-zlib: kdump-compressed format with zlib-compressed
+#
+# @kdump-lzo: kdump-compressed format with lzo-compressed
+#
+# @kdump-snappy: kdump-compressed format with snappy-compressed
+#
+# Since: 2.0
+##
+{ 'enum': 'DumpGuestMemoryFormat',
+  'data': [ 'elf', 'kdump-zlib', 'kdump-lzo', 'kdump-snappy' ] }
+
+##
+# @dump-guest-memory:
+#
+# Dump guest's memory to vmcore. It is a synchronous operation that can take
+# very long depending on the amount of guest memory.
+#
+# @paging: if true, do paging to get guest's memory mapping. This allows
+#          using gdb to process the core file.
+#
+#          IMPORTANT: this option can make QEMU allocate several gigabytes
+#                     of RAM. This can happen for a large guest, or a
+#                     malicious guest pretending to be large.
+#
+#          Also, paging=true has the following limitations:
+#
+#             1. The guest may be in a catastrophic state or can have corrupted
+#                memory, which cannot be trusted
+#             2. The guest can be in real-mode even if paging is enabled. For
+#                example, the guest uses ACPI to sleep, and ACPI sleep state
+#                goes in real-mode
+#             3. Currently only supported on i386 and x86_64.
+#
+# @protocol: the filename or file descriptor of the vmcore. The supported
+#            protocols are:
+#
+#            1. file: the protocol starts with "file:", and the following
+#               string is the file's path.
+#            2. fd: the protocol starts with "fd:", and the following string
+#               is the fd's name.
+#
+# @detach: if true, QMP will return immediately rather than
+#          waiting for the dump to finish. The user can track progress
+#          using "query-dump". (since 2.6).
+#
+# @begin: if specified, the starting physical address.
+#
+# @length: if specified, the memory size, in bytes. If you don't
+#          want to dump all guest's memory, please specify the start @begin
+#          and @length
+#
+# @format: if specified, the format of guest memory dump. But non-elf
+#          format is conflict with paging and filter, ie. @paging, @begin and
+#          @length is not allowed to be specified with non-elf @format at the
+#          same time (since 2.0)
+#
+# Note: All boolean arguments default to false
+#
+# Returns: nothing on success
+#
+# Since: 1.2
+#
+# Example:
+#
+# -> { "execute": "dump-guest-memory",
+#      "arguments": { "protocol": "fd:dump" } }
+# <- { "return": {} }
+#
+##
+{ 'command': 'dump-guest-memory',
+  'data': { 'paging': 'bool', 'protocol': 'str', '*detach': 'bool',
+            '*begin': 'int', '*length': 'int',
+            '*format': 'DumpGuestMemoryFormat'} }
+
+##
+# @DumpStatus:
+#
+# Describe the status of a long-running background guest memory dump.
+#
+# @none: no dump-guest-memory has started yet.
+#
+# @active: there is one dump running in background.
+#
+# @completed: the last dump has finished successfully.
+#
+# @failed: the last dump has failed.
+#
+# Since: 2.6
+##
+{ 'enum': 'DumpStatus',
+  'data': [ 'none', 'active', 'completed', 'failed' ] }
+
+##
+# @DumpQueryResult:
+#
+# The result format for 'query-dump'.
+#
+# @status: enum of @DumpStatus, which shows current dump status
+#
+# @completed: bytes written in latest dump (uncompressed)
+#
+# @total: total bytes to be written in latest dump (uncompressed)
+#
+# Since: 2.6
+##
+{ 'struct': 'DumpQueryResult',
+  'data': { 'status': 'DumpStatus',
+            'completed': 'int',
+            'total': 'int' } }
+
+##
+# @query-dump:
+#
+# Query latest dump status.
+#
+# Returns: A @DumpStatus object showing the dump status.
+#
+# Since: 2.6
+#
+# Example:
+#
+# -> { "execute": "query-dump" }
+# <- { "return": { "status": "active", "completed": 1024000,
+#                  "total": 2048000 } }
+#
+##
+{ 'command': 'query-dump', 'returns': 'DumpQueryResult' }
+
+##
+# @DUMP_COMPLETED:
+#
+# Emitted when background dump has completed
+#
+# @result: DumpQueryResult type described in qapi-schema.json.
+#
+# @error: human-readable error string that provides
+#         hint on why dump failed. Only presents on failure. The
+#         user should not try to interpret the error string.
+#
+# Since: 2.6
+#
+# Example:
+#
+# { "event": "DUMP_COMPLETED",
+#   "data": {"result": {"total": 1090650112, "status": "completed",
+#                       "completed": 1090650112} } }
+#
+##
+{ 'event': 'DUMP_COMPLETED' ,
+  'data': { 'result': 'DumpQueryResult', '*error': 'str' } }
+
+##
+# @DumpGuestMemoryCapability:
+#
+# A list of the available formats for dump-guest-memory
+#
+# Since: 2.0
+##
+{ 'struct': 'DumpGuestMemoryCapability',
+  'data': {
+      'formats': ['DumpGuestMemoryFormat'] } }
+
+##
+# @query-dump-guest-memory-capability:
+#
+# Returns the available formats for dump-guest-memory
+#
+# Returns:  A @DumpGuestMemoryCapability object listing available formats for
+#           dump-guest-memory
+#
+# Since: 2.0
+#
+# Example:
+#
+# -> { "execute": "query-dump-guest-memory-capability" }
+# <- { "return": { "formats":
+#                  ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
+#
+##
+{ 'command': 'query-dump-guest-memory-capability',
+  'returns': 'DumpGuestMemoryCapability' }
+
+##
+# @dump-skeys:
+#
+# Dump guest's storage keys
+#
+# @filename: the path to the file to dump to
+#
+# This command is only supported on s390 architecture.
+#
+# Since: 2.5
+#
+# Example:
+#
+# -> { "execute": "dump-skeys",
+#      "arguments": { "filename": "/tmp/skeys" } }
+# <- { "return": {} }
+#
+##
+{ 'command': 'dump-skeys',
+  'data': { 'filename': 'str' } }
+
+##
+# @object-add:
+#
+# Create a QOM object.
+#
+# @qom-type: the class name for the object to be created
+#
+# @id: the name of the new object
+#
+# @props: a dictionary of properties to be passed to the backend
+#
+# Returns: Nothing on success
+#          Error if @qom-type is not a valid class name
+#
+# Since: 2.0
+#
+# Example:
+#
+# -> { "execute": "object-add",
+#      "arguments": { "qom-type": "rng-random", "id": "rng1",
+#                     "props": { "filename": "/dev/hwrng" } } }
+# <- { "return": {} }
+#
+##
+{ 'command': 'object-add',
+  'data': {'qom-type': 'str', 'id': 'str', '*props': 'any'} }
+
+##
+# @object-del:
+#
+# Remove a QOM object.
+#
+# @id: the name of the QOM object to remove
+#
+# Returns: Nothing on success
+#          Error if @id is not a valid id for a QOM object
+#
+# Since: 2.0
+#
+# Example:
+#
+# -> { "execute": "object-del", "arguments": { "id": "rng1" } }
+# <- { "return": {} }
+#
+##
+{ 'command': 'object-del', 'data': {'id': 'str'} }
+
+##
+# @getfd:
+#
+# Receive a file descriptor via SCM rights and assign it a name
+#
+# @fdname: file descriptor name
+#
+# Returns: Nothing on success
+#
+# Since: 0.14.0
+#
+# Notes: If @fdname already exists, the file descriptor assigned to
+#        it will be closed and replaced by the received file
+#        descriptor.
+#
+#        The 'closefd' command can be used to explicitly close the
+#        file descriptor when it is no longer needed.
+#
+# Example:
+#
+# -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
+# <- { "return": {} }
+#
+##
+{ 'command': 'getfd', 'data': {'fdname': 'str'} }
+
+##
+# @closefd:
+#
+# Close a file descriptor previously passed via SCM rights
+#
+# @fdname: file descriptor name
+#
+# Returns: Nothing on success
+#
+# Since: 0.14.0
+#
+# Example:
+#
+# -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
+# <- { "return": {} }
+#
+##
+{ 'command': 'closefd', 'data': {'fdname': 'str'} }
+
+##
+# @MachineInfo:
+#
+# Information describing a machine.
+#
+# @name: the name of the machine
+#
+# @alias: an alias for the machine name
+#
+# @is-default: whether the machine is default
+#
+# @cpu-max: maximum number of CPUs supported by the machine type
+#           (since 1.5.0)
+#
+# @hotpluggable-cpus: cpu hotplug via -device is supported (since 2.7.0)
+#
+# Since: 1.2.0
+##
+{ 'struct': 'MachineInfo',
+  'data': { 'name': 'str', '*alias': 'str',
+            '*is-default': 'bool', 'cpu-max': 'int',
+            'hotpluggable-cpus': 'bool'} }
+
+##
+# @query-machines:
+#
+# Return a list of supported machines
+#
+# Returns: a list of MachineInfo
+#
+# Since: 1.2.0
+##
+{ 'command': 'query-machines', 'returns': ['MachineInfo'] }
+
+##
+# @CpuDefinitionInfo:
+#
+# Virtual CPU definition.
+#
+# @name: the name of the CPU definition
+#
+# @migration-safe: whether a CPU definition can be safely used for
+#                  migration in combination with a QEMU compatibility machine
+#                  when migrating between different QMU versions and between
+#                  hosts with different sets of (hardware or software)
+#                  capabilities. If not provided, information is not available
+#                  and callers should not assume the CPU definition to be
+#                  migration-safe. (since 2.8)
+#
+# @static: whether a CPU definition is static and will not change depending on
+#          QEMU version, machine type, machine options and accelerator options.
+#          A static model is always migration-safe. (since 2.8)
+#
+# @unavailable-features: List of properties that prevent
+#                        the CPU model from running in the current
+#                        host. (since 2.8)
+# @typename: Type name that can be used as argument to @device-list-properties,
+#            to introspect properties configurable using -cpu or -global.
+#            (since 2.9)
+#
+# @unavailable-features is a list of QOM property names that
+# represent CPU model attributes that prevent the CPU from running.
+# If the QOM property is read-only, that means there's no known
+# way to make the CPU model run in the current host. Implementations
+# that choose not to provide specific information return the
+# property name "type".
+# If the property is read-write, it means that it MAY be possible
+# to run the CPU model in the current host if that property is
+# changed. Management software can use it as hints to suggest or
+# choose an alternative for the user, or just to generate meaningful
+# error messages explaining why the CPU model can't be used.
+# If @unavailable-features is an empty list, the CPU model is
+# runnable using the current host and machine-type.
+# If @unavailable-features is not present, runnability
+# information for the CPU is not available.
+#
+# Since: 1.2.0
+##
+{ 'struct': 'CpuDefinitionInfo',
+  'data': { 'name': 'str', '*migration-safe': 'bool', 'static': 'bool',
+            '*unavailable-features': [ 'str' ], 'typename': 'str' } }
+
+##
+# @MemoryInfo:
+#
+# Actual memory information in bytes.
+#
+# @base-memory: size of "base" memory specified with command line
+#               option -m.
+#
+# @plugged-memory: size of memory that can be hot-unplugged. This field
+#                  is omitted if target doesn't support memory hotplug
+#                  (i.e. CONFIG_MEM_HOTPLUG not defined on build time).
+#
+# Since: 2.11.0
+##
+{ 'struct': 'MemoryInfo',
+  'data'  : { 'base-memory': 'size', '*plugged-memory': 'size' } }
+
+##
+# @query-memory-size-summary:
+#
+# Return the amount of initially allocated and present hotpluggable (if
+# enabled) memory in bytes.
+#
+# Example:
+#
+# -> { "execute": "query-memory-size-summary" }
+# <- { "return": { "base-memory": 4294967296, "plugged-memory": 0 } }
+#
+# Since: 2.11.0
+##
+{ 'command': 'query-memory-size-summary', 'returns': 'MemoryInfo' }
+
+##
+# @query-cpu-definitions:
+#
+# Return a list of supported virtual CPU definitions
+#
+# Returns: a list of CpuDefInfo
+#
+# Since: 1.2.0
+##
+{ 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'] }
+
+##
+# @CpuModelInfo:
+#
+# Virtual CPU model.
+#
+# A CPU model consists of the name of a CPU definition, to which
+# delta changes are applied (e.g. features added/removed). Most magic values
+# that an architecture might require should be hidden behind the name.
+# However, if required, architectures can expose relevant properties.
+#
+# @name: the name of the CPU definition the model is based on
+# @props: a dictionary of QOM properties to be applied
+#
+# Since: 2.8.0
+##
+{ 'struct': 'CpuModelInfo',
+  'data': { 'name': 'str',
+            '*props': 'any' } }
+
+##
+# @CpuModelExpansionType:
+#
+# An enumeration of CPU model expansion types.
+#
+# @static: Expand to a static CPU model, a combination of a static base
+#          model name and property delta changes. As the static base model will
+#          never change, the expanded CPU model will be the same, independant of
+#          independent of QEMU version, machine type, machine options, and
+#          accelerator options. Therefore, the resulting model can be used by
+#          tooling without having to specify a compatibility machine - e.g. when
+#          displaying the "host" model. static CPU models are migration-safe.
+#
+# @full: Expand all properties. The produced model is not guaranteed to be
+#        migration-safe, but allows tooling to get an insight and work with
+#        model details.
+#
+# Note: When a non-migration-safe CPU model is expanded in static mode, some
+# features enabled by the CPU model may be omitted, because they can't be
+# implemented by a static CPU model definition (e.g. cache info passthrough and
+# PMU passthrough in x86). If you need an accurate representation of the
+# features enabled by a non-migration-safe CPU model, use @full. If you need a
+# static representation that will keep ABI compatibility even when changing QEMU
+# version or machine-type, use @static (but keep in mind that some features may
+# be omitted).
+#
+# Since: 2.8.0
+##
+{ 'enum': 'CpuModelExpansionType',
+  'data': [ 'static', 'full' ] }
+
+
+##
+# @CpuModelExpansionInfo:
+#
+# The result of a cpu model expansion.
+#
+# @model: the expanded CpuModelInfo.
+#
+# Since: 2.8.0
+##
+{ 'struct': 'CpuModelExpansionInfo',
+  'data': { 'model': 'CpuModelInfo' } }
+
+
+##
+# @query-cpu-model-expansion:
+#
+# Expands a given CPU model (or a combination of CPU model + additional options)
+# to different granularities, allowing tooling to get an understanding what a
+# specific CPU model looks like in QEMU under a certain configuration.
+#
+# This interface can be used to query the "host" CPU model.
+#
+# The data returned by this command may be affected by:
+#
+# * QEMU version: CPU models may look different depending on the QEMU version.
+#   (Except for CPU models reported as "static" in query-cpu-definitions.)
+# * machine-type: CPU model  may look different depending on the machine-type.
+#   (Except for CPU models reported as "static" in query-cpu-definitions.)
+# * machine options (including accelerator): in some architectures, CPU models
+#   may look different depending on machine and accelerator options. (Except for
+#   CPU models reported as "static" in query-cpu-definitions.)
+# * "-cpu" arguments and global properties: arguments to the -cpu option and
+#   global properties may affect expansion of CPU models. Using
+#   query-cpu-model-expansion while using these is not advised.
+#
+# Some architectures may not support all expansion types. s390x supports
+# "full" and "static".
+#
+# Returns: a CpuModelExpansionInfo. Returns an error if expanding CPU models is
+#          not supported, if the model cannot be expanded, if the model contains
+#          an unknown CPU definition name, unknown properties or properties
+#          with a wrong type. Also returns an error if an expansion type is
+#          not supported.
+#
+# Since: 2.8.0
+##
+{ 'command': 'query-cpu-model-expansion',
+  'data': { 'type': 'CpuModelExpansionType',
+            'model': 'CpuModelInfo' },
+  'returns': 'CpuModelExpansionInfo' }
+
+##
+# @CpuModelCompareResult:
+#
+# An enumeration of CPU model comparation results. The result is usually
+# calculated using e.g. CPU features or CPU generations.
+#
+# @incompatible: If model A is incompatible to model B, model A is not
+#                guaranteed to run where model B runs and the other way around.
+#
+# @identical: If model A is identical to model B, model A is guaranteed to run
+#             where model B runs and the other way around.
+#
+# @superset: If model A is a superset of model B, model B is guaranteed to run
+#            where model A runs. There are no guarantees about the other way.
+#
+# @subset: If model A is a subset of model B, model A is guaranteed to run
+#          where model B runs. There are no guarantees about the other way.
+#
+# Since: 2.8.0
+##
+{ 'enum': 'CpuModelCompareResult',
+  'data': [ 'incompatible', 'identical', 'superset', 'subset' ] }
+
+##
+# @CpuModelCompareInfo:
+#
+# The result of a CPU model comparison.
+#
+# @result: The result of the compare operation.
+# @responsible-properties: List of properties that led to the comparison result
+#                          not being identical.
+#
+# @responsible-properties is a list of QOM property names that led to
+# both CPUs not being detected as identical. For identical models, this
+# list is empty.
+# If a QOM property is read-only, that means there's no known way to make the
+# CPU models identical. If the special property name "type" is included, the
+# models are by definition not identical and cannot be made identical.
+#
+# Since: 2.8.0
+##
+{ 'struct': 'CpuModelCompareInfo',
+  'data': {'result': 'CpuModelCompareResult',
+           'responsible-properties': ['str']
+          }
+}
+
+##
+# @query-cpu-model-comparison:
+#
+# Compares two CPU models, returning how they compare in a specific
+# configuration. The results indicates how both models compare regarding
+# runnability. This result can be used by tooling to make decisions if a
+# certain CPU model will run in a certain configuration or if a compatible
+# CPU model has to be created by baselining.
+#
+# Usually, a CPU model is compared against the maximum possible CPU model
+# of a certain configuration (e.g. the "host" model for KVM). If that CPU
+# model is identical or a subset, it will run in that configuration.
+#
+# The result returned by this command may be affected by:
+#
+# * QEMU version: CPU models may look different depending on the QEMU version.
+#   (Except for CPU models reported as "static" in query-cpu-definitions.)
+# * machine-type: CPU model may look different depending on the machine-type.
+#   (Except for CPU models reported as "static" in query-cpu-definitions.)
+# * machine options (including accelerator): in some architectures, CPU models
+#   may look different depending on machine and accelerator options. (Except for
+#   CPU models reported as "static" in query-cpu-definitions.)
+# * "-cpu" arguments and global properties: arguments to the -cpu option and
+#   global properties may affect expansion of CPU models. Using
+#   query-cpu-model-expansion while using these is not advised.
+#
+# Some architectures may not support comparing CPU models. s390x supports
+# comparing CPU models.
+#
+# Returns: a CpuModelBaselineInfo. Returns an error if comparing CPU models is
+#          not supported, if a model cannot be used, if a model contains
+#          an unknown cpu definition name, unknown properties or properties
+#          with wrong types.
+#
+# Since: 2.8.0
+##
+{ 'command': 'query-cpu-model-comparison',
+  'data': { 'modela': 'CpuModelInfo', 'modelb': 'CpuModelInfo' },
+  'returns': 'CpuModelCompareInfo' }
+
+##
+# @CpuModelBaselineInfo:
+#
+# The result of a CPU model baseline.
+#
+# @model: the baselined CpuModelInfo.
+#
+# Since: 2.8.0
+##
+{ 'struct': 'CpuModelBaselineInfo',
+  'data': { 'model': 'CpuModelInfo' } }
+
+##
+# @query-cpu-model-baseline:
+#
+# Baseline two CPU models, creating a compatible third model. The created
+# model will always be a static, migration-safe CPU model (see "static"
+# CPU model expansion for details).
+#
+# This interface can be used by tooling to create a compatible CPU model out
+# two CPU models. The created CPU model will be identical to or a subset of
+# both CPU models when comparing them. Therefore, the created CPU model is
+# guaranteed to run where the given CPU models run.
+#
+# The result returned by this command may be affected by:
+#
+# * QEMU version: CPU models may look different depending on the QEMU version.
+#   (Except for CPU models reported as "static" in query-cpu-definitions.)
+# * machine-type: CPU model may look different depending on the machine-type.
+#   (Except for CPU models reported as "static" in query-cpu-definitions.)
+# * machine options (including accelerator): in some architectures, CPU models
+#   may look different depending on machine and accelerator options. (Except for
+#   CPU models reported as "static" in query-cpu-definitions.)
+# * "-cpu" arguments and global properties: arguments to the -cpu option and
+#   global properties may affect expansion of CPU models. Using
+#   query-cpu-model-expansion while using these is not advised.
+#
+# Some architectures may not support baselining CPU models. s390x supports
+# baselining CPU models.
+#
+# Returns: a CpuModelBaselineInfo. Returns an error if baselining CPU models is
+#          not supported, if a model cannot be used, if a model contains
+#          an unknown cpu definition name, unknown properties or properties
+#          with wrong types.
+#
+# Since: 2.8.0
+##
+{ 'command': 'query-cpu-model-baseline',
+  'data': { 'modela': 'CpuModelInfo',
+            'modelb': 'CpuModelInfo' },
+  'returns': 'CpuModelBaselineInfo' }
+
+##
+# @AddfdInfo:
+#
+# Information about a file descriptor that was added to an fd set.
+#
+# @fdset-id: The ID of the fd set that @fd was added to.
+#
+# @fd: The file descriptor that was received via SCM rights and
+#      added to the fd set.
+#
+# Since: 1.2.0
+##
+{ 'struct': 'AddfdInfo', 'data': {'fdset-id': 'int', 'fd': 'int'} }
+
+##
+# @add-fd:
+#
+# Add a file descriptor, that was passed via SCM rights, to an fd set.
+#
+# @fdset-id: The ID of the fd set to add the file descriptor to.
+#
+# @opaque: A free-form string that can be used to describe the fd.
+#
+# Returns: @AddfdInfo on success
+#
+#          If file descriptor was not received, FdNotSupplied
+#
+#          If @fdset-id is a negative value, InvalidParameterValue
+#
+# Notes: The list of fd sets is shared by all monitor connections.
+#
+#        If @fdset-id is not specified, a new fd set will be created.
+#
+# Since: 1.2.0
+#
+# Example:
+#
+# -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
+# <- { "return": { "fdset-id": 1, "fd": 3 } }
+#
+##
+{ 'command': 'add-fd', 'data': {'*fdset-id': 'int', '*opaque': 'str'},
+  'returns': 'AddfdInfo' }
+
+##
+# @remove-fd:
+#
+# Remove a file descriptor from an fd set.
+#
+# @fdset-id: The ID of the fd set that the file descriptor belongs to.
+#
+# @fd: The file descriptor that is to be removed.
+#
+# Returns: Nothing on success
+#          If @fdset-id or @fd is not found, FdNotFound
+#
+# Since: 1.2.0
+#
+# Notes: The list of fd sets is shared by all monitor connections.
+#
+#        If @fd is not specified, all file descriptors in @fdset-id
+#        will be removed.
+#
+# Example:
+#
+# -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
+# <- { "return": {} }
+#
+##
+{ 'command': 'remove-fd', 'data': {'fdset-id': 'int', '*fd': 'int'} }
+
+##
+# @FdsetFdInfo:
+#
+# Information about a file descriptor that belongs to an fd set.
+#
+# @fd: The file descriptor value.
+#
+# @opaque: A free-form string that can be used to describe the fd.
+#
+# Since: 1.2.0
+##
+{ 'struct': 'FdsetFdInfo',
+  'data': {'fd': 'int', '*opaque': 'str'} }
+
+##
+# @FdsetInfo:
+#
+# Information about an fd set.
+#
+# @fdset-id: The ID of the fd set.
+#
+# @fds: A list of file descriptors that belong to this fd set.
+#
+# Since: 1.2.0
+##
+{ 'struct': 'FdsetInfo',
+  'data': {'fdset-id': 'int', 'fds': ['FdsetFdInfo']} }
+
+##
+# @query-fdsets:
+#
+# Return information describing all fd sets.
+#
+# Returns: A list of @FdsetInfo
+#
+# Since: 1.2.0
+#
+# Note: The list of fd sets is shared by all monitor connections.
+#
+# Example:
+#
+# -> { "execute": "query-fdsets" }
+# <- { "return": [
+#        {
+#          "fds": [
+#            {
+#              "fd": 30,
+#              "opaque": "rdonly:/path/to/file"
+#            },
+#            {
+#              "fd": 24,
+#              "opaque": "rdwr:/path/to/file"
+#            }
+#          ],
+#          "fdset-id": 1
+#        },
+#        {
+#          "fds": [
+#            {
+#              "fd": 28
+#            },
+#            {
+#              "fd": 29
+#            }
+#          ],
+#          "fdset-id": 0
+#        }
+#      ]
+#    }
+#
+##
+{ 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
+
+##
+# @TargetInfo:
+#
+# Information describing the QEMU target.
+#
+# @arch: the target architecture (eg "x86_64", "i386", etc)
+#
+# Since: 1.2.0
+##
+{ 'struct': 'TargetInfo',
+  'data': { 'arch': 'str' } }
+
+##
+# @query-target:
+#
+# Return information about the target for this QEMU
+#
+# Returns: TargetInfo
+#
+# Since: 1.2.0
+##
+{ 'command': 'query-target', 'returns': 'TargetInfo' }
+
+##
+# @AcpiTableOptions:
+#
+# Specify an ACPI table on the command line to load.
+#
+# At most one of @file and @data can be specified. The list of files specified
+# by any one of them is loaded and concatenated in order. If both are omitted,
+# @data is implied.
+#
+# Other fields / optargs can be used to override fields of the generic ACPI
+# table header; refer to the ACPI specification 5.0, section 5.2.6 System
+# Description Table Header. If a header field is not overridden, then the
+# corresponding value from the concatenated blob is used (in case of @file), or
+# it is filled in with a hard-coded value (in case of @data).
+#
+# String fields are copied into the matching ACPI member from lowest address
+# upwards, and silently truncated / NUL-padded to length.
+#
+# @sig: table signature / identifier (4 bytes)
+#
+# @rev: table revision number (dependent on signature, 1 byte)
+#
+# @oem_id: OEM identifier (6 bytes)
+#
+# @oem_table_id: OEM table identifier (8 bytes)
+#
+# @oem_rev: OEM-supplied revision number (4 bytes)
+#
+# @asl_compiler_id: identifier of the utility that created the table
+#                   (4 bytes)
+#
+# @asl_compiler_rev: revision number of the utility that created the
+#                    table (4 bytes)
+#
+# @file: colon (:) separated list of pathnames to load and
+#        concatenate as table data. The resultant binary blob is expected to
+#        have an ACPI table header. At least one file is required. This field
+#        excludes @data.
+#
+# @data: colon (:) separated list of pathnames to load and
+#        concatenate as table data. The resultant binary blob must not have an
+#        ACPI table header. At least one file is required. This field excludes
+#        @file.
+#
+# Since: 1.5
+##
+{ 'struct': 'AcpiTableOptions',
+  'data': {
+    '*sig':               'str',
+    '*rev':               'uint8',
+    '*oem_id':            'str',
+    '*oem_table_id':      'str',
+    '*oem_rev':           'uint32',
+    '*asl_compiler_id':   'str',
+    '*asl_compiler_rev':  'uint32',
+    '*file':              'str',
+    '*data':              'str' }}
+
+##
+# @CommandLineParameterType:
+#
+# Possible types for an option parameter.
+#
+# @string: accepts a character string
+#
+# @boolean: accepts "on" or "off"
+#
+# @number: accepts a number
+#
+# @size: accepts a number followed by an optional suffix (K)ilo,
+#        (M)ega, (G)iga, (T)era
+#
+# Since: 1.5
+##
+{ 'enum': 'CommandLineParameterType',
+  'data': ['string', 'boolean', 'number', 'size'] }
+
+##
+# @CommandLineParameterInfo:
+#
+# Details about a single parameter of a command line option.
+#
+# @name: parameter name
+#
+# @type: parameter @CommandLineParameterType
+#
+# @help: human readable text string, not suitable for parsing.
+#
+# @default: default value string (since 2.1)
+#
+# Since: 1.5
+##
+{ 'struct': 'CommandLineParameterInfo',
+  'data': { 'name': 'str',
+            'type': 'CommandLineParameterType',
+            '*help': 'str',
+            '*default': 'str' } }
+
+##
+# @CommandLineOptionInfo:
+#
+# Details about a command line option, including its list of parameter details
+#
+# @option: option name
+#
+# @parameters: an array of @CommandLineParameterInfo
+#
+# Since: 1.5
+##
+{ 'struct': 'CommandLineOptionInfo',
+  'data': { 'option': 'str', 'parameters': ['CommandLineParameterInfo'] } }
+
+##
+# @query-command-line-options:
+#
+# Query command line option schema.
+#
+# @option: option name
+#
+# Returns: list of @CommandLineOptionInfo for all options (or for the given
+#          @option).  Returns an error if the given @option doesn't exist.
+#
+# Since: 1.5
+#
+# Example:
+#
+# -> { "execute": "query-command-line-options",
+#      "arguments": { "option": "option-rom" } }
+# <- { "return": [
+#         {
+#             "parameters": [
+#                 {
+#                     "name": "romfile",
+#                     "type": "string"
+#                 },
+#                 {
+#                     "name": "bootindex",
+#                     "type": "number"
+#                 }
+#             ],
+#             "option": "option-rom"
+#         }
+#      ]
+#    }
+#
+##
+{'command': 'query-command-line-options', 'data': { '*option': 'str' },
+ 'returns': ['CommandLineOptionInfo'] }
+
+##
+# @X86CPURegister32:
+#
+# A X86 32-bit register
+#
+# Since: 1.5
+##
+{ 'enum': 'X86CPURegister32',
+  'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
+
+##
+# @X86CPUFeatureWordInfo:
+#
+# Information about a X86 CPU feature word
+#
+# @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word
+#
+# @cpuid-input-ecx: Input ECX value for CPUID instruction for that
+#                   feature word
+#
+# @cpuid-register: Output register containing the feature bits
+#
+# @features: value of output register, containing the feature bits
+#
+# Since: 1.5
+##
+{ 'struct': 'X86CPUFeatureWordInfo',
+  'data': { 'cpuid-input-eax': 'int',
+            '*cpuid-input-ecx': 'int',
+            'cpuid-register': 'X86CPURegister32',
+            'features': 'int' } }
+
+##
+# @DummyForceArrays:
+#
+# Not used by QMP; hack to let us use X86CPUFeatureWordInfoList internally
+#
+# Since: 2.5
+##
+{ 'struct': 'DummyForceArrays',
+  'data': { 'unused': ['X86CPUFeatureWordInfo'] } }
+
+
+##
+# @NumaOptionsType:
+#
+# @node: NUMA nodes configuration
+#
+# @dist: NUMA distance configuration (since 2.10)
+#
+# @cpu: property based CPU(s) to node mapping (Since: 2.10)
+#
+# Since: 2.1
+##
+{ 'enum': 'NumaOptionsType',
+  'data': [ 'node', 'dist', 'cpu' ] }
+
+##
+# @NumaOptions:
+#
+# A discriminated record of NUMA options. (for OptsVisitor)
+#
+# Since: 2.1
+##
+{ 'union': 'NumaOptions',
+  'base': { 'type': 'NumaOptionsType' },
+  'discriminator': 'type',
+  'data': {
+    'node': 'NumaNodeOptions',
+    'dist': 'NumaDistOptions',
+    'cpu': 'NumaCpuOptions' }}
+
+##
+# @NumaNodeOptions:
+#
+# Create a guest NUMA node. (for OptsVisitor)
+#
+# @nodeid: NUMA node ID (increase by 1 from 0 if omitted)
+#
+# @cpus: VCPUs belonging to this node (assign VCPUS round-robin
+#         if omitted)
+#
+# @mem: memory size of this node; mutually exclusive with @memdev.
+#       Equally divide total memory among nodes if both @mem and @memdev are
+#       omitted.
+#
+# @memdev: memory backend object.  If specified for one node,
+#          it must be specified for all nodes.
+#
+# Since: 2.1
+##
+{ 'struct': 'NumaNodeOptions',
+  'data': {
+   '*nodeid': 'uint16',
+   '*cpus':   ['uint16'],
+   '*mem':    'size',
+   '*memdev': 'str' }}
+
+##
+# @NumaDistOptions:
+#
+# Set the distance between 2 NUMA nodes.
+#
+# @src: source NUMA node.
+#
+# @dst: destination NUMA node.
+#
+# @val: NUMA distance from source node to destination node.
+#       When a node is unreachable from another node, set the distance
+#       between them to 255.
+#
+# Since: 2.10
+##
+{ 'struct': 'NumaDistOptions',
+  'data': {
+   'src': 'uint16',
+   'dst': 'uint16',
+   'val': 'uint8' }}
+
+##
+# @NumaCpuOptions:
+#
+# Option "-numa cpu" overrides default cpu to node mapping.
+# It accepts the same set of cpu properties as returned by
+# query-hotpluggable-cpus[].props, where node-id could be used to
+# override default node mapping.
+#
+# Since: 2.10
+##
+{ 'struct': 'NumaCpuOptions',
+   'base': 'CpuInstanceProperties',
+   'data' : {} }
+
+##
+# @HostMemPolicy:
+#
+# Host memory policy types
+#
+# @default: restore default policy, remove any nondefault policy
+#
+# @preferred: set the preferred host nodes for allocation
+#
+# @bind: a strict policy that restricts memory allocation to the
+#        host nodes specified
+#
+# @interleave: memory allocations are interleaved across the set
+#              of host nodes specified
+#
+# Since: 2.1
+##
+{ 'enum': 'HostMemPolicy',
+  'data': [ 'default', 'preferred', 'bind', 'interleave' ] }
+
+##
+# @Memdev:
+#
+# Information about memory backend
+#
+# @id: backend's ID if backend has 'id' property (since 2.9)
+#
+# @size: memory backend size
+#
+# @merge: enables or disables memory merge support
+#
+# @dump: includes memory backend's memory in a core dump or not
+#
+# @prealloc: enables or disables memory preallocation
+#
+# @host-nodes: host nodes for its memory policy
+#
+# @policy: memory policy of memory backend
+#
+# Since: 2.1
+##
+{ 'struct': 'Memdev',
+  'data': {
+    '*id':        'str',
+    'size':       'size',
+    'merge':      'bool',
+    'dump':       'bool',
+    'prealloc':   'bool',
+    'host-nodes': ['uint16'],
+    'policy':     'HostMemPolicy' }}
+
+##
+# @query-memdev:
+#
+# Returns information for all memory backends.
+#
+# Returns: a list of @Memdev.
+#
+# Since: 2.1
+#
+# Example:
+#
+# -> { "execute": "query-memdev" }
+# <- { "return": [
+#        {
+#          "id": "mem1",
+#          "size": 536870912,
+#          "merge": false,
+#          "dump": true,
+#          "prealloc": false,
+#          "host-nodes": [0, 1],
+#          "policy": "bind"
+#        },
+#        {
+#          "size": 536870912,
+#          "merge": false,
+#          "dump": true,
+#          "prealloc": true,
+#          "host-nodes": [2, 3],
+#          "policy": "preferred"
+#        }
+#      ]
+#    }
+#
+##
+{ 'command': 'query-memdev', 'returns': ['Memdev'] }
+
+##
+# @PCDIMMDeviceInfo:
+#
+# PCDIMMDevice state information
+#
+# @id: device's ID
+#
+# @addr: physical address, where device is mapped
+#
+# @size: size of memory that the device provides
+#
+# @slot: slot number at which device is plugged in
+#
+# @node: NUMA node number where device is plugged in
+#
+# @memdev: memory backend linked with device
+#
+# @hotplugged: true if device was hotplugged
+#
+# @hotpluggable: true if device if could be added/removed while machine is running
+#
+# Since: 2.1
+##
+{ 'struct': 'PCDIMMDeviceInfo',
+  'data': { '*id': 'str',
+            'addr': 'int',
+            'size': 'int',
+            'slot': 'int',
+            'node': 'int',
+            'memdev': 'str',
+            'hotplugged': 'bool',
+            'hotpluggable': 'bool'
+          }
+}
+
+##
+# @MemoryDeviceInfo:
+#
+# Union containing information about a memory device
+#
+# Since: 2.1
+##
+{ 'union': 'MemoryDeviceInfo', 'data': {'dimm': 'PCDIMMDeviceInfo'} }
+
+##
+# @query-memory-devices:
+#
+# Lists available memory devices and their state
+#
+# Since: 2.1
+#
+# Example:
+#
+# -> { "execute": "query-memory-devices" }
+# <- { "return": [ { "data":
+#                       { "addr": 5368709120,
+#                         "hotpluggable": true,
+#                         "hotplugged": true,
+#                         "id": "d1",
+#                         "memdev": "/objects/memX",
+#                         "node": 0,
+#                         "size": 1073741824,
+#                         "slot": 0},
+#                    "type": "dimm"
+#                  } ] }
+#
+##
+{ 'command': 'query-memory-devices', 'returns': ['MemoryDeviceInfo'] }
+
+##
+# @MEM_UNPLUG_ERROR:
+#
+# Emitted when memory hot unplug error occurs.
+#
+# @device: device name
+#
+# @msg: Informative message
+#
+# Since: 2.4
+#
+# Example:
+#
+# <- { "event": "MEM_UNPLUG_ERROR"
+#      "data": { "device": "dimm1",
+#                "msg": "acpi: device unplug for unsupported device"
+#      },
+#      "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
+#
+##
+{ 'event': 'MEM_UNPLUG_ERROR',
+  'data': { 'device': 'str', 'msg': 'str' } }
+
+##
+# @ACPISlotType:
+#
+# @DIMM: memory slot
+# @CPU: logical CPU slot (since 2.7)
+##
+{ 'enum': 'ACPISlotType', 'data': [ 'DIMM', 'CPU' ] }
+
+##
+# @ACPIOSTInfo:
+#
+# OSPM Status Indication for a device
+# For description of possible values of @source and @status fields
+# see "_OST (OSPM Status Indication)" chapter of ACPI5.0 spec.
+#
+# @device: device ID associated with slot
+#
+# @slot: slot ID, unique per slot of a given @slot-type
+#
+# @slot-type: type of the slot
+#
+# @source: an integer containing the source event
+#
+# @status: an integer containing the status code
+#
+# Since: 2.1
+##
+{ 'struct': 'ACPIOSTInfo',
+  'data'  : { '*device': 'str',
+              'slot': 'str',
+              'slot-type': 'ACPISlotType',
+              'source': 'int',
+              'status': 'int' } }
+
+##
+# @query-acpi-ospm-status:
+#
+# Return a list of ACPIOSTInfo for devices that support status
+# reporting via ACPI _OST method.
+#
+# Since: 2.1
+#
+# Example:
+#
+# -> { "execute": "query-acpi-ospm-status" }
+# <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
+#                  { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
+#                  { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
+#                  { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
+#    ]}
+#
+##
+{ 'command': 'query-acpi-ospm-status', 'returns': ['ACPIOSTInfo'] }
+
+##
+# @ACPI_DEVICE_OST:
+#
+# Emitted when guest executes ACPI _OST method.
+#
+# @info: ACPIOSTInfo type as described in qapi-schema.json
+#
+# Since: 2.1
+#
+# Example:
+#
+# <- { "event": "ACPI_DEVICE_OST",
+#      "data": { "device": "d1", "slot": "0",
+#                "slot-type": "DIMM", "source": 1, "status": 0 } }
+#
+##
+{ 'event': 'ACPI_DEVICE_OST',
+     'data': { 'info': 'ACPIOSTInfo' } }
+
+##
+# @rtc-reset-reinjection:
+#
+# This command will reset the RTC interrupt reinjection backlog.
+# Can be used if another mechanism to synchronize guest time
+# is in effect, for example QEMU guest agent's guest-set-time
+# command.
+#
+# Since: 2.1
+#
+# Example:
+#
+# -> { "execute": "rtc-reset-reinjection" }
+# <- { "return": {} }
+#
+##
+{ 'command': 'rtc-reset-reinjection' }
+
+##
+# @RTC_CHANGE:
+#
+# Emitted when the guest changes the RTC time.
+#
+# @offset: offset between base RTC clock (as specified by -rtc base), and
+#          new RTC clock value
+#
+# Note: This event is rate-limited.
+#
+# Since: 0.13.0
+#
+# Example:
+#
+# <-   { "event": "RTC_CHANGE",
+#        "data": { "offset": 78 },
+#        "timestamp": { "seconds": 1267020223, "microseconds": 435656 } }
+#
+##
+{ 'event': 'RTC_CHANGE',
+  'data': { 'offset': 'int' } }
+
+##
+# @ReplayMode:
+#
+# Mode of the replay subsystem.
+#
+# @none: normal execution mode. Replay or record are not enabled.
+#
+# @record: record mode. All non-deterministic data is written into the
+#          replay log.
+#
+# @play: replay mode. Non-deterministic data required for system execution
+#        is read from the log.
+#
+# Since: 2.5
+##
+{ 'enum': 'ReplayMode',
+  'data': [ 'none', 'record', 'play' ] }
+
+##
+# @xen-load-devices-state:
+#
+# Load the state of all devices from file. The RAM and the block devices
+# of the VM are not loaded by this command.
+#
+# @filename: the file to load the state of the devices from as binary
+# data. See xen-save-devices-state.txt for a description of the binary
+# format.
+#
+# Since: 2.7
+#
+# Example:
+#
+# -> { "execute": "xen-load-devices-state",
+#      "arguments": { "filename": "/tmp/resume" } }
+# <- { "return": {} }
+#
+##
+{ 'command': 'xen-load-devices-state', 'data': {'filename': 'str'} }
+
+##
+# @GICCapability:
+#
+# The struct describes capability for a specific GIC (Generic
+# Interrupt Controller) version. These bits are not only decided by
+# QEMU/KVM software version, but also decided by the hardware that
+# the program is running upon.
+#
+# @version:  version of GIC to be described. Currently, only 2 and 3
+#            are supported.
+#
+# @emulated: whether current QEMU/hardware supports emulated GIC
+#            device in user space.
+#
+# @kernel:   whether current QEMU/hardware supports hardware
+#            accelerated GIC device in kernel.
+#
+# Since: 2.6
+##
+{ 'struct': 'GICCapability',
+  'data': { 'version': 'int',
+            'emulated': 'bool',
+            'kernel': 'bool' } }
+
+##
+# @query-gic-capabilities:
+#
+# This command is ARM-only. It will return a list of GICCapability
+# objects that describe its capability bits.
+#
+# Returns: a list of GICCapability objects.
+#
+# Since: 2.6
+#
+# Example:
+#
+# -> { "execute": "query-gic-capabilities" }
+# <- { "return": [{ "version": 2, "emulated": true, "kernel": false },
+#                 { "version": 3, "emulated": false, "kernel": true } ] }
+#
+##
+{ 'command': 'query-gic-capabilities', 'returns': ['GICCapability'] }
+
+##
+# @CpuInstanceProperties:
+#
+# List of properties to be used for hotplugging a CPU instance,
+# it should be passed by management with device_add command when
+# a CPU is being hotplugged.
+#
+# @node-id: NUMA node ID the CPU belongs to
+# @socket-id: socket number within node/board the CPU belongs to
+# @core-id: core number within socket the CPU belongs to
+# @thread-id: thread number within core the CPU belongs to
+#
+# Note: currently there are 4 properties that could be present
+# but management should be prepared to pass through other
+# properties with device_add command to allow for future
+# interface extension. This also requires the filed names to be kept in
+# sync with the properties passed to -device/device_add.
+#
+# Since: 2.7
+##
+{ 'struct': 'CpuInstanceProperties',
+  'data': { '*node-id': 'int',
+            '*socket-id': 'int',
+            '*core-id': 'int',
+            '*thread-id': 'int'
+  }
+}
+
+##
+# @HotpluggableCPU:
+#
+# @type: CPU object type for usage with device_add command
+# @props: list of properties to be used for hotplugging CPU
+# @vcpus-count: number of logical VCPU threads @HotpluggableCPU provides
+# @qom-path: link to existing CPU object if CPU is present or
+#            omitted if CPU is not present.
+#
+# Since: 2.7
+##
+{ 'struct': 'HotpluggableCPU',
+  'data': { 'type': 'str',
+            'vcpus-count': 'int',
+            'props': 'CpuInstanceProperties',
+            '*qom-path': 'str'
+          }
+}
+
+##
+# @query-hotpluggable-cpus:
+#
+# Returns: a list of HotpluggableCPU objects.
+#
+# Since: 2.7
+#
+# Example:
+#
+# For pseries machine type started with -smp 2,cores=2,maxcpus=4 -cpu POWER8:
+#
+# -> { "execute": "query-hotpluggable-cpus" }
+# <- {"return": [
+#      { "props": { "core": 8 }, "type": "POWER8-spapr-cpu-core",
+#        "vcpus-count": 1 },
+#      { "props": { "core": 0 }, "type": "POWER8-spapr-cpu-core",
+#        "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
+#    ]}'
+#
+# For pc machine type started with -smp 1,maxcpus=2:
+#
+# -> { "execute": "query-hotpluggable-cpus" }
+# <- {"return": [
+#      {
+#         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
+#         "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
+#      },
+#      {
+#         "qom-path": "/machine/unattached/device[0]",
+#         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
+#         "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}
+#      }
+#    ]}
+#
+# For s390x-virtio-ccw machine type started with -smp 1,maxcpus=2 -cpu qemu
+# (Since: 2.11):
+#
+# -> { "execute": "query-hotpluggable-cpus" }
+# <- {"return": [
+#      {
+#         "type": "qemu-s390x-cpu", "vcpus-count": 1,
+#         "props": { "core-id": 1 }
+#      },
+#      {
+#         "qom-path": "/machine/unattached/device[0]",
+#         "type": "qemu-s390x-cpu", "vcpus-count": 1,
+#         "props": { "core-id": 0 }
+#      }
+#    ]}
+#
+##
+{ 'command': 'query-hotpluggable-cpus', 'returns': ['HotpluggableCPU'] }
+
+##
+# @GuidInfo:
+#
+# GUID information.
+#
+# @guid: the globally unique identifier
+#
+# Since: 2.9
+##
+{ 'struct': 'GuidInfo', 'data': {'guid': 'str'} }
+
+##
+# @query-vm-generation-id:
+#
+# Show Virtual Machine Generation ID
+#
+# Since: 2.9
+##
+{ 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' }
diff --git a/qapi/run-state.json b/qapi/run-state.json
index bca46a8785..a27c3c2a93 100644
--- a/qapi/run-state.json
+++ b/qapi/run-state.json
@@ -283,6 +283,16 @@
   'data': [ 'reset', 'shutdown', 'poweroff', 'pause', 'debug', 'none',
             'inject-nmi' ] }
 
+
+##
+# @watchdog-set-action:
+#
+# Set watchdog action
+#
+# Since: 2.11
+##
+{ 'command': 'watchdog-set-action', 'data' : {'action': 'WatchdogAction'} }
+
 ##
 # @GUEST_PANICKED:
 #
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code
  2018-02-02 13:03 [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code Markus Armbruster
                   ` (20 preceding siblings ...)
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 21/21] qapi: Empty out qapi-schema.json Markus Armbruster
@ 2018-02-02 14:52 ` Markus Armbruster
  2018-02-02 16:44 ` Daniel P. Berrangé
                   ` (6 subsequent siblings)
  28 siblings, 0 replies; 87+ messages in thread
From: Markus Armbruster @ 2018-02-02 14:52 UTC (permalink / raw)
  To: qemu-devel; +Cc: marcandre.lureau, eblake, mdroth

Markus Armbruster <armbru@redhat.com> writes:

> Our qapi-schema.json is composed of modules connected by include
> directives, but the generated code is monolithic all the same: one
> qapi-types.h with all the types, one qapi-visit.h with all the
> visitors, and so forth.  These monolithic headers get included all
> over the place.  In my "build everyhing" tree, adding a QAPI type
> recompiles about 4500 out of 4800 objects.
>
> Nobody would write such monolithic headers by hand.  It stands to
> reason that one shouldn't generate them, either.
>
> This series' basic idea is to split up generated headers to mirror the
> schema's modular structure: one header per module.  That way, you can
> include just what you need.
>
> The series is RFC for a number of reasons:
>
> * The split is implemented only for qapi-types.h.  That one should
>   provide the biggest benefits, though.
>
> * There's a bit of code duplication.
>
> * I haven't re-read my patches, yet.

And of course

  * Needs a doc update

[...]

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 01/21] qapi: Streamline boilerplate comment generation
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 01/21] qapi: Streamline boilerplate comment generation Markus Armbruster
@ 2018-02-02 15:08   ` Eric Blake
  2018-02-03  8:45     ` Markus Armbruster
  2018-02-05 13:44   ` Marc-Andre Lureau
  1 sibling, 1 reply; 87+ messages in thread
From: Eric Blake @ 2018-02-02 15:08 UTC (permalink / raw)
  To: Markus Armbruster, qemu-devel; +Cc: marcandre.lureau, mdroth

[-- Attachment #1: Type: text/plain, Size: 1199 bytes --]

On 02/02/2018 07:03 AM, Markus Armbruster wrote:
> Every generator has separate boilerplate for .h and .c, and their
> differences are boring.  All of them repeat the license note.
> 
> Reduce the repetition as follows.  Move common text like the license
> note to common open_output(), next to the existintg common text there.

s/existintg/existing/

> For each generator, replace the two separate descriptions by a single
> one.
> 
> While there, emit an "automatically generated" note into generated
> documentation, too.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---

> +++ b/scripts/qapi2texi.py
> @@ -282,7 +282,8 @@ def main(argv):
>          print >>sys.stderr, ("%s: need pragma 'doc-required' "
>                               "to generate documentation" % argv[0])
>          sys.exit(1)
> -    print texi_schema(schema)
> +    print '@c AUTOMATICALLY GENERATED, DO NOT MODIFY\n'
> +    print texi_schema(schema),

Spurious addition of trailing comma. Otherwise,

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 02/21] qapi: Generate up-to-date copyright notice
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 02/21] qapi: Generate up-to-date copyright notice Markus Armbruster
@ 2018-02-02 15:47   ` Eric Blake
  2018-02-03  8:48     ` Markus Armbruster
  2018-02-05 13:44   ` Marc-Andre Lureau
  1 sibling, 1 reply; 87+ messages in thread
From: Eric Blake @ 2018-02-02 15:47 UTC (permalink / raw)
  To: Markus Armbruster, qemu-devel; +Cc: marcandre.lureau, mdroth

[-- Attachment #1: Type: text/plain, Size: 1982 bytes --]

On 02/02/2018 07:03 AM, Markus Armbruster wrote:
> Each generator carries a copyright notice for the generator itself,
> and another one for the files it generates.  Only the former have been
> updated along the way, the latter have not, and are all out of date.
> 
> Fix by copying the generator's copyright notice to the generated files
> instead.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---

> +++ b/scripts/qapi-commands.py
> @@ -1,16 +1,17 @@
> -#
> -# QAPI command marshaller generator
> -#
> -# Copyright IBM, Corp. 2011
> -# Copyright (C) 2014-2016 Red Hat, Inc.
> -#
> -# Authors:
> -#  Anthony Liguori <aliguori@us.ibm.com>
> -#  Michael Roth    <mdroth@linux.vnet.ibm.com>
> -#  Markus Armbruster <armbru@redhat.com>
> -#
> -# This work is licensed under the terms of the GNU GPL, version 2.
> -# See the COPYING file in the top-level directory.
> +"""
> +QAPI command marshaller generator
> +
> +Copyright IBM, Corp. 2011
> +Copyright (C) 2014-2018 Red Hat, Inc.
> +
> +Authors:
> + Anthony Liguori <aliguori@us.ibm.com>
> + Michael Roth <mdroth@linux.vnet.ibm.com>
> + Markus Armbruster <armbru@redhat.com>
> +
> +This work is licensed under the terms of the GNU GPL, version 2.
> +See the COPYING file in the top-level directory.
> +"""

So python lets you start a file with a string constant that is not
associated with any variable name?

>  
>  (fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix,
>                              'qmp-marshal.c', 'qmp-commands.h',
> -                            blurb)
> +                            blurb, __doc__)

Ah, and there's what I was missing - python auto-assigns such an initial
string to a magic automatic variable.  Cool language feature I hadn't
seen before!

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 03/21] qapi: New classes QAPIGenC, QAPIGenH, QAPIGenDoc
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 03/21] qapi: New classes QAPIGenC, QAPIGenH, QAPIGenDoc Markus Armbruster
@ 2018-02-02 15:59   ` Eric Blake
  2018-02-03  8:49     ` Markus Armbruster
  2018-02-05 13:44   ` Marc-Andre Lureau
  1 sibling, 1 reply; 87+ messages in thread
From: Eric Blake @ 2018-02-02 15:59 UTC (permalink / raw)
  To: Markus Armbruster, qemu-devel; +Cc: marcandre.lureau, mdroth

[-- Attachment #1: Type: text/plain, Size: 2337 bytes --]

On 02/02/2018 07:03 AM, Markus Armbruster wrote:
> These classes encapsulate accumulating and writing output.
> 
> Convert C code generation to QAPIGenC and QAPIGenH.  The conversion is
> rather shallow: most of the output accumulation is not converted.
> Left for later.
> 
> The indentation machinery uses a single global variable indent_level,
> even though we generally interleave creation of a .c and its .h.  It
> should become instance variable of QAPIGenC.  Also left for later.
> 
> Documentation generation isn't converted, and QAPIGenDoc isn't used.
> This will change shortly.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  scripts/qapi-commands.py   | 27 ++++++-------
>  scripts/qapi-event.py      | 26 +++++++------
>  scripts/qapi-introspect.py | 22 ++++++-----
>  scripts/qapi-types.py      | 26 +++++++------
>  scripts/qapi-visit.py      | 26 +++++++------
>  scripts/qapi.py            | 96 ++++++++++++++++++++++++++--------------------
>  6 files changed, 122 insertions(+), 101 deletions(-)
> 

A little bit longer due to more structure, but reasonable diffstat in
that it shows the conversion is fairly straightforward and opens the
doors for later patches to use the new structures more effectively.

>  
>  schema = QAPISchema(input_file)
> -gen = QAPISchemaGenEventVisitor()
> -schema.visit(gen)
> -fdef.write(gen.defn)
> -fdecl.write(gen.decl)
> +vis = QAPISchemaGenEventVisitor()
> +schema.visit(vis)
> +genc.body(vis.defn)
> +genh.body(vis.decl)

I don't know if it is worth a sentence in the commit message that the
visitor variable is renamed from 'gen' to 'vis' for less confusion with
the new class instances 'genc' and 'genh'.

> +++ b/scripts/qapi-types.py
> @@ -180,7 +180,7 @@ class QAPISchemaGenTypeVisitor(QAPISchemaVisitor):
>          self.decl = ''
>          self.defn = ''
>          self._fwdecl = ''
> -        self._btin = guardstart('QAPI_TYPES_BUILTIN')
> +        self._btin = '\n' + guardstart('QAPI_TYPES_BUILTIN')

Tweaks like this means you were paying attention to still producing
identical generated files; always a good sign.

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 04/21] qapi: Reduce use of global variables in generators some
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 04/21] qapi: Reduce use of global variables in generators some Markus Armbruster
@ 2018-02-02 16:03   ` Eric Blake
  2018-02-05 13:44   ` Marc-Andre Lureau
  1 sibling, 0 replies; 87+ messages in thread
From: Eric Blake @ 2018-02-02 16:03 UTC (permalink / raw)
  To: Markus Armbruster, qemu-devel; +Cc: marcandre.lureau, mdroth

[-- Attachment #1: Type: text/plain, Size: 438 bytes --]

On 02/02/2018 07:03 AM, Markus Armbruster wrote:
> In preparation of the next commit, which will turn the generators into
> modules.  These global variables will become local to main() then.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code
  2018-02-02 13:03 [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code Markus Armbruster
                   ` (21 preceding siblings ...)
  2018-02-02 14:52 ` [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code Markus Armbruster
@ 2018-02-02 16:44 ` Daniel P. Berrangé
  2018-02-03  9:18   ` Markus Armbruster
  2018-02-02 18:36 ` no-reply
                   ` (5 subsequent siblings)
  28 siblings, 1 reply; 87+ messages in thread
From: Daniel P. Berrangé @ 2018-02-02 16:44 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: qemu-devel, marcandre.lureau, mdroth

On Fri, Feb 02, 2018 at 02:03:15PM +0100, Markus Armbruster wrote:
> Our qapi-schema.json is composed of modules connected by include
> directives, but the generated code is monolithic all the same: one
> qapi-types.h with all the types, one qapi-visit.h with all the
> visitors, and so forth.  These monolithic headers get included all
> over the place.  In my "build everyhing" tree, adding a QAPI type
> recompiles about 4500 out of 4800 objects.
> 
> Nobody would write such monolithic headers by hand.  It stands to
> reason that one shouldn't generate them, either.
> 
> This series' basic idea is to split up generated headers to mirror the
> schema's modular structure: one header per module.  That way, you can
> include just what you need.
> 
> The series is RFC for a number of reasons:
> 
> * The split is implemented only for qapi-types.h.  That one should
>   provide the biggest benefits, though.
> 
> * There's a bit of code duplication.
> 
> * I haven't re-read my patches, yet.
> 
> Even in this incomplete state, the compile-time improvements can be
> massive.  Before this series, any QAPI schema change recompiles some
> 4500 out of 4800 objects in my "build everything" tree.  Afterwards,
> adding a type to qapi/migration.json recompiles less than 400, adding
> a QMP event recompiles less than 200, and a documentation change no
> longer recompiles anything.

Having gone through the same exercise for trace.h, I very much welcome
this effort for QAPI too !

If I consider the crypto stuff I maintain, the QAPI definitions are
in qapi/crypto.json.

>From my POV, I feel it would be natural to have them move to instead
be at  crypto/qapi.json, and have the generated headers/source files be
crypto/qapi-types.h, crypto/qapi-visit.h, etc.

This would mirror what we did with tracing, crypto/trace-events, and
generating crypto/trace*.{c,h}

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 05/21] qapi: Turn generators into modules
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 05/21] qapi: Turn generators into modules Markus Armbruster
@ 2018-02-02 16:47   ` Eric Blake
  2018-02-05 13:44   ` Marc-Andre Lureau
  1 sibling, 0 replies; 87+ messages in thread
From: Eric Blake @ 2018-02-02 16:47 UTC (permalink / raw)
  To: Markus Armbruster, qemu-devel; +Cc: marcandre.lureau, mdroth

[-- Attachment #1: Type: text/plain, Size: 1046 bytes --]

On 02/02/2018 07:03 AM, Markus Armbruster wrote:
> The next commit will introduce a common driver program for all
> generators.  The generators need to be modules for that.  qapi2texi.py
> already is.  Make the other generators follow suit.
> 
> The changes are actually trivial.  Obvious in the diffs once you view
> them with whitespace changes ignored.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  scripts/qapi-commands.py   | 43 ++++++++++++++++++--------------
>  scripts/qapi-event.py      | 43 ++++++++++++++++++--------------
>  scripts/qapi-introspect.py | 54 ++++++++++++++++++++++------------------
>  scripts/qapi-types.py      | 56 ++++++++++++++++++++++-------------------
>  scripts/qapi-visit.py      | 62 +++++++++++++++++++++++++---------------------
>  5 files changed, 143 insertions(+), 115 deletions(-)
> 

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code
  2018-02-02 13:03 [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code Markus Armbruster
                   ` (22 preceding siblings ...)
  2018-02-02 16:44 ` Daniel P. Berrangé
@ 2018-02-02 18:36 ` no-reply
  2018-02-02 19:33 ` no-reply
                   ` (4 subsequent siblings)
  28 siblings, 0 replies; 87+ messages in thread
From: no-reply @ 2018-02-02 18:36 UTC (permalink / raw)
  To: armbru; +Cc: famz, qemu-devel, marcandre.lureau, mdroth

Hi,

This series failed docker-mingw@fedora build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

Type: series
Message-id: 20180202130336.24719-1-armbru@redhat.com
Subject: [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code

=== TEST SCRIPT BEGIN ===
#!/bin/bash
set -e
git submodule update --init dtc
# Let docker tests dump environment info
export SHOW_ENV=1
export J=8
time make docker-test-mingw@fedora
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
Switched to a new branch 'test'
c046d2f10e qapi: Empty out qapi-schema.json
cdc634732e Include less of qapi-types.h
6c08b6809b qapi/types: Generate separate .h, .c for each module
3d0eed2242 qapi/common: Fix guardname() for funny filenames
0711fd2195 qapi/types qapi/visit: Generate built-in stuff into separate files
7ede02642f qapi/types qapi/visit: Make visitors use QAPIGen more
5692214a78 qapi: Record 'include' directives in intermediate representation
429e27e46c qapi: Generate in source order
0c655e94f7 qapi: Record 'include' directives in parse tree
42535161b1 qapi: Concentrate QAPISchemaParser.exprs updates in .__init__()
ab1ec2065d qapi: Lift error reporting from QAPISchema.__init__() to callers
471fb6f047 qapi/common: Eliminate QAPISchema.exprs
60e5203347 qapi: Don't absolutize include file name in error messages
8dc13338ce qapi: Touch generated files only when they change
31b120d6cf qapi: Move parse_command_line() next to its only use
d3c74048cf qapi-gen: New common driver for code and doc generators
f2a5a13014 qapi: Turn generators into modules
e6afdbb47e qapi: Reduce use of global variables in generators some
8afb71a043 qapi: New classes QAPIGenC, QAPIGenH, QAPIGenDoc
63aed1bbee qapi: Generate up-to-date copyright notice
f3af02ec25 qapi: Streamline boilerplate comment generation

=== OUTPUT BEGIN ===
Submodule 'dtc' (git://git.qemu-project.org/dtc.git) registered for path 'dtc'
Cloning into '/var/tmp/patchew-tester-tmp-cdbcg9v3/src/dtc'...
Submodule path 'dtc': checked out 'e54388015af1fb4bf04d0bca99caba1074d9cc42'
  BUILD   fedora
  GEN     /var/tmp/patchew-tester-tmp-cdbcg9v3/src/docker-src.2018-02-02-13.34.09.24306/qemu.tar
Cloning into '/var/tmp/patchew-tester-tmp-cdbcg9v3/src/docker-src.2018-02-02-13.34.09.24306/qemu.tar.vroot'...
done.
Checking out files:  48% (2826/5779)   
Checking out files:  49% (2832/5779)   
Checking out files:  50% (2890/5779)   
Checking out files:  51% (2948/5779)   
Checking out files:  52% (3006/5779)   
Checking out files:  53% (3063/5779)   
Checking out files:  54% (3121/5779)   
Checking out files:  55% (3179/5779)   
Checking out files:  56% (3237/5779)   
Checking out files:  57% (3295/5779)   
Checking out files:  58% (3352/5779)   
Checking out files:  59% (3410/5779)   
Checking out files:  60% (3468/5779)   
Checking out files:  61% (3526/5779)   
Checking out files:  62% (3583/5779)   
Checking out files:  63% (3641/5779)   
Checking out files:  64% (3699/5779)   
Checking out files:  65% (3757/5779)   
Checking out files:  66% (3815/5779)   
Checking out files:  67% (3872/5779)   
Checking out files:  68% (3930/5779)   
Checking out files:  69% (3988/5779)   
Checking out files:  70% (4046/5779)   
Checking out files:  71% (4104/5779)   
Checking out files:  72% (4161/5779)   
Checking out files:  73% (4219/5779)   
Checking out files:  74% (4277/5779)   
Checking out files:  75% (4335/5779)   
Checking out files:  76% (4393/5779)   
Checking out files:  77% (4450/5779)   
Checking out files:  78% (4508/5779)   
Checking out files:  79% (4566/5779)   
Checking out files:  80% (4624/5779)   
Checking out files:  81% (4681/5779)   
Checking out files:  82% (4739/5779)   
Checking out files:  83% (4797/5779)   
Checking out files:  84% (4855/5779)   
Checking out files:  85% (4913/5779)   
Checking out files:  86% (4970/5779)   
Checking out files:  87% (5028/5779)   
Checking out files:  88% (5086/5779)   
Checking out files:  89% (5144/5779)   
Checking out files:  90% (5202/5779)   
Checking out files:  91% (5259/5779)   
Checking out files:  92% (5317/5779)   
Checking out files:  93% (5375/5779)   
Checking out files:  94% (5433/5779)   
Checking out files:  95% (5491/5779)   
Checking out files:  96% (5548/5779)   
Checking out files:  97% (5606/5779)   
Checking out files:  98% (5664/5779)   
Checking out files:  99% (5722/5779)   
Checking out files: 100% (5779/5779)   
Checking out files: 100% (5779/5779), done.
Your branch is up-to-date with 'origin/test'.
Submodule 'dtc' (git://git.qemu-project.org/dtc.git) registered for path 'dtc'
Cloning into '/var/tmp/patchew-tester-tmp-cdbcg9v3/src/docker-src.2018-02-02-13.34.09.24306/qemu.tar.vroot/dtc'...
Submodule path 'dtc': checked out 'e54388015af1fb4bf04d0bca99caba1074d9cc42'
Submodule 'ui/keycodemapdb' (git://git.qemu.org/keycodemapdb.git) registered for path 'ui/keycodemapdb'
Cloning into '/var/tmp/patchew-tester-tmp-cdbcg9v3/src/docker-src.2018-02-02-13.34.09.24306/qemu.tar.vroot/ui/keycodemapdb'...
Submodule path 'ui/keycodemapdb': checked out '10739aa26051a5d49d88132604539d3ed085e72e'
  COPY    RUNNER
    RUN test-mingw in qemu:fedora 
Packages installed:
PyYAML-3.11-13.fc25.x86_64
SDL-devel-1.2.15-21.fc24.x86_64
bc-1.06.95-16.fc24.x86_64
bison-3.0.4-4.fc24.x86_64
bzip2-1.0.6-21.fc25.x86_64
ccache-3.3.4-1.fc25.x86_64
clang-3.9.1-2.fc25.x86_64
findutils-4.6.0-8.fc25.x86_64
flex-2.6.0-3.fc25.x86_64
gcc-6.4.1-1.fc25.x86_64
gcc-c++-6.4.1-1.fc25.x86_64
gettext-0.19.8.1-3.fc25.x86_64
git-2.9.5-3.fc25.x86_64
glib2-devel-2.50.3-1.fc25.x86_64
hostname-3.15-8.fc25.x86_64
libaio-devel-0.3.110-6.fc24.x86_64
libasan-6.4.1-1.fc25.x86_64
libfdt-devel-1.4.2-1.fc25.x86_64
libubsan-6.4.1-1.fc25.x86_64
make-4.1-6.fc25.x86_64
mingw32-SDL-1.2.15-7.fc24.noarch
mingw32-bzip2-1.0.6-7.fc24.noarch
mingw32-curl-7.47.0-1.fc24.noarch
mingw32-glib2-2.50.3-1.fc25.noarch
mingw32-gmp-6.1.1-1.fc25.noarch
mingw32-gnutls-3.5.5-2.fc25.noarch
mingw32-gtk2-2.24.31-2.fc25.noarch
mingw32-gtk3-3.22.17-1.fc25.noarch
mingw32-libjpeg-turbo-1.5.1-1.fc25.noarch
mingw32-libpng-1.6.27-1.fc25.noarch
mingw32-libssh2-1.4.3-5.fc24.noarch
mingw32-libtasn1-4.9-1.fc25.noarch
mingw32-nettle-3.3-1.fc25.noarch
mingw32-pixman-0.34.0-1.fc25.noarch
mingw32-pkg-config-0.28-6.fc24.x86_64
mingw64-SDL-1.2.15-7.fc24.noarch
mingw64-bzip2-1.0.6-7.fc24.noarch
mingw64-curl-7.47.0-1.fc24.noarch
mingw64-glib2-2.50.3-1.fc25.noarch
mingw64-gmp-6.1.1-1.fc25.noarch
mingw64-gnutls-3.5.5-2.fc25.noarch
mingw64-gtk2-2.24.31-2.fc25.noarch
mingw64-gtk3-3.22.17-1.fc25.noarch
mingw64-libjpeg-turbo-1.5.1-1.fc25.noarch
mingw64-libpng-1.6.27-1.fc25.noarch
mingw64-libssh2-1.4.3-5.fc24.noarch
mingw64-libtasn1-4.9-1.fc25.noarch
mingw64-nettle-3.3-1.fc25.noarch
mingw64-pixman-0.34.0-1.fc25.noarch
mingw64-pkg-config-0.28-6.fc24.x86_64
nettle-devel-3.3-1.fc25.x86_64
package python2 is not installed
perl-5.24.3-389.fc25.x86_64
pixman-devel-0.34.0-2.fc24.x86_64
sparse-0.5.0-10.fc25.x86_64
tar-1.29-3.fc25.x86_64
which-2.21-1.fc25.x86_64
zlib-devel-1.2.8-10.fc24.x86_64

Environment variables:
PACKAGES=ccache gettext git tar PyYAML sparse flex bison python2 bzip2 hostname     glib2-devel pixman-devel zlib-devel SDL-devel libfdt-devel     gcc gcc-c++ clang make perl which bc findutils libaio-devel     nettle-devel libasan libubsan     mingw32-pixman mingw32-glib2 mingw32-gmp mingw32-SDL mingw32-pkg-config     mingw32-gtk2 mingw32-gtk3 mingw32-gnutls mingw32-nettle mingw32-libtasn1     mingw32-libjpeg-turbo mingw32-libpng mingw32-curl mingw32-libssh2     mingw32-bzip2     mingw64-pixman mingw64-glib2 mingw64-gmp mingw64-SDL mingw64-pkg-config     mingw64-gtk2 mingw64-gtk3 mingw64-gnutls mingw64-nettle mingw64-libtasn1     mingw64-libjpeg-turbo mingw64-libpng mingw64-curl mingw64-libssh2     mingw64-bzip2
HOSTNAME=5dec8f26f883
MAKEFLAGS= -j8
J=8
CCACHE_DIR=/var/tmp/ccache
EXTRA_CONFIGURE_OPTS=
V=
SHOW_ENV=1
PATH=/usr/lib/ccache:/usr/lib64/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PWD=/
TARGET_LIST=
FGC=f25
SHLVL=1
HOME=/root
TEST_DIR=/tmp/qemu-test
DISTTAG=f25container
FEATURES=mingw clang pyyaml asan dtc
DEBUG=
_=/usr/bin/env

Configure options:
--enable-werror --target-list=x86_64-softmmu,aarch64-softmmu --prefix=/tmp/qemu-test/install --cross-prefix=x86_64-w64-mingw32- --enable-trace-backends=simple --enable-gnutls --enable-nettle --enable-curl --enable-vnc --enable-bzip2 --enable-guest-agent --with-sdlabi=1.2 --with-gtkabi=2.0
Install prefix    /tmp/qemu-test/install
BIOS directory    /tmp/qemu-test/install
firmware path     /tmp/qemu-test/install/share/qemu-firmware
binary directory  /tmp/qemu-test/install
library directory /tmp/qemu-test/install/lib
module directory  /tmp/qemu-test/install/lib
libexec directory /tmp/qemu-test/install/libexec
include directory /tmp/qemu-test/install/include
config directory  /tmp/qemu-test/install
local state directory   queried at runtime
Windows SDK       no
Source path       /tmp/qemu-test/src
GIT binary        git
GIT submodules    
C compiler        x86_64-w64-mingw32-gcc
Host C compiler   cc
C++ compiler      x86_64-w64-mingw32-g++
Objective-C compiler clang
ARFLAGS           rv
CFLAGS            -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -g 
QEMU_CFLAGS       -I/usr/x86_64-w64-mingw32/sys-root/mingw/include/pixman-1  -I$(SRC_PATH)/dtc/libfdt -Werror -mms-bitfields -I/usr/x86_64-w64-mingw32/sys-root/mingw/include/glib-2.0 -I/usr/x86_64-w64-mingw32/sys-root/mingw/lib/glib-2.0/include -I/usr/x86_64-w64-mingw32/sys-root/mingw/include  -m64 -mcx16 -mthreads -D__USE_MINGW_ANSI_STDIO=1 -DWIN32_LEAN_AND_MEAN -DWINVER=0x501 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv  -Wendif-labels -Wno-shift-negative-value -Wno-missing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-declaration -Wold-style-definition -Wtype-limits -fstack-protector-strong -I/usr/x86_64-w64-mingw32/sys-root/mingw/include -I/usr/x86_64-w64-mingw32/sys-root/mingw/include/p11-kit-1 -I/usr/x86_64-w64-mingw32/sys-root/mingw/include  -I/usr/x86_64-w64-mingw32/sys-root/mingw/include   -I/usr/x86_64-w64-mingw32/sys-root/mingw/include/libpng16 
LDFLAGS           -Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase -Wl,--warn-common -m64 -g 
make              make
install           install
python            python -B
smbd              /usr/sbin/smbd
module support    no
host CPU          x86_64
host big endian   no
target list       x86_64-softmmu aarch64-softmmu
gprof enabled     no
sparse enabled    no
strip binaries    yes
profiler          no
static build      no
SDL support       yes (1.2.15)
GTK support       yes (2.24.31)
GTK GL support    no
VTE support       no 
TLS priority      NORMAL
GNUTLS support    yes
GNUTLS rnd        yes
libgcrypt         no
libgcrypt kdf     no
nettle            yes (3.3)
nettle kdf        yes
libtasn1          yes
curses support    no
virgl support     no
curl support      yes
mingw32 support   yes
Audio drivers     dsound
Block whitelist (rw) 
Block whitelist (ro) 
VirtFS support    no
Multipath support no
VNC support       yes
VNC SASL support  no
VNC JPEG support  yes
VNC PNG support   yes
xen support       no
brlapi support    no
bluez  support    no
Documentation     no
PIE               no
vde support       no
netmap support    no
Linux AIO support no
ATTR/XATTR support no
Install blobs     yes
KVM support       no
HAX support       yes
HVF support       no
TCG support       yes
TCG debug enabled no
TCG interpreter   no
malloc trim support no
RDMA support      no
fdt support       yes
preadv support    no
fdatasync         no
madvise           no
posix_madvise     no
libcap-ng support no
vhost-net support no
vhost-scsi support no
vhost-vsock support no
vhost-user support no
Trace backends    simple
Trace output file trace-<pid>
spice support     no 
rbd support       no
xfsctl support    no
smartcard support no
libusb            no
usb net redir     no
OpenGL support    no
OpenGL dmabufs    no
libiscsi support  no
libnfs support    no
build guest agent yes
QGA VSS support   no
QGA w32 disk info yes
QGA MSI support   no
seccomp support   no
coroutine backend win32
coroutine pool    yes
debug stack usage no
crypto afalg      no
GlusterFS support no
gcov              gcov
gcov enabled      no
TPM support       yes
libssh2 support   yes
TPM passthrough   no
TPM emulator      no
QOM debugging     yes
Live block migration yes
lzo support       no
snappy support    no
bzip2 support     yes
NUMA host support no
libxml2           no
tcmalloc support  no
jemalloc support  no
avx2 optimization yes
replication support yes
VxHS block device no
capstone          no

WARNING: Use of GTK 2.0 is deprecated and will be removed in
WARNING: future releases. Please switch to using GTK 3.0

WARNING: Use of SDL 1.2 is deprecated and will be removed in
WARNING: future releases. Please switch to using SDL 2.0
  GEN     x86_64-softmmu/config-devices.mak.tmp
  GEN     config-host.h
  GEN     aarch64-softmmu/config-devices.mak.tmp
  GEN     qemu-options.def
  GEN     qapi-gen
  GEN     trace/generated-helpers-wrappers.h
  GEN     trace/generated-tcg-tracers.h
  GEN     trace/generated-helpers.h
  GEN     x86_64-softmmu/config-devices.mak
  GEN     trace/generated-helpers.c
  GEN     aarch64-softmmu/config-devices.mak
  GEN     module_block.h
  GEN     ui/input-keymap-atset1-to-qcode.c
  GEN     ui/input-keymap-linux-to-qcode.c
  GEN     ui/input-keymap-qcode-to-atset1.c
  GEN     ui/input-keymap-qcode-to-atset3.c
  GEN     ui/input-keymap-qcode-to-atset2.c
  GEN     ui/input-keymap-qcode-to-linux.c
  GEN     ui/input-keymap-qcode-to-qnum.c
  GEN     ui/input-keymap-qcode-to-sun.c
  GEN     ui/input-keymap-usb-to-qcode.c
  GEN     ui/input-keymap-qnum-to-qcode.c
  GEN     ui/input-keymap-win32-to-qcode.c
  GEN     ui/input-keymap-xorgevdev-to-qcode.c
  GEN     ui/input-keymap-x11-to-qcode.c
  GEN     ui/input-keymap-xorgkbd-to-qcode.c
  GEN     ui/input-keymap-xorgxquartz-to-qcode.c
  GEN     ui/input-keymap-xorgxwin-to-qcode.c
  GEN     tests/test-qapi-gen
  GEN     trace-root.h
  GEN     util/trace.h
  GEN     crypto/trace.h
  GEN     io/trace.h
  GEN     migration/trace.h
  GEN     block/trace.h
  GEN     chardev/trace.h
  GEN     hw/block/trace.h
  GEN     hw/block/dataplane/trace.h
  GEN     hw/char/trace.h
  GEN     hw/intc/trace.h
  GEN     hw/net/trace.h
  GEN     hw/virtio/trace.h
  GEN     hw/audio/trace.h
  GEN     hw/misc/trace.h
  GEN     hw/usb/trace.h
  GEN     hw/scsi/trace.h
  GEN     hw/nvram/trace.h
  GEN     hw/display/trace.h
  GEN     hw/input/trace.h
  GEN     hw/timer/trace.h
  GEN     hw/dma/trace.h
  GEN     hw/sparc/trace.h
  GEN     hw/sparc64/trace.h
  GEN     hw/sd/trace.h
  GEN     hw/isa/trace.h
  GEN     hw/mem/trace.h
  GEN     hw/i386/trace.h
  GEN     hw/i386/xen/trace.h
  GEN     hw/9pfs/trace.h
  GEN     hw/ppc/trace.h
  GEN     hw/pci/trace.h
  GEN     hw/pci-host/trace.h
  GEN     hw/s390x/trace.h
  GEN     hw/vfio/trace.h
  GEN     hw/acpi/trace.h
  GEN     hw/arm/trace.h
  GEN     hw/alpha/trace.h
  GEN     hw/hppa/trace.h
  GEN     hw/xen/trace.h
  GEN     hw/ide/trace.h
  GEN     ui/trace.h
  GEN     audio/trace.h
  GEN     net/trace.h
  GEN     target/arm/trace.h
  GEN     target/i386/trace.h
  GEN     target/mips/trace.h
  GEN     target/sparc/trace.h
  GEN     target/s390x/trace.h
  GEN     target/ppc/trace.h
  GEN     qom/trace.h
  GEN     linux-user/trace.h
  GEN     qapi/trace.h
  GEN     accel/tcg/trace.h
  GEN     accel/kvm/trace.h
  GEN     nbd/trace.h
  GEN     scsi/trace.h
  GEN     trace-root.c
  GEN     util/trace.c
  GEN     crypto/trace.c
  GEN     io/trace.c
  GEN     migration/trace.c
  GEN     block/trace.c
  GEN     chardev/trace.c
  GEN     hw/block/trace.c
  GEN     hw/block/dataplane/trace.c
  GEN     hw/char/trace.c
  GEN     hw/intc/trace.c
  GEN     hw/net/trace.c
  GEN     hw/virtio/trace.c
  GEN     hw/audio/trace.c
  GEN     hw/misc/trace.c
  GEN     hw/usb/trace.c
  GEN     hw/scsi/trace.c
  GEN     hw/nvram/trace.c
  GEN     hw/display/trace.c
  GEN     hw/input/trace.c
  GEN     hw/timer/trace.c
  GEN     hw/dma/trace.c
  GEN     hw/sparc/trace.c
  GEN     hw/sparc64/trace.c
  GEN     hw/sd/trace.c
  GEN     hw/isa/trace.c
  GEN     hw/mem/trace.c
  GEN     hw/i386/trace.c
  GEN     hw/i386/xen/trace.c
  GEN     hw/9pfs/trace.c
  GEN     hw/ppc/trace.c
  GEN     hw/pci/trace.c
  GEN     hw/pci-host/trace.c
  GEN     hw/s390x/trace.c
  GEN     hw/vfio/trace.c
  GEN     hw/acpi/trace.c
  GEN     hw/arm/trace.c
  GEN     hw/alpha/trace.c
  GEN     hw/hppa/trace.c
  GEN     hw/xen/trace.c
  GEN     hw/ide/trace.c
  GEN     ui/trace.c
  GEN     audio/trace.c
  GEN     net/trace.c
  GEN     target/arm/trace.c
  GEN     target/i386/trace.c
  GEN     target/mips/trace.c
  GEN     target/sparc/trace.c
  GEN     target/s390x/trace.c
  GEN     target/ppc/trace.c
  GEN     qom/trace.c
  GEN     linux-user/trace.c
  GEN     qapi/trace.c
  GEN     accel/tcg/trace.c
  GEN     accel/kvm/trace.c
  GEN     nbd/trace.c
  GEN     scsi/trace.c
  GEN     config-all-devices.mak
	 DEP /tmp/qemu-test/src/dtc/tests/dumptrees.c
	 DEP /tmp/qemu-test/src/dtc/tests/trees.S
	 DEP /tmp/qemu-test/src/dtc/tests/value-labels.c
	 DEP /tmp/qemu-test/src/dtc/tests/testutils.c
	 DEP /tmp/qemu-test/src/dtc/tests/asm_tree_dump.c
	 DEP /tmp/qemu-test/src/dtc/tests/truncated_property.c
	 DEP /tmp/qemu-test/src/dtc/tests/check_path.c
	 DEP /tmp/qemu-test/src/dtc/tests/overlay_bad_fixup.c
	 DEP /tmp/qemu-test/src/dtc/tests/overlay.c
	 DEP /tmp/qemu-test/src/dtc/tests/subnode_iterate.c
	 DEP /tmp/qemu-test/src/dtc/tests/property_iterate.c
	 DEP /tmp/qemu-test/src/dtc/tests/integer-expressions.c
	 DEP /tmp/qemu-test/src/dtc/tests/utilfdt_test.c
	 DEP /tmp/qemu-test/src/dtc/tests/path_offset_aliases.c
	 DEP /tmp/qemu-test/src/dtc/tests/add_subnode_with_nops.c
	 DEP /tmp/qemu-test/src/dtc/tests/dtbs_equal_unordered.c
	 DEP /tmp/qemu-test/src/dtc/tests/dtb_reverse.c
	 DEP /tmp/qemu-test/src/dtc/tests/dtbs_equal_ordered.c
	 DEP /tmp/qemu-test/src/dtc/tests/extra-terminating-null.c
	 DEP /tmp/qemu-test/src/dtc/tests/incbin.c
	 DEP /tmp/qemu-test/src/dtc/tests/boot-cpuid.c
	 DEP /tmp/qemu-test/src/dtc/tests/phandle_format.c
	 DEP /tmp/qemu-test/src/dtc/tests/path-references.c
	 DEP /tmp/qemu-test/src/dtc/tests/references.c
	 DEP /tmp/qemu-test/src/dtc/tests/string_escapes.c
	 DEP /tmp/qemu-test/src/dtc/tests/propname_escapes.c
	 DEP /tmp/qemu-test/src/dtc/tests/appendprop2.c
	 DEP /tmp/qemu-test/src/dtc/tests/appendprop1.c
	 DEP /tmp/qemu-test/src/dtc/tests/del_node.c
	 DEP /tmp/qemu-test/src/dtc/tests/del_property.c
	 DEP /tmp/qemu-test/src/dtc/tests/setprop.c
	 DEP /tmp/qemu-test/src/dtc/tests/set_name.c
	 DEP /tmp/qemu-test/src/dtc/tests/rw_tree1.c
	 DEP /tmp/qemu-test/src/dtc/tests/open_pack.c
	 DEP /tmp/qemu-test/src/dtc/tests/nopulate.c
	 DEP /tmp/qemu-test/src/dtc/tests/mangle-layout.c
	 DEP /tmp/qemu-test/src/dtc/tests/move_and_save.c
	 DEP /tmp/qemu-test/src/dtc/tests/sw_tree1.c
	 DEP /tmp/qemu-test/src/dtc/tests/nop_node.c
	 DEP /tmp/qemu-test/src/dtc/tests/nop_property.c
	 DEP /tmp/qemu-test/src/dtc/tests/setprop_inplace.c
	 DEP /tmp/qemu-test/src/dtc/tests/stringlist.c
	 DEP /tmp/qemu-test/src/dtc/tests/addr_size_cells.c
	 DEP /tmp/qemu-test/src/dtc/tests/notfound.c
	 DEP /tmp/qemu-test/src/dtc/tests/sized_cells.c
	 DEP /tmp/qemu-test/src/dtc/tests/char_literal.c
	 DEP /tmp/qemu-test/src/dtc/tests/get_alias.c
	 DEP /tmp/qemu-test/src/dtc/tests/node_offset_by_compatible.c
	 DEP /tmp/qemu-test/src/dtc/tests/node_check_compatible.c
	 DEP /tmp/qemu-test/src/dtc/tests/node_offset_by_phandle.c
	 DEP /tmp/qemu-test/src/dtc/tests/node_offset_by_prop_value.c
	 DEP /tmp/qemu-test/src/dtc/tests/parent_offset.c
	 DEP /tmp/qemu-test/src/dtc/tests/supernode_atdepth_offset.c
	 DEP /tmp/qemu-test/src/dtc/tests/get_path.c
	 DEP /tmp/qemu-test/src/dtc/tests/get_phandle.c
	 DEP /tmp/qemu-test/src/dtc/tests/getprop.c
	 DEP /tmp/qemu-test/src/dtc/tests/get_name.c
	 DEP /tmp/qemu-test/src/dtc/tests/path_offset.c
	 DEP /tmp/qemu-test/src/dtc/tests/find_property.c
	 DEP /tmp/qemu-test/src/dtc/tests/root_node.c
	 DEP /tmp/qemu-test/src/dtc/tests/get_mem_rsv.c
	 DEP /tmp/qemu-test/src/dtc/tests/subnode_offset.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt_overlay.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt_addresses.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt_empty_tree.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt_strerror.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt_rw.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt_sw.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt_wip.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt_ro.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt.c
	 DEP /tmp/qemu-test/src/dtc/util.c
	 DEP /tmp/qemu-test/src/dtc/fdtoverlay.c
	 DEP /tmp/qemu-test/src/dtc/fdtput.c
	 DEP /tmp/qemu-test/src/dtc/fdtget.c
	 DEP /tmp/qemu-test/src/dtc/fdtdump.c
	 LEX convert-dtsv0-lexer.lex.c
	 DEP /tmp/qemu-test/src/dtc/srcpos.c
	 BISON dtc-parser.tab.c
	 LEX dtc-lexer.lex.c
	 DEP /tmp/qemu-test/src/dtc/treesource.c
	 DEP /tmp/qemu-test/src/dtc/livetree.c
	 DEP /tmp/qemu-test/src/dtc/fstree.c
	 DEP /tmp/qemu-test/src/dtc/flattree.c
	 DEP /tmp/qemu-test/src/dtc/dtc.c
	 DEP /tmp/qemu-test/src/dtc/data.c
	 DEP /tmp/qemu-test/src/dtc/checks.c
	 DEP convert-dtsv0-lexer.lex.c
	 DEP dtc-parser.tab.c
	 DEP dtc-lexer.lex.c
	CHK version_gen.h
	UPD version_gen.h
	 DEP /tmp/qemu-test/src/dtc/util.c
	 CC libfdt/fdt.o
	 CC libfdt/fdt_ro.o
	 CC libfdt/fdt_sw.o
	 CC libfdt/fdt_rw.o
	 CC libfdt/fdt_wip.o
	 CC libfdt/fdt_strerror.o
	 CC libfdt/fdt_empty_tree.o
	 CC libfdt/fdt_addresses.o
	 CC libfdt/fdt_overlay.o
	 AR libfdt/libfdt.a
x86_64-w64-mingw32-ar: creating libfdt/libfdt.a
a - libfdt/fdt.o
a - libfdt/fdt_ro.o
a - libfdt/fdt_wip.o
a - libfdt/fdt_sw.o
a - libfdt/fdt_rw.o
a - libfdt/fdt_strerror.o
a - libfdt/fdt_empty_tree.o
a - libfdt/fdt_addresses.o
a - libfdt/fdt_overlay.o
  RC      version.o
  GEN     qga/qapi-generated/qapi-gen
  CC      qapi-builtin-types.o
  CC      qapi-builtin-visit.o
  CC      qapi-types.o
  CC      qapi/qapi-types-block-core.o
  CC      qapi/qapi-types-char.o
  CC      qapi/qapi-types-common.o
  CC      qapi/qapi-types-block.o
  CC      qapi/qapi-types-crypto.o
  CC      qapi/qapi-types-introspect.o
  CC      qapi/qapi-types-migration.o
  CC      qapi/qapi-types-misc.o
  CC      qapi/qapi-types-net.o
  CC      qapi/qapi-types-rocker.o
  CC      qapi/qapi-types-run-state.o
  CC      qapi/qapi-types-sockets.o
  CC      qapi/qapi-types-tpm.o
  CC      qapi/qapi-types-trace.o
  CC      qapi/qapi-types-transaction.o
  CC      qapi/qapi-types-ui.o
  CC      qmp-introspect.o
  CC      qapi-visit.o
  CC      qapi-event.o
  CC      qapi/qapi-visit-core.o
  CC      qapi/qapi-dealloc-visitor.o
  CC      qapi/qobject-input-visitor.o
  CC      qapi/qobject-output-visitor.o
  CC      qapi/qmp-registry.o
  CC      qapi/qmp-dispatch.o
  CC      qapi/string-input-visitor.o
  CC      qapi/string-output-visitor.o
  CC      qapi/opts-visitor.o
  CC      qapi/qapi-clone-visitor.o
  CC      qapi/qmp-event.o
  CC      qapi/qapi-util.o
  CC      qobject/qnull.o
  CC      qobject/qnum.o
  CC      qobject/qstring.o
  CC      qobject/qdict.o
  CC      qobject/qlist.o
  CC      qobject/qbool.o
  CC      qobject/qlit.o
  CC      qobject/qjson.o
  CC      qobject/qobject.o
  CC      qobject/json-lexer.o
  CC      qobject/json-streamer.o
  CC      qobject/json-parser.o
  CC      trace/simple.o
  CC      trace/control.o
  CC      trace/qmp.o
  CC      util/osdep.o
  CC      util/cutils.o
  CC      util/unicode.o
  CC      util/qemu-timer-common.o
  CC      util/bufferiszero.o
  CC      util/lockcnt.o
  CC      util/aiocb.o
  CC      util/async.o
  CC      util/thread-pool.o
  CC      util/qemu-timer.o
  CC      util/main-loop.o
  CC      util/aio-win32.o
  CC      util/iohandler.o
  CC      util/event_notifier-win32.o
  CC      util/oslib-win32.o
  CC      util/qemu-thread-win32.o
  CC      util/envlist.o
  CC      util/path.o
  CC      util/module.o
  CC      util/host-utils.o
  CC      util/bitmap.o
  CC      util/bitops.o
  CC      util/hbitmap.o
  CC      util/fifo8.o
  CC      util/acl.o
  CC      util/cacheinfo.o
  CC      util/error.o
  CC      util/qemu-error.o
  CC      util/id.o
  CC      util/iov.o
  CC      util/qemu-config.o
  CC      util/qemu-sockets.o
  CC      util/uri.o
  CC      util/notify.o
  CC      util/qemu-option.o
  CC      util/qemu-progress.o
  CC      util/keyval.o
  CC      util/hexdump.o
  CC      util/crc32c.o
  CC      util/uuid.o
  CC      util/throttle.o
  CC      util/getauxval.o
  CC      util/readline.o
  CC      util/rcu.o
  CC      util/qemu-coroutine.o
  CC      util/qemu-coroutine-lock.o
  CC      util/qemu-coroutine-io.o
  CC      util/qemu-coroutine-sleep.o
  CC      util/coroutine-win32.o
  CC      util/buffer.o
  CC      util/timed-average.o
  CC      util/base64.o
  CC      util/log.o
  CC      util/pagesize.o
  CC      util/qdist.o
  CC      util/qht.o
  CC      util/range.o
  CC      util/stats64.o
  CC      util/systemd.o
  CC      trace-root.o
  CC      crypto/trace.o
  CC      util/trace.o
  CC      io/trace.o
  CC      migration/trace.o
  CC      block/trace.o
  CC      chardev/trace.o
  CC      hw/block/trace.o
  CC      hw/block/dataplane/trace.o
  CC      hw/char/trace.o
  CC      hw/intc/trace.o
  CC      hw/net/trace.o
  CC      hw/virtio/trace.o
  CC      hw/audio/trace.o
  CC      hw/misc/trace.o
  CC      hw/usb/trace.o
  CC      hw/scsi/trace.o
  CC      hw/nvram/trace.o
  CC      hw/display/trace.o
  CC      hw/input/trace.o
  CC      hw/timer/trace.o
  CC      hw/dma/trace.o
  CC      hw/sparc/trace.o
  CC      hw/sparc64/trace.o
  CC      hw/sd/trace.o
  CC      hw/isa/trace.o
  CC      hw/mem/trace.o
  CC      hw/i386/trace.o
  CC      hw/i386/xen/trace.o
  CC      hw/9pfs/trace.o
  CC      hw/ppc/trace.o
  CC      hw/pci/trace.o
  CC      hw/pci-host/trace.o
  CC      hw/s390x/trace.o
  CC      hw/vfio/trace.o
  CC      hw/acpi/trace.o
  CC      hw/arm/trace.o
  CC      hw/alpha/trace.o
  CC      hw/hppa/trace.o
  CC      hw/xen/trace.o
  CC      hw/ide/trace.o
  CC      ui/trace.o
  CC      audio/trace.o
  CC      net/trace.o
  CC      target/arm/trace.o
  CC      target/i386/trace.o
  CC      target/mips/trace.o
  CC      target/sparc/trace.o
  CC      target/s390x/trace.o
  CC      target/ppc/trace.o
  CC      qom/trace.o
  CC      linux-user/trace.o
  CC      qapi/trace.o
  CC      accel/tcg/trace.o
  CC      accel/kvm/trace.o
  CC      nbd/trace.o
  CC      scsi/trace.o
  CC      crypto/pbkdf-stub.o
  CC      stubs/arch-query-cpu-def.o
  CC      stubs/arch-query-cpu-model-expansion.o
  CC      stubs/arch-query-cpu-model-comparison.o
  CC      stubs/arch-query-cpu-model-baseline.o
  CC      stubs/bdrv-next-monitor-owned.o
  CC      stubs/blk-commit-all.o
  CC      stubs/blockdev-close-all-bdrv-states.o
  CC      stubs/clock-warp.o
  CC      stubs/cpu-get-clock.o
  CC      stubs/cpu-get-icount.o
  CC      stubs/dump.o
  CC      stubs/error-printf.o
  CC      stubs/fdset.o
  CC      stubs/gdbstub.o
  CC      stubs/get-vm-name.o
  CC      stubs/iothread.o
  CC      stubs/iothread-lock.o
  CC      stubs/is-daemonized.o
  CC      stubs/machine-init-done.o
  CC      stubs/migr-blocker.o
  CC      stubs/change-state-handler.o
  CC      stubs/monitor.o
  CC      stubs/notify-event.o
  CC      stubs/qtest.o
  CC      stubs/replay.o
  CC      stubs/runstate-check.o
  CC      stubs/set-fd-handler.o
  CC      stubs/slirp.o
  CC      stubs/sysbus.o
  CC      stubs/tpm.o
  CC      stubs/trace-control.o
  CC      stubs/uuid.o
  CC      stubs/vm-stop.o
  CC      stubs/vmstate.o
  CC      stubs/fd-register.o
  CC      stubs/qmp_pc_dimm.o
  CC      stubs/target-monitor-defs.o
  CC      stubs/target-get-monitor-def.o
  CC      stubs/pc_madt_cpu_entry.o
  CC      stubs/vmgenid.o
  CC      stubs/xen-common.o
  CC      stubs/xen-hvm.o
  CC      stubs/pci-host-piix.o
  GEN     qemu-img-cmds.h
  CC      block.o
  CC      blockjob.o
  CC      qemu-io-cmds.o
  CC      replication.o
  CC      block/raw-format.o
  CC      block/qcow.o
  CC      block/vdi.o
  CC      block/vmdk.o
In file included from /tmp/qemu-test/src/block.c:29:0:
/tmp/qemu-test/src/include/block/nbd.h:262:40: error: unknown type name 'NbdServerRemoveMode'
 void nbd_export_remove(NBDExport *exp, NbdServerRemoveMode mode, Error **errp);
                                        ^~~~~~~~~~~~~~~~~~~
make: *** [block.o] Error 1
make: *** Waiting for unfinished jobs....
/tmp/qemu-test/src/rules.mak:66: recipe for target 'block.o' failed
Traceback (most recent call last):
  File "./tests/docker/docker.py", line 407, in <module>
    sys.exit(main())
  File "./tests/docker/docker.py", line 404, in main
    return args.cmdobj.run(args, argv)
  File "./tests/docker/docker.py", line 261, in run
    return Docker().run(argv, args.keep, quiet=args.quiet)
  File "./tests/docker/docker.py", line 229, in run
    quiet=quiet)
  File "./tests/docker/docker.py", line 147, in _do_check
    return subprocess.check_call(self._command + cmd, **kwargs)
  File "/usr/lib64/python2.7/subprocess.py", line 186, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['docker', 'run', '--label', 'com.qemu.instance.uuid=af677170084711e8a94652540069c830', '-u', '0', '--security-opt', 'seccomp=unconfined', '--rm', '--net=none', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=8', '-e', 'DEBUG=', '-e', 'SHOW_ENV=1', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/root/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-cdbcg9v3/src/docker-src.2018-02-02-13.34.09.24306:/var/tmp/qemu:z,ro', 'qemu:fedora', '/var/tmp/qemu/run', 'test-mingw']' returned non-zero exit status 2
make[1]: *** [tests/docker/Makefile.include:129: docker-run] Error 1
make: *** [tests/docker/Makefile.include:163: docker-run-test-mingw@fedora] Error 2

real	1m54.959s
user	0m5.115s
sys	0m3.582s
=== OUTPUT END ===

Test command exited with code: 2


---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@freelists.org

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 06/21] qapi-gen: New common driver for code and doc generators
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 06/21] qapi-gen: New common driver for code and doc generators Markus Armbruster
@ 2018-02-02 19:27   ` Eric Blake
  2018-02-03  9:03     ` Markus Armbruster
  2018-02-05 13:44   ` Marc-Andre Lureau
  1 sibling, 1 reply; 87+ messages in thread
From: Eric Blake @ 2018-02-02 19:27 UTC (permalink / raw)
  To: Markus Armbruster, qemu-devel; +Cc: marcandre.lureau, mdroth

[-- Attachment #1: Type: text/plain, Size: 6517 bytes --]

On 02/02/2018 07:03 AM, Markus Armbruster wrote:
> Whenever qapi-schema.json changes, we run six programs eleven times to
> update eleven files.  This is silly.  Replace the six programs by a
> single program that spits out all eleven files.

Yay, about time!

One program, but still invoked multiple times:

> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  Makefile                                           | 86 ++++++++++------------
>  scripts/qapi-gen.py                                | 41 +++++++++++
>  scripts/qapi/__init__.py                           |  0
>  scripts/{qapi-commands.py => qapi/commands.py}     | 23 ++----
>  scripts/{qapi.py => qapi/common.py}                |  0
>  scripts/{qapi2texi.py => qapi/doc.py}              | 29 ++------
>  scripts/{qapi-event.py => qapi/events.py}          | 23 ++----
>  scripts/{qapi-introspect.py => qapi/introspect.py} | 32 ++------
>  scripts/{qapi-types.py => qapi/types.py}           | 34 ++-------
>  scripts/{qapi-visit.py => qapi/visit.py}           | 34 ++-------

Maybe the commit message should mention:

This requires moving some files around for proper use in python.

>  tests/Makefile.include                             | 56 +++++++-------
>  tests/qapi-schema/test-qapi.py                     |  2 +-
>  12 files changed, 140 insertions(+), 220 deletions(-)
>  create mode 100755 scripts/qapi-gen.py
>  create mode 100644 scripts/qapi/__init__.py
>  rename scripts/{qapi-commands.py => qapi/commands.py} (94%)
>  rename scripts/{qapi.py => qapi/common.py} (100%)
>  rename scripts/{qapi2texi.py => qapi/doc.py} (92%)
>  mode change 100755 => 100644

Unintinentional?  We're inconsistent on which of our *.py files are
executable in git.  Does it matter whether a file that is designed for
use as a module is marked executable (if so, perhaps 5/21 should be
adding the x attribute on other files, rather than this patch removing
it on the doc generator).

> +++ b/Makefile

> +qga/qapi-generated/qga-qapi-types.c qga/qapi-generated/qga-qapi-types.h \
> +qga/qapi-generated/qga-qapi-visit.c qga/qapi-generated/qga-qapi-visit.h \
> +qga/qapi-generated/qga-qmp-commands.h qga/qapi-generated/qga-qmp-marshal.c \
> +qga/qapi-generated/qga-qapi.texi: \
> +qga/qapi-generated/qapi-gen-timestamp ;
> +qga/qapi-generated/qapi-gen-timestamp: $(SRC_PATH)/qga/qapi-schema.json $(qapi-py)
> +	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-gen.py \
> +		-o qga/qapi-generated -p "qga-" $<, \
> +		"GEN","$(@:%-timestamp=%)")
> +	@>$@

once for qga,


> +qapi-types.c qapi-types.h \
> +qapi-visit.c qapi-visit.h \
> +qmp-commands.h qmp-marshal.c \
> +qapi-event.c qapi-event.h \
> +qmp-introspect.h qmp-introspect.c \
> +qapi.texi: \
> +qapi-gen-timestamp ;
> +qapi-gen-timestamp: $(qapi-modules) $(qapi-py)
> +	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-gen.py \
> +		-o "." -b $<, \
> +		"GEN","$(@:%-timestamp=%)")
> +	@>$@

and again for the main level.  Still, a definite improvement!

> +++ b/scripts/qapi-gen.py

> +def main(argv):
> +    (input_file, output_dir, do_c, do_h, prefix, opts) = \
> +        parse_command_line('bu', ['builtins', 'unmask-non-abi-names'])
> +
> +    opt_builtins = False
> +    opt_unmask = False
> +
> +    for o, a in opts:
> +        if o in ('-b', '--builtins'):
> +            opt_builtins = True
> +        if o in ('-u', '--unmask-non-abi-names'):
> +            opt_unmask = True
> +
> +    schema = QAPISchema(input_file)
> +
> +    gen_types(schema, output_dir, prefix, opt_builtins)
> +    gen_visit(schema, output_dir, prefix, opt_builtins)
> +    gen_commands(schema, output_dir, prefix)
> +    gen_events(schema, output_dir, prefix)
> +    gen_introspect(schema, output_dir, prefix, opt_unmask)
> +    gen_doc(schema, output_dir, prefix)

Rather simple, but definitely nicer all in one python file than as a
series of make rules.

> @@ -255,13 +255,8 @@ class QAPISchemaGenCommandVisitor(QAPISchemaVisitor):
>          self._regy += gen_register_command(name, success_response)
>  
>  
> -def main(argv):
> -    (input_file, output_dir, do_c, do_h, prefix, opts) = parse_command_line()
> -
> -    blurb = '''
> - * Schema-defined QAPI/QMP commands
> -'''
> -
> +def gen_commands(schema, output_dir, prefix):
> +    blurb = ' * Schema-defined QAPI/QMP commands'

Some churn on the definition of blurb; worth tidying this in the
introduction earlier in the series?

> rename to scripts/qapi/introspect.py
> index 09e7d1f140..2153060f2c 100644
> --- a/scripts/qapi-introspect.py
> +++ b/scripts/qapi/introspect.py
> @@ -10,7 +10,7 @@ This work is licensed under the terms of the GNU GPL, version 2.
>  See the COPYING file in the top-level directory.
>  """
>  
> -from qapi import *
> +from qapi.common import *
>  
>  
>  # Caveman's json.dumps() replacement (we're stuck at Python 2.4)
> @@ -168,22 +168,8 @@ const char %(c_name)s[] = %(c_string)s;
>          self._gen_json(name, 'event', {'arg-type': self._use_type(arg_type)})
>  
>  
> -def main(argv):
> -    # Debugging aid: unmask QAPI schema's type names
> -    # We normally mask them, because they're not QMP wire ABI
> -    opt_unmask = False
> -
> -    (input_file, output_dir, do_c, do_h, prefix, opts) = \
> -        parse_command_line('u', ['unmask-non-abi-names'])

Hmm - we didn't have any docs about this hidden command line option; I
see you still preserved it, but it may be worth mentioning in your
pending doc updates for the series respin.

> --- a/tests/Makefile.include
> +++ b/tests/Makefile.include
> @@ -23,7 +23,16 @@ check-help:
>  ifneq ($(wildcard config-host.mak),)
>  export SRC_PATH
>  
> -qapi-py = $(SRC_PATH)/scripts/qapi.py $(SRC_PATH)/scripts/ordereddict.py
> +# TODO don't duplicate $(SRC_PATH)/Makefile's qapi-py here
> +qapi-py = $(SRC_PATH)/scripts/qapi/commands.py \
> +$(SRC_PATH)/scripts/qapi/events.py \
> +$(SRC_PATH)/scripts/qapi/introspect.py \
> +$(SRC_PATH)/scripts/qapi/types.py \
> +$(SRC_PATH)/scripts/qapi/visit.py \
> +$(SRC_PATH)/scripts/qapi/common.py \
> +$(SRC_PATH)/scripts/qapi/doc.py \
> +$(SRC_PATH)/scripts/ordereddict.py \
> +$(SRC_PATH)/scripts/qapi-gen.py

So, were you counting these in the 11 generated files mentioned in the
commit message? :)

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 07/21] qapi: Move parse_command_line() next to its only use
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 07/21] qapi: Move parse_command_line() next to its only use Markus Armbruster
@ 2018-02-02 19:29   ` Eric Blake
  2018-02-05 13:45   ` Marc-Andre Lureau
  1 sibling, 0 replies; 87+ messages in thread
From: Eric Blake @ 2018-02-02 19:29 UTC (permalink / raw)
  To: Markus Armbruster, qemu-devel; +Cc: marcandre.lureau, mdroth

[-- Attachment #1: Type: text/plain, Size: 515 bytes --]

On 02/02/2018 07:03 AM, Markus Armbruster wrote:
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  scripts/qapi-gen.py    | 52 +++++++++++++++++++++++++++++++++++++++++++++++-
>  scripts/qapi/common.py | 54 --------------------------------------------------
>  2 files changed, 51 insertions(+), 55 deletions(-)
> 

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code
  2018-02-02 13:03 [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code Markus Armbruster
                   ` (23 preceding siblings ...)
  2018-02-02 18:36 ` no-reply
@ 2018-02-02 19:33 ` no-reply
  2018-02-02 20:11 ` no-reply
                   ` (3 subsequent siblings)
  28 siblings, 0 replies; 87+ messages in thread
From: no-reply @ 2018-02-02 19:33 UTC (permalink / raw)
  To: armbru; +Cc: famz, qemu-devel, marcandre.lureau, mdroth

Hi,

This series failed build test on ppc host. Please find the details below.

Subject: [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code
Type: series
Message-id: 20180202130336.24719-1-armbru@redhat.com

=== TEST SCRIPT BEGIN ===
#!/bin/bash
# Testing script will be invoked under the git checkout with
# HEAD pointing to a commit that has the patches applied on top of "base"
# branch
set -e
echo "=== ENV ==="
env
echo "=== PACKAGES ==="
rpm -qa
echo "=== TEST BEGIN ==="
INSTALL=$PWD/install
BUILD=$PWD/build
mkdir -p $BUILD $INSTALL
SRC=$PWD
cd $BUILD
$SRC/configure --prefix=$INSTALL
make -j100
# XXX: we need reliable clean up
# make check -j100 V=1
make install
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 * [new tag]         patchew/20180202183731.29990-1-armbru@redhat.com -> patchew/20180202183731.29990-1-armbru@redhat.com
Submodule 'capstone' (git://git.qemu.org/capstone.git) registered for path 'capstone'
Submodule 'dtc' (git://git.qemu-project.org/dtc.git) registered for path 'dtc'
Submodule 'roms/QemuMacDrivers' (git://git.qemu.org/QemuMacDrivers.git) registered for path 'roms/QemuMacDrivers'
Submodule 'roms/SLOF' (git://git.qemu-project.org/SLOF.git) registered for path 'roms/SLOF'
Submodule 'roms/ipxe' (git://git.qemu-project.org/ipxe.git) registered for path 'roms/ipxe'
Submodule 'roms/openbios' (git://git.qemu-project.org/openbios.git) registered for path 'roms/openbios'
Submodule 'roms/openhackware' (git://git.qemu-project.org/openhackware.git) registered for path 'roms/openhackware'
Submodule 'roms/qemu-palcode' (git://github.com/rth7680/qemu-palcode.git) registered for path 'roms/qemu-palcode'
Submodule 'roms/seabios' (git://git.qemu-project.org/seabios.git/) registered for path 'roms/seabios'
Submodule 'roms/seabios-hppa' (git://github.com/hdeller/seabios-hppa.git) registered for path 'roms/seabios-hppa'
Submodule 'roms/sgabios' (git://git.qemu-project.org/sgabios.git) registered for path 'roms/sgabios'
Submodule 'roms/skiboot' (git://git.qemu.org/skiboot.git) registered for path 'roms/skiboot'
Submodule 'roms/u-boot' (git://git.qemu-project.org/u-boot.git) registered for path 'roms/u-boot'
Submodule 'roms/vgabios' (git://git.qemu-project.org/vgabios.git/) registered for path 'roms/vgabios'
Submodule 'ui/keycodemapdb' (git://git.qemu.org/keycodemapdb.git) registered for path 'ui/keycodemapdb'
Cloning into 'capstone'...
Submodule path 'capstone': checked out '22ead3e0bfdb87516656453336160e0a37b066bf'
Cloning into 'dtc'...
Submodule path 'dtc': checked out 'e54388015af1fb4bf04d0bca99caba1074d9cc42'
Cloning into 'roms/QemuMacDrivers'...
Submodule path 'roms/QemuMacDrivers': checked out 'd4e7d7ac663fcb55f1b93575445fcbca372f17a7'
Cloning into 'roms/SLOF'...
Submodule path 'roms/SLOF': checked out 'fa981320a1e0968d6fc1b8de319723ff8212b337'
Cloning into 'roms/ipxe'...
Submodule path 'roms/ipxe': checked out '0600d3ae94f93efd10fc6b3c7420a9557a3a1670'
Cloning into 'roms/openbios'...
Submodule path 'roms/openbios': checked out 'b5c93acd14b7b3886c2c81d84cd18e666984a4c8'
Cloning into 'roms/openhackware'...
Submodule path 'roms/openhackware': checked out 'c559da7c8eec5e45ef1f67978827af6f0b9546f5'
Cloning into 'roms/qemu-palcode'...
Submodule path 'roms/qemu-palcode': checked out 'f3c7e44c70254975df2a00af39701eafbac4d471'
Cloning into 'roms/seabios'...
Submodule path 'roms/seabios': checked out '63451fca13c75870e1703eb3e20584d91179aebc'
Cloning into 'roms/seabios-hppa'...
Submodule path 'roms/seabios-hppa': checked out '8fa4ca9935669414a824ecda24f6e70c36e8dc94'
Cloning into 'roms/sgabios'...
Submodule path 'roms/sgabios': checked out 'cbaee52287e5f32373181cff50a00b6c4ac9015a'
Cloning into 'roms/skiboot'...
Submodule path 'roms/skiboot': checked out 'e0ee24c27a172bcf482f6f2bc905e6211c134bcc'
Cloning into 'roms/u-boot'...
Submodule path 'roms/u-boot': checked out 'd85ca029f257b53a96da6c2fb421e78a003a9943'
Cloning into 'roms/vgabios'...
Submodule path 'roms/vgabios': checked out '19ea12c230ded95928ecaef0db47a82231c2e485'
Cloning into 'ui/keycodemapdb'...
Submodule path 'ui/keycodemapdb': checked out '10739aa26051a5d49d88132604539d3ed085e72e'
Switched to a new branch 'test'
c046d2f qapi: Empty out qapi-schema.json
cdc6347 Include less of qapi-types.h
6c08b68 qapi/types: Generate separate .h, .c for each module
3d0eed2 qapi/common: Fix guardname() for funny filenames
0711fd2 qapi/types qapi/visit: Generate built-in stuff into separate files
7ede026 qapi/types qapi/visit: Make visitors use QAPIGen more
5692214 qapi: Record 'include' directives in intermediate representation
429e27e qapi: Generate in source order
0c655e9 qapi: Record 'include' directives in parse tree
4253516 qapi: Concentrate QAPISchemaParser.exprs updates in .__init__()
ab1ec20 qapi: Lift error reporting from QAPISchema.__init__() to callers
471fb6f qapi/common: Eliminate QAPISchema.exprs
60e5203 qapi: Don't absolutize include file name in error messages
8dc1333 qapi: Touch generated files only when they change
31b120d qapi: Move parse_command_line() next to its only use
d3c7404 qapi-gen: New common driver for code and doc generators
f2a5a13 qapi: Turn generators into modules
e6afdbb qapi: Reduce use of global variables in generators some
8afb71a qapi: New classes QAPIGenC, QAPIGenH, QAPIGenDoc
63aed1b qapi: Generate up-to-date copyright notice
f3af02e qapi: Streamline boilerplate comment generation

=== OUTPUT BEGIN ===
=== ENV ===
XDG_SESSION_ID=169900
SHELL=/bin/sh
USER=patchew
PATCHEW=/home/patchew/patchew/patchew-cli -s http://patchew.org --nodebug
PATH=/usr/bin:/bin
PWD=/var/tmp/patchew-tester-tmp-q3ovq1d2/src
LANG=en_US.UTF-8
HOME=/home/patchew
SHLVL=2
LOGNAME=patchew
XDG_RUNTIME_DIR=/run/user/1000
_=/usr/bin/env
=== PACKAGES ===
plymouth-core-libs-0.8.9-0.28.20140113.el7.centos.ppc64le
vim-common-7.4.160-2.el7.ppc64le
perl-Test-Simple-0.98-243.el7.noarch
hplip-common-3.15.9-3.el7.ppc64le
valgrind-3.12.0-8.el7.ppc64le
gamin-0.1.10-16.el7.ppc64le
libpeas-loader-python-1.20.0-1.el7.ppc64le
telepathy-filesystem-0.0.2-6.el7.noarch
colord-libs-1.3.4-1.el7.ppc64le
kbd-legacy-1.15.5-13.el7.noarch
perl-CPAN-Meta-YAML-0.008-14.el7.noarch
libvirt-daemon-driver-nwfilter-3.2.0-14.el7.ppc64le
ntsysv-1.7.4-1.el7.ppc64le
kernel-bootwrapper-3.10.0-693.el7.ppc64le
telepathy-farstream-0.6.0-5.el7.ppc64le
kdenetwork-common-4.10.5-8.el7_0.noarch
elfutils-devel-0.168-8.el7.ppc64le
pm-utils-1.4.1-27.el7.ppc64le
perl-Error-0.17020-2.el7.noarch
usbmuxd-1.1.0-1.el7.ppc64le
bzip2-devel-1.0.6-13.el7.ppc64le
blktrace-1.0.5-8.el7.ppc64le
gnome-keyring-pam-3.20.0-3.el7.ppc64le
tzdata-java-2017b-1.el7.noarch
perl-devel-5.16.3-292.el7.ppc64le
gnome-getting-started-docs-3.22.0-1.el7.noarch
perl-Log-Message-Simple-0.10-2.el7.noarch
totem-pl-parser-3.10.7-1.el7.ppc64le
lohit-oriya-fonts-2.5.4.1-3.el7.noarch
python-coverage-3.6-0.5.b3.el7.ppc64le
java-1.7.0-openjdk-1.7.0.141-2.6.10.5.el7.ppc64le
mailcap-2.1.41-2.el7.noarch
perl-CPANPLUS-0.91.38-4.el7.noarch
fprintd-pam-0.5.0-4.0.el7_0.ppc64le
less-458-9.el7.ppc64le
gupnp-igd-0.2.4-1.el7.ppc64le
thai-scalable-waree-fonts-0.5.0-7.el7.noarch
python-di-0.3-2.el7.noarch
yelp-libs-3.22.0-1.el7.ppc64le
vte-profile-0.46.2-1.el7.ppc64le
gpm-libs-1.20.7-5.el7.ppc64le
gnome-clocks-3.22.1-1.el7.ppc64le
p11-kit-trust-0.23.5-3.el7.ppc64le
gssproxy-0.7.0-4.el7.ppc64le
gnu-free-mono-fonts-20120503-8.el7.noarch
python-dateutil-1.5-7.el7.noarch
gucharmap-libs-3.18.2-1.el7.ppc64le
glibc-common-2.17-196.el7.ppc64le
libreport-plugin-mantisbt-2.1.11-38.el7.centos.ppc64le
motif-devel-2.3.4-8.1.el7_3.ppc64le
celt051-0.5.1.3-8.el7.ppc64le
radvd-1.9.2-9.el7.ppc64le
lohit-tamil-fonts-2.5.3-2.el7.noarch
python-ipaddress-1.0.16-2.el7.noarch
anaconda-widgets-21.48.22.121-1.el7.centos.ppc64le
zlib-1.2.7-17.el7.ppc64le
system-config-printer-1.4.1-19.el7.ppc64le
mozjs24-24.2.0-7.el7.ppc64le
device-mapper-multipath-libs-0.4.9-111.el7.ppc64le
wqy-microhei-fonts-0.2.0-0.12.beta.el7.noarch
python-schedutils-0.4-6.el7.ppc64le
gnome-bluetooth-3.20.1-1.el7.ppc64le
nss-util-3.28.4-3.el7.ppc64le
dotconf-1.3-8.el7.ppc64le
ibus-rawcode-1.3.2-3.el7.ppc64le
abattis-cantarell-fonts-0.0.25-1.el7.noarch
sssd-common-1.15.2-50.el7.ppc64le
sil-padauk-fonts-2.8-5.el7.noarch
bind-utils-9.9.4-50.el7.ppc64le
sox-14.4.1-6.el7.ppc64le
libSM-1.2.2-2.el7.ppc64le
libtiff-devel-4.0.3-27.el7_3.ppc64le
plymouth-system-theme-0.8.9-0.28.20140113.el7.centos.ppc64le
python-libs-2.7.5-58.el7.ppc64le
sssd-1.15.2-50.el7.ppc64le
rfkill-0.4-9.el7.ppc64le
cyrus-sasl-md5-2.1.26-21.el7.ppc64le
libXtst-devel-1.2.3-1.el7.ppc64le
avahi-libs-0.6.31-17.el7.ppc64le
ruby-2.0.0.648-30.el7.ppc64le
seahorse-3.20.0-1.el7.ppc64le
python-six-1.9.0-2.el7.noarch
gpgme-1.3.2-5.el7.ppc64le
iwl7260-firmware-22.0.7.0-56.el7.noarch
libsss_certmap-1.15.2-50.el7.ppc64le
xorg-x11-drv-wacom-0.34.2-2.el7.ppc64le
libXau-1.0.8-2.1.el7.ppc64le
shadow-utils-4.1.5.1-24.el7.ppc64le
evolution-ews-3.22.6-6.el7.ppc64le
libsecret-0.18.5-2.el7.ppc64le
perl-Module-Signature-0.73-2.el7.noarch
rootfiles-8.1-11.el7.noarch
trace-cmd-2.6.0-8.el7.ppc64le
hamcrest-1.3-6.el7.noarch
gawk-4.0.2-4.el7_3.1.ppc64le
usermode-1.111-5.el7.ppc64le
gnome-terminal-nautilus-3.22.1-2.el7.ppc64le
gvfs-client-1.30.4-3.el7.ppc64le
yum-utils-1.1.31-42.el7.noarch
iwl3945-firmware-15.32.2.9-56.el7.noarch
perl-Archive-Zip-1.30-11.el7.noarch
spice-glib-0.33-6.el7.ppc64le
augeas-libs-1.4.0-2.el7.ppc64le
openlmi-providers-0.5.0-4.el7.ppc64le
gnome-color-manager-3.22.2-1.el7.ppc64le
imsettings-libs-1.6.3-9.el7.ppc64le
nss-softokn-devel-3.28.3-6.el7.ppc64le
python34-3.4.5-4.el7.ppc64le
perl-DBI-1.627-4.el7.ppc64le
plymouth-plugin-label-0.8.9-0.28.20140113.el7.centos.ppc64le
binutils-2.25.1-31.base.el7.ppc64le
libsss_nss_idmap-1.15.2-50.el7.ppc64le
gvfs-smb-1.30.4-3.el7.ppc64le
freetype-devel-2.4.11-15.el7.ppc64le
libXi-1.7.9-1.el7.ppc64le
libitm-4.8.5-16.el7_4.1.ppc64le
perl-Text-Diff-1.41-5.el7.noarch
gcr-devel-3.20.0-1.el7.ppc64le
numactl-libs-2.0.9-6.el7_2.ppc64le
hardlink-1.0-19.el7.ppc64le
gnome-disk-utility-3.22.1-1.el7.ppc64le
mariadb-libs-5.5.56-2.el7.ppc64le
libnotify-0.7.7-1.el7.ppc64le
perl-TimeDate-2.30-2.el7.noarch
soprano-devel-2.9.2-3.el7.ppc64le
pixman-0.34.0-1.el7.ppc64le
kmod-20-15.el7.ppc64le
qt3-PostgreSQL-3.3.8b-51.el7.ppc64le
python2-pyasn1-0.1.9-7.el7.noarch
libXt-1.1.5-3.el7.ppc64le
perl-Font-AFM-1.20-13.el7.noarch
ibus-1.5.3-13.el7.ppc64le
findutils-4.5.11-5.el7.ppc64le
ibus-libs-1.5.3-13.el7.ppc64le
iprutils-2.4.14.1-1.el7.ppc64le
libpwquality-1.2.3-4.el7.ppc64le
libXrender-devel-0.9.10-1.el7.ppc64le
perl-IO-stringy-2.110-22.el7.noarch
kdelibs-4.14.8-6.el7_3.ppc64le
flac-libs-1.3.0-5.el7_1.ppc64le
device-mapper-event-libs-1.02.140-8.el7.ppc64le
gnutls-devel-3.3.26-9.el7.ppc64le
libXau-devel-1.0.8-2.1.el7.ppc64le
gstreamer1-plugins-base-1.10.4-1.el7.ppc64le
perl-HTML-Tree-5.03-2.el7.noarch
kdenetwork-kopete-4.10.5-8.el7_0.ppc64le
libepoxy-1.3.1-1.el7.ppc64le
mesa-libGLES-17.0.1-6.20170307.el7.ppc64le
qt-postgresql-4.8.5-13.el7.ppc64le
fontconfig-devel-2.10.95-11.el7.ppc64le
java-1.8.0-openjdk-headless-1.8.0.131-11.b12.el7.ppc64le
libXfont-1.5.2-1.el7.ppc64le
libkexiv2-4.10.5-3.el7.ppc64le
openjpeg-libs-1.5.1-17.el7.ppc64le
iscsi-initiator-utils-6.2.0.874-4.el7.ppc64le
NetworkManager-adsl-1.8.0-9.el7.ppc64le
libgtop2-2.34.2-1.el7.ppc64le
libXdamage-devel-1.1.4-4.1.el7.ppc64le
ipset-libs-6.29-1.el7.ppc64le
kde-runtime-drkonqi-4.10.5-8.el7.ppc64le
e2fsprogs-libs-1.42.9-10.el7.ppc64le
dhclient-4.2.5-58.el7.centos.ppc64le
usbutils-007-5.el7.ppc64le
python-ethtool-0.8-5.el7.ppc64le
gstreamer1-plugins-bad-free-1.10.4-2.el7.ppc64le
fftw-libs-double-3.3.3-8.el7.ppc64le
kdenetwork-krdc-4.10.5-8.el7_0.ppc64le
fuse-libs-2.9.2-8.el7.ppc64le
pciutils-3.5.1-2.el7.ppc64le
at-3.1.13-22.el7.ppc64le
python-IPy-0.75-6.el7.noarch
libXp-1.0.2-2.1.el7.ppc64le
vim-minimal-7.4.160-2.el7.ppc64le
kdesdk-kmtrace-4.10.5-6.el7.ppc64le
libraw1394-2.1.0-2.el7.ppc64le
libdrm-devel-2.4.74-1.el7.ppc64le
irqbalance-1.0.7-10.el7.ppc64le
fipscheck-lib-1.4.1-6.el7.ppc64le
gvfs-1.30.4-3.el7.ppc64le
libiscsi-1.9.0-7.el7.ppc64le
motif-2.3.4-8.1.el7_3.ppc64le
keyutils-1.5.8-3.el7.ppc64le
NetworkManager-ppp-1.8.0-9.el7.ppc64le
systemtap-3.1-3.el7.ppc64le
boost-serialization-1.53.0-27.el7.ppc64le
grilo-0.3.3-1.el7.ppc64le
rpm-4.11.3-25.el7.ppc64le
kdegraphics-libs-4.10.5-3.el7.noarch
libfontenc-1.1.3-3.el7.ppc64le
perl-Git-1.8.3.1-11.el7.noarch
rubygem-abrt-0.3.0-1.el7.noarch
tcl-8.5.13-8.el7.ppc64le
gtksourceview3-3.22.2-1.el7.ppc64le
cmake-2.8.12.2-2.el7.ppc64le
pulseaudio-utils-10.0-3.el7.ppc64le
libusal-1.1.11-23.el7.ppc64le
grub2-ppc64le-2.02-0.64.el7.centos.ppc64le
libreport-plugin-mailx-2.1.11-38.el7.centos.ppc64le
libvisual-0.4.0-16.el7.ppc64le
metacity-2.34.13-7.el7.ppc64le
redland-virtuoso-1.0.16-6.el7.ppc64le
nautilus-3.22.3-3.el7.ppc64le
pciutils-libs-3.5.1-2.el7.ppc64le
soprano-2.9.2-3.el7.ppc64le
mariadb-devel-5.5.56-2.el7.ppc64le
libxkbcommon-x11-0.7.1-1.el7.ppc64le
farstream02-0.2.3-3.el7.ppc64le
redhat-rpm-config-9.1.0-76.el7.centos.noarch
skkdic-20130104-6.T1435.el7.noarch
perl-HTTP-Tiny-0.033-3.el7.noarch
lvm2-libs-2.02.171-8.el7.ppc64le
perl-XML-Grove-0.46alpha-52.el7.noarch
boost-devel-1.53.0-27.el7.ppc64le
pycairo-1.8.10-8.el7.ppc64le
popt-devel-1.13-16.el7.ppc64le
gnome-settings-daemon-3.22.2-5.el7.ppc64le
perl-Socket-2.010-4.el7.ppc64le
numad-0.5-17.20150602git.el7.ppc64le
e2fsprogs-devel-1.42.9-10.el7.ppc64le
libsecret-devel-0.18.5-2.el7.ppc64le
libXv-devel-1.0.11-1.el7.ppc64le
libchewing-0.3.4-6.el7.ppc64le
gnome-shell-extension-places-menu-3.22.2-10.el7.noarch
perl-Time-HiRes-1.9725-3.el7.ppc64le
openchange-2.3-2.el7.ppc64le
audit-libs-devel-2.7.6-3.el7.ppc64le
python-dmidecode-3.12.2-1.el7.ppc64le
libmediaart-1.9.1-1.el7.ppc64le
elfutils-default-yama-scope-0.168-8.el7.noarch
quota-4.01-14.el7.ppc64le
perl-threads-1.87-4.el7.ppc64le
realmd-0.16.1-9.el7.ppc64le
nautilus-sendto-3.8.4-1.el7.ppc64le
gstreamer-0.10.36-7.el7.ppc64le
cairo-gobject-devel-1.14.8-2.el7.ppc64le
abrt-libs-2.1.11-48.el7.centos.ppc64le
libvirt-daemon-driver-storage-iscsi-3.2.0-14.el7.ppc64le
perl-Pod-Parser-1.61-2.el7.noarch
python-devel-2.7.5-58.el7.ppc64le
mpfr-devel-3.1.1-4.el7.ppc64le
kernel-headers-3.10.0-693.el7.ppc64le
powerpc-utils-python-1.2.1-9.el7.noarch
linux-firmware-20170606-56.gitc990aae.el7.noarch
libqmi-1.16.0-1.el7.ppc64le
libvirt-libs-3.2.0-14.el7.ppc64le
perl-Digest-1.17-245.el7.noarch
libgcab1-0.7-3.el7.ppc64le
flex-2.5.37-3.el7.ppc64le
tzdata-2017b-1.el7.noarch
phonon-4.6.0-10.el7.ppc64le
anaconda-tui-21.48.22.121-1.el7.centos.ppc64le
libmbim-utils-1.14.0-2.el7.ppc64le
gnutls-utils-3.3.26-9.el7.ppc64le
perl-Parse-CPAN-Meta-1.4404-5.el7.noarch
flite-1.3-22.el7.ppc64le
nfs4-acl-tools-0.3.3-15.el7.ppc64le
poppler-data-0.4.6-3.el7.noarch
gvfs-fuse-1.30.4-3.el7.ppc64le
gnome-software-3.22.7-1.el7.ppc64le
perl-ExtUtils-ParseXS-3.18-3.el7.noarch
libvirt-python-3.2.0-3.el7.ppc64le
perl-Module-Load-Conditional-0.54-3.el7.noarch
python-netifaces-0.10.4-3.el7.ppc64le
swig-2.0.10-5.el7.ppc64le
ipa-client-common-4.5.0-20.el7.centos.noarch
cheese-libs-3.22.1-1.el7.ppc64le
gnome-tweak-tool-3.22.0-1.el7.noarch
perl-ExtUtils-CBuilder-0.28.2.6-292.el7.noarch
libsoup-devel-2.56.0-3.el7.ppc64le
perl-IO-Zlib-1.10-292.el7.noarch
fros-1.0-2.el7.noarch
lohit-devanagari-fonts-2.5.3-4.el7.noarch
grub2-ppc64le-modules-2.02-0.64.el7.centos.noarch
libgdata-0.17.8-1.el7.ppc64le
evince-nautilus-3.22.1-5.el7.ppc64le
perl-ExtUtils-Embed-1.30-292.el7.noarch
dleyna-connector-dbus-0.2.0-2.el7.ppc64le
libiec61883-1.2.0-10.el7.ppc64le
python-lxml-3.2.1-4.el7.ppc64le
liberation-serif-fonts-1.07.2-15.el7.noarch
tigervnc-license-1.8.0-1.el7.noarch
gnome-packagekit-3.22.1-2.el7.ppc64le
hpijs-3.15.9-3.el7.ppc64le
libmodman-2.0.1-8.el7.ppc64le
ntp-4.2.6p5-25.el7.centos.2.ppc64le
gmp-devel-6.0.0-15.el7.ppc64le
pyxattr-0.5.1-5.el7.ppc64le
sil-abyssinica-fonts-1.200-6.el7.noarch
ncurses-libs-5.9-13.20130511.el7.ppc64le
gnome-dictionary-libs-3.20.0-1.el7.ppc64le
kdesdk-devel-4.10.5-6.el7.ppc64le
libreport-rhel-anaconda-bugzilla-2.1.11-38.el7.centos.ppc64le
libvirt-daemon-config-network-3.2.0-14.el7.ppc64le
boost-iostreams-1.53.0-27.el7.ppc64le
python-ply-3.4-11.el7.noarch
ucs-miscfixed-fonts-0.3-11.el7.noarch
info-5.1-4.el7.ppc64le
libXxf86misc-devel-1.0.3-7.1.el7.ppc64le
ibus-qt-1.3.2-4.el7.ppc64le
gnome-video-effects-0.4.3-1.el7.noarch
bridge-utils-1.5-9.el7.ppc64le
make-3.82-23.el7.ppc64le
pywbem-0.7.0-25.20130827svn625.el7.noarch
pnm2ppa-1.04-28.el7.ppc64le
chkconfig-1.7.4-1.el7.ppc64le
at-spi2-atk-devel-2.22.0-2.el7.ppc64le
freeglut-devel-2.8.1-3.el7.ppc64le
jbigkit-libs-2.0-11.el7.ppc64le
sssd-ipa-1.15.2-50.el7.ppc64le
openssl-libs-1.0.2k-8.el7.ppc64le
ldns-1.6.16-10.el7.ppc64le
rdate-1.4-25.el7.ppc64le
libdb-5.3.21-20.el7.ppc64le
evince-libs-3.22.1-5.el7.ppc64le
empathy-3.12.12-4.el7.ppc64le
rubygem-json-1.7.7-30.el7.ppc64le
dmraid-1.0.0.rc16-28.el7.ppc64le
libblkid-2.23.2-43.el7.ppc64le
logrotate-3.8.6-14.el7.ppc64le
iwl105-firmware-18.168.6.1-56.el7.noarch
grep-2.20-3.el7.ppc64le
xorg-x11-drv-synaptics-1.9.0-1.el7.ppc64le
iowatcher-1.0-6.el7.ppc64le
rubygem-net-http-persistent-2.8-5.el7.noarch
setroubleshoot-plugins-3.0.65-1.el7.noarch
atk-2.22.0-3.el7.ppc64le
libcacard-2.5.2-2.el7.ppc64le
iwl6050-firmware-41.28.5.1-56.el7.noarch
lcms2-2.6-3.el7.ppc64le
tigervnc-server-minimal-1.8.0-1.el7.ppc64le
gvfs-goa-1.30.4-3.el7.ppc64le
authconfig-6.2.8-30.el7.ppc64le
yum-plugin-fastestmirror-1.1.31-42.el7.noarch
dbus-python-1.1.1-9.el7.ppc64le
perl-Archive-Tar-1.92-2.el7.noarch
iwl5000-firmware-8.83.5.1_1-56.el7.noarch
libacl-2.2.51-12.el7.ppc64le
farstream-0.1.2-8.el7.ppc64le
ppc64-utils-0.14-16.el7.ppc64le
servicelog-1.1.14-3.el7.ppc64le
python2-ipaclient-4.5.0-20.el7.centos.noarch
libpeas-1.20.0-1.el7.ppc64le
perl-TermReadKey-2.30-20.el7.ppc64le
hdparm-9.43-5.el7.ppc64le
libicu-50.1.2-15.el7.ppc64le
polkit-qt-0.103.0-10.el7_0.ppc64le
gnome-weather-3.20.2-1.el7.noarch
libmspack-0.5-0.5.alpha.el7.ppc64le
libkkc-data-0.3.1-9.el7.ppc64le
hicolor-icon-theme-0.12-7.el7.noarch
perl-Newt-1.08-36.el7.ppc64le
libstdc++-devel-4.8.5-16.el7_4.1.ppc64le
libexif-0.6.21-6.el7.ppc64le
gtk3-devel-3.22.10-4.el7.ppc64le
gvfs-mtp-1.30.4-3.el7.ppc64le
ncompress-4.2.4.4-3.el7.ppc64le
libXcomposite-0.4.4-4.1.el7.ppc64le
python-decorator-3.4.0-3.el7.noarch
perl-Business-ISBN-Data-20120719.001-2.el7.noarch
gcc-gfortran-4.8.5-16.el7_4.1.ppc64le
cpio-2.11-24.el7.ppc64le
mesa-libGLU-9.0.0-4.el7.ppc64le
baobab-3.22.1-1.el7.ppc64le
device-mapper-libs-1.02.140-8.el7.ppc64le
libXtst-1.2.3-1.el7.ppc64le
ModemManager-glib-1.6.0-2.el7.ppc64le
perl-HTML-Parser-3.71-4.el7.ppc64le
libical-1.0.1-1.el7.ppc64le
xorg-x11-xinit-1.3.4-1.el7.ppc64le
gstreamer1-plugins-base-devel-1.10.4-1.el7.ppc64le
libdrm-2.4.74-1.el7.ppc64le
libXfixes-devel-5.0.3-1.el7.ppc64le
python-gssapi-1.2.0-3.el7.ppc64le
perl-Text-Unidecode-0.04-20.el7.noarch
hunspell-1.3.2-15.el7.ppc64le
kde-settings-19-23.5.el7.centos.noarch
perl-App-cpanminus-1.6922-2.el7.noarch
parted-3.1-28.el7.ppc64le
mesa-libGL-17.0.1-6.20170307.el7.ppc64le
elfutils-libelf-devel-0.168-8.el7.ppc64le
perl-Net-LibIDN-0.12-15.el7.ppc64le
apr-1.4.8-3.el7.ppc64le
kdepimlibs-4.10.5-4.el7.ppc64le
virt-top-1.0.8-23.el7.ppc64le
samba-client-libs-4.6.2-8.el7.ppc64le
gstreamer-plugins-base-0.10.36-10.el7.ppc64le
json-glib-devel-1.2.6-1.el7.ppc64le
perl-autodie-2.16-2.el7.noarch
tar-1.26-32.el7.ppc64le
ksysguard-libs-4.11.19-8.el7.ppc64le
rdma-core-devel-13-7.el7.ppc64le
accountsservice-0.6.45-2.el7.ppc64le
libxklavier-5.4-7.el7.ppc64le
libxml2-devel-2.9.1-6.el7_2.3.ppc64le
ghostscript-fonts-5.50-32.el7.noarch
libassuan-2.1.0-3.el7.ppc64le
libkipi-devel-4.10.5-3.el7.ppc64le
python-smbc-1.0.13-7.el7.ppc64le
initscripts-9.49.39-1.el7.ppc64le
qt3-3.3.8b-51.el7.ppc64le
yum-metadata-parser-1.1.4-10.el7.ppc64le
device-mapper-persistent-data-0.7.0-0.1.rc6.el7.ppc64le
adwaita-icon-theme-3.22.0-1.el7.noarch
kdepim-4.10.5-6.el7.ppc64le
postfix-2.10.1-6.el7.ppc64le
abrt-addon-pstoreoops-2.1.11-48.el7.centos.ppc64le
freerdp-libs-1.0.2-10.el7.ppc64le
langtable-python-0.0.31-3.el7.noarch
tcp_wrappers-7.6-77.el7.ppc64le
lm_sensors-libs-3.4.0-4.20160601gitf9185e5.el7.ppc64le
kde-style-oxygen-4.11.19-8.el7.ppc64le
powertop-2.3-12.el7.ppc64le
wpa_supplicant-2.6-5.el7.ppc64le
gtk3-3.22.10-4.el7.ppc64le
boost-python-1.53.0-27.el7.ppc64le
keyutils-libs-devel-1.5.8-3.el7.ppc64le
libdvdread-5.0.3-3.el7.ppc64le
im-chooser-common-1.6.4-4.el7.ppc64le
aic94xx-firmware-30-6.el7.noarch
media-player-info-17-4.el7.noarch
compat-gnome-desktop314-3.14.2-1.el7.ppc64le
harfbuzz-1.3.2-1.el7.ppc64le
libgcrypt-devel-1.5.3-14.el7.ppc64le
groff-base-1.22.2-8.el7.ppc64le
sane-backends-1.0.24-9.el7.ppc64le
setuptool-1.19.11-8.el7.ppc64le
ebtables-2.0.10-15.el7.ppc64le
libchamplain-0.12.15-1.el7.ppc64le
boost-math-1.53.0-27.el7.ppc64le
libuser-0.60-7.el7_1.ppc64le
boost-date-time-1.53.0-27.el7.ppc64le
espeak-1.47.11-4.el7.ppc64le
tbb-devel-4.1-9.20130314.el7.ppc64le
grub2-tools-minimal-2.02-0.64.el7.centos.ppc64le
gjs-1.46.0-1.el7.ppc64le
libsss_autofs-1.15.2-50.el7.ppc64le
deltarpm-3.6-3.el7.ppc64le
libnl-1.1.4-3.el7.ppc64le
libgpod-0.8.2-12.el7.ppc64le
postgresql-devel-9.2.21-1.el7.ppc64le
libibcm-13-7.el7.ppc64le
abrt-gui-libs-2.1.11-48.el7.centos.ppc64le
libxkbcommon-0.7.1-1.el7.ppc64le
passwd-0.79-4.el7.ppc64le
lsvpd-1.7.8-1.el7.ppc64le
fprintd-0.5.0-4.0.el7_0.ppc64le
hunspell-en-0.20121024-6.el7.noarch
qca-ossl-2.0.0-0.19.beta3.el7.ppc64le
libdmapsharing-2.9.37-1.el7.ppc64le
ortp-0.20.0-10.el7.ppc64le
python-pycurl-7.19.0-19.el7.ppc64le
perl-Pod-Escapes-1.04-292.el7.noarch
pcp-3.11.8-7.el7.ppc64le
libblkid-devel-2.23.2-43.el7.ppc64le
dracut-network-033-502.el7.ppc64le
pyatspi-2.20.3-1.el7.noarch
systemtap-sdt-devel-3.1-3.el7.ppc64le
check-0.9.9-5.el7.ppc64le
perl-threads-shared-1.43-6.el7.ppc64le
gnome-shell-extension-common-3.22.2-10.el7.noarch
gnome-icon-theme-symbolic-3.12.0-2.el7.noarch
abrt-cli-2.1.11-48.el7.centos.ppc64le
festival-speechtools-libs-1.2.96-28.el7.ppc64le
python-slip-dbus-0.4.0-2.el7.noarch
mesa-private-llvm-3.9.1-3.el7.ppc64le
perl-Time-Local-1.2300-2.el7.noarch
yelp-3.22.0-1.el7.ppc64le
fuse-devel-2.9.2-8.el7.ppc64le
dnsmasq-2.76-2.el7.ppc64le
festvox-slt-arctic-hts-0.20061229-28.el7.noarch
libtasn1-devel-4.10-1.el7.ppc64le
libgudev1-219-42.el7.ppc64le
perl-version-0.99.07-2.el7.ppc64le
libvirt-daemon-driver-qemu-3.2.0-14.el7.ppc64le
ps_mem-3.1-7.el7.noarch
rtkit-0.11-10.el7.ppc64le
abrt-gui-2.1.11-48.el7.centos.ppc64le
nettle-devel-2.7.1-8.el7.ppc64le
perl-ExtUtils-Manifest-1.61-244.el7.noarch
libreswan-3.20-3.el7.ppc64le
python-pyudev-0.15-9.el7.noarch
appstream-data-7-20170301.el7.noarch
powerpc-utils-1.3.3-4.el7.ppc64le
setup-2.8.71-7.el7.noarch
enscript-1.6.6-6.el7.ppc64le
libgexiv2-0.10.4-2.el7.ppc64le
perl-Digest-SHA-5.85-4.el7.ppc64le
upower-0.99.4-2.el7.ppc64le
dhcp-libs-4.2.5-58.el7.centos.ppc64le
kbd-1.15.5-13.el7.ppc64le
phonon-backend-gstreamer-4.6.3-3.el7.ppc64le
dejavu-fonts-common-2.33-6.el7.noarch
libaio-devel-0.3.109-13.el7.ppc64le
grubby-8.28-23.el7.ppc64le
perl-CPAN-Meta-2.120921-5.el7.noarch
libmusicbrainz5-5.0.1-9.el7.ppc64le
liberation-mono-fonts-1.07.2-15.el7.noarch
fcoe-utils-1.0.32-1.el7.ppc64le
gvfs-afc-1.30.4-3.el7.ppc64le
m17n-db-1.6.4-3.el7.noarch
time-1.7-45.el7.ppc64le
python-configobj-4.7.2-7.el7.noarch
perl-Log-Message-0.08-3.el7.noarch
glib-networking-2.50.0-1.el7.ppc64le
gnome-classic-session-3.22.2-10.el7.noarch
libglade2-2.6.4-11.el7.ppc64le
langtable-data-0.0.31-3.el7.noarch
dejavu-serif-fonts-2.33-6.el7.noarch
python-requests-2.6.0-1.el7_1.noarch
perl-HTML-Tagset-3.20-15.el7.noarch
gssdp-1.0.1-1.el7.ppc64le
perl-CPANPLUS-Dist-Build-0.70-3.el7.noarch
brasero-nautilus-3.12.1-2.el7.ppc64le
evolution-data-server-3.22.7-6.el7.ppc64le
khmeros-fonts-common-5.0-17.el7.noarch
dejavu-sans-fonts-2.33-6.el7.noarch
python-kmod-0.9-4.el7.ppc64le
lzop-1.03-10.el7.ppc64le
telepathy-salut-0.8.1-6.el7.ppc64le
tbb-4.1-9.20130314.el7.ppc64le
kdegraphics-devel-4.10.5-3.el7.noarch
libcryptui-3.12.2-1.el7.ppc64le
ncurses-base-5.9-13.20130511.el7.noarch
lohit-nepali-fonts-2.5.3-2.el7.noarch
python-configshell-1.1.fb23-3.el7.noarch
acl-2.2.51-12.el7.ppc64le
python-rtslib-2.1.fb63-2.el7.noarch
libreport-plugin-rhtsupport-2.1.11-38.el7.centos.ppc64le
imsettings-qt-1.6.3-9.el7.ppc64le
webkitgtk3-2.4.11-2.el7.ppc64le
libsepol-2.5-6.el7.ppc64le
smc-meera-fonts-6.0-7.el7.noarch
python-mako-0.8.1-2.el7.noarch
pinentry-0.8.1-17.el7.ppc64le
alsa-tools-firmware-1.1.0-1.el7.ppc64le
libgdither-0.6-8.el7.ppc64le
ibus-libpinyin-1.6.91-4.el7.ppc64le
libXp-devel-1.0.2-2.1.el7.ppc64le
nspr-4.13.1-1.0.el7_3.ppc64le
cscope-15.8-10.el7.ppc64le
m2crypto-0.21.1-17.el7.ppc64le
libatomic-4.8.5-16.el7.ppc64le
opencc-0.4.3-3.el7.ppc64le
sbc-1.0-5.el7.ppc64le
SDL-devel-1.2.15-14.el7.ppc64le
vorbis-tools-1.4.0-12.el7.ppc64le
bzip2-libs-1.0.6-13.el7.ppc64le
google-crosextra-carlito-fonts-1.103-0.2.20130920.el7.noarch
nmap-ncat-6.40-7.el7.ppc64le
krb5-libs-1.15.1-8.el7.ppc64le
sssd-krb5-1.15.2-50.el7.ppc64le
cups-filters-libs-1.0.35-22.el7.ppc64le
virt-manager-1.4.1-7.el7.noarch
evince-3.22.1-5.el7.ppc64le
readline-6.2-10.el7.ppc64le
ctags-5.8-13.el7.ppc64le
sound-theme-freedesktop-0.8-3.el7.noarch
ruby-libs-2.0.0.648-30.el7.ppc64le
pth-2.0.7-23.el7.ppc64le
rubygems-2.0.14.1-30.el7.noarch
gnome-dictionary-3.20.0-1.el7.ppc64le
xorg-x11-drv-evdev-2.10.5-2.1.el7.ppc64le
audit-libs-2.7.6-3.el7.ppc64le
iwl135-firmware-18.168.6.1-56.el7.noarch
python-nss-0.16.0-3.el7.ppc64le
json-glib-1.2.6-1.el7.ppc64le
flatpak-libs-0.8.7-1.el7.ppc64le
libutempter-1.1.6-4.el7.ppc64le
ekiga-4.0.1-7.el7.ppc64le
easymock2-2.5.2-12.el7.noarch
keyutils-libs-1.5.8-3.el7.ppc64le
iwl1000-firmware-39.31.5.1-56.el7.noarch
teamd-1.25-5.el7.ppc64le
telepathy-glib-0.24.0-1.el7.ppc64le
PackageKit-yum-1.1.5-1.el7.centos.ppc64le
virt-what-1.13-10.el7.ppc64le
ppc64-diag-2.7.3-3.el7.ppc64le
libpurple-2.10.11-5.el7.ppc64le
libffi-3.0.13-18.el7.ppc64le
iwl2000-firmware-18.168.6.1-56.el7.noarch
perl-YAML-0.84-5.el7.noarch
libxml2-python-2.9.1-6.el7_2.3.ppc64le
lsscsi-0.27-6.el7.ppc64le
systemtap-client-3.1-3.el7.ppc64le
virt-viewer-5.0-7.el7.ppc64le
dbusmenu-qt-0.9.2-7.el7.ppc64le
libtar-1.2.11-29.el7.ppc64le
ccache-3.3.4-1.el7.ppc64le
perl-DBD-SQLite-1.39-3.el7.ppc64le
gnome-icon-theme-3.12.0-1.el7.noarch
gdk-pixbuf2-2.36.5-1.el7.ppc64le
libpath_utils-0.2.1-27.el7.ppc64le
gvfs-archive-1.30.4-3.el7.ppc64le
gnome-online-accounts-devel-3.22.5-1.el7.ppc64le
yajl-2.0.4-4.el7.ppc64le
gcc-4.8.5-16.el7_4.1.ppc64le
perl-Pod-Coverage-0.23-3.el7.noarch
libselinux-python-2.5-11.el7.ppc64le
libX11-devel-1.6.5-1.el7.ppc64le
qrencode-libs-3.4.1-3.el7.ppc64le
gnome-system-log-3.9.90-3.el7.ppc64le
mesa-libGLU-devel-9.0.0-4.el7.ppc64le
boost-system-1.53.0-27.el7.ppc64le
perl-HTTP-Message-6.06-6.el7.noarch
cracklib-2.9.0-11.el7.ppc64le
libXcursor-1.1.14-8.el7.ppc64le
dbus-1.6.12-17.el7.ppc64le
libnotify-devel-0.7.7-1.el7.ppc64le
ibus-gtk3-1.5.3-13.el7.ppc64le
libv4l-0.9.5-4.el7.ppc64le
perl-Time-Piece-1.20.1-292.el7.ppc64le
cracklib-dicts-2.9.0-11.el7.ppc64le
startup-notification-0.12-8.el7.ppc64le
dconf-0.26.0-2.el7.ppc64le
net-snmp-devel-5.7.2-28.el7.ppc64le
kate-part-4.10.5-4.el7.ppc64le
orc-0.4.26-1.el7.ppc64le
kernel-devel-3.10.0-693.el7.ppc64le
avahi-gobject-0.6.31-17.el7.ppc64le
cairo-gobject-1.14.8-2.el7.ppc64le
httpd-2.4.6-67.el7.centos.ppc64le
subversion-1.7.14-10.el7.ppc64le
kdepimlibs-akonadi-4.10.5-4.el7.ppc64le
gdbm-1.10-8.el7.ppc64le
perl-File-CheckTree-4.42-3.el7.noarch
atk-devel-2.22.0-3.el7.ppc64le
java-1.8.0-openjdk-devel-1.8.0.131-11.b12.el7.ppc64le
abrt-dbus-2.1.11-48.el7.centos.ppc64le
qt-mysql-4.8.5-13.el7.ppc64le
libkdcraw-4.10.5-4.el7.ppc64le
libaio-0.3.109-13.el7.ppc64le
urw-fonts-2.4-16.el7.noarch
libgee06-0.6.8-3.el7.ppc64le
libXrandr-devel-1.5.1-2.el7.ppc64le
cronie-anacron-1.4.11-17.el7.ppc64le
mlocate-0.26-6.el7.ppc64le
kdesdk-okteta-devel-4.10.5-6.el7.ppc64le
iso-codes-3.46-2.el7.noarch
e2fsprogs-1.42.9-10.el7.ppc64le
at-spi2-atk-2.22.0-2.el7.ppc64le
libstoragemgmt-python-clibs-1.4.0-3.el7.ppc64le
PackageKit-command-not-found-1.1.5-1.el7.centos.ppc64le
kdenetwork-kopete-devel-4.10.5-8.el7_0.ppc64le
libmnl-1.0.3-7.el7.ppc64le
tcp_wrappers-devel-7.6-77.el7.ppc64le
python-dns-1.12.0-4.20150617git465785f.el7.noarch
libXinerama-devel-1.1.3-2.1.el7.ppc64le
libibverbs-13-7.el7.ppc64le
net-tools-2.0-0.22.20131004git.el7.ppc64le
kde-workspace-libs-4.11.19-8.el7.ppc64le
libwebp-0.3.0-7.el7.ppc64le
libattr-devel-2.4.46-12.el7.ppc64le
libkadm5-1.15.1-8.el7.ppc64le
gcr-3.20.0-1.el7.ppc64le
colord-1.3.4-1.el7.ppc64le
rsyslog-8.24.0-12.el7.ppc64le
im-chooser-1.6.4-4.el7.ppc64le
boost-filesystem-1.53.0-27.el7.ppc64le
libgpg-error-devel-1.12-3.el7.ppc64le
harfbuzz-icu-1.3.2-1.el7.ppc64le
libpeas-gtk-1.20.0-1.el7.ppc64le
abrt-addon-python-2.1.11-48.el7.centos.ppc64le
selinux-policy-targeted-3.13.1-166.el7.noarch
libksane-4.10.5-4.el7.ppc64le
m4-1.4.16-10.el7.ppc64le
xmlrpc-c-client-1.32.5-1905.svn2451.el7.ppc64le
sysvinit-tools-2.88-14.dsf.el7.ppc64le
libnma-1.8.0-3.el7.ppc64le
os-prober-1.58-9.el7.ppc64le
libproxy-mozjs-0.4.11-10.el7.ppc64le
speech-dispatcher-0.7.1-15.el7.ppc64le
boost-signals-1.53.0-27.el7.ppc64le
python-ldap-2.4.15-2.el7.ppc64le
libvpx-1.3.0-5.el7_0.ppc64le
nm-connection-editor-1.8.0-3.el7.ppc64le
NetworkManager-team-1.8.0-9.el7.ppc64le
perf-3.10.0-693.el7.ppc64le
libgsf-1.14.26-7.el7.ppc64le
libpfm-4.7.0-4.el7.ppc64le
postgresql-9.2.21-1.el7.ppc64le
ethtool-4.8-1.el7.ppc64le
xorg-x11-server-utils-7.7-20.el7.ppc64le
attica-0.4.2-1.el7.ppc64le
xfsdump-3.1.4-1.el7.ppc64le
firewalld-filesystem-0.4.4.4-6.el7.noarch
libXfont2-2.0.1-2.el7.ppc64le
net-snmp-agent-libs-5.7.2-28.el7.ppc64le
tcl-devel-8.5.13-8.el7.ppc64le
libgxps-0.2.5-1.el7.ppc64le
cyrus-sasl-devel-2.1.26-21.el7.ppc64le
hmaccalc-0.9.13-4.el7.ppc64le
libwacom-data-0.24-1.el7.noarch
perl-Pod-Usage-1.63-3.el7.noarch
python-yubico-1.2.3-1.el7.noarch
libXxf86vm-devel-1.1.4-1.el7.ppc64le
abrt-tui-2.1.11-48.el7.centos.ppc64le
pinfo-0.6.10-9.el7.ppc64le
gnome-shell-extension-user-theme-3.22.2-10.el7.noarch
perl-File-Path-2.09-2.el7.noarch
xorg-x11-fonts-Type1-7.5-9.el7.noarch
python-firewall-0.4.4.4-6.el7.noarch
libXres-1.0.7-2.1.el7.ppc64le
libcgroup-tools-0.41-13.el7.ppc64le
libnl-devel-1.1.4-3.el7.ppc64le
gnome-user-docs-3.22.0-1.el7.noarch
perl-Pod-Simple-3.28-4.el7.noarch
systemd-libs-219-42.el7.ppc64le
ncurses-devel-5.9-13.20130511.el7.ppc64le
mesa-libEGL-devel-17.0.1-6.20170307.el7.ppc64le
audit-2.7.6-3.el7.ppc64le
iotop-0.6-2.el7.noarch
libvirt-daemon-driver-storage-logical-3.2.0-14.el7.ppc64le
perl-Module-CoreList-2.76.02-292.el7.noarch
libmbim-1.14.0-2.el7.ppc64le
xdg-desktop-portal-0.5-2.el7.ppc64le
perl-Module-Load-0.24-3.el7.noarch
caribou-gtk3-module-0.4.21-1.el7.ppc64le
sqlite-devel-3.7.17-8.el7.ppc64le
centos-indexhtml-7-9.el7.centos.noarch
elfutils-0.168-8.el7.ppc64le
centos-release-7-4.1708.el7.centos.ppc64le
trousers-0.3.14-2.el7.ppc64le
perl-Thread-Queue-3.02-2.el7.noarch
python-meh-gui-0.25.2-1.el7.noarch
gom-0.3.2-1.el7.ppc64le
lldpad-1.0.1-3.git036e314.el7.ppc64le
libgusb-0.2.9-1.el7.ppc64le
liberation-fonts-common-1.07.2-15.el7.noarch
libimobiledevice-1.2.0-1.el7.ppc64le
perl-Module-Pluggable-4.8-3.el7.noarch
ghostscript-cups-9.07-28.el7.ppc64le
osinfo-db-tools-1.1.0-1.el7.ppc64le
kbd-misc-1.15.5-13.el7.noarch
dhcp-common-4.2.5-58.el7.centos.ppc64le
control-center-filesystem-3.22.2-5.el7.ppc64le
libvirt-glib-1.0.0-1.el7.ppc64le
perl-CPAN-Meta-Requirements-2.122-7.el7.noarch
PyQt4-4.10.1-13.el7.ppc64le
btrfs-progs-4.9.1-1.el7.ppc64le
anaconda-gui-21.48.22.121-1.el7.centos.ppc64le
libatasmart-0.19-6.el7.ppc64le
shared-desktop-ontologies-0.11.0-2.el7.noarch
libvirt-daemon-config-nwfilter-3.2.0-14.el7.ppc64le
autoconf-2.69-11.el7.noarch
gnome-terminal-3.22.1-2.el7.ppc64le
python-cups-1.9.63-6.el7.ppc64le
intltool-0.50.2-7.el7.noarch
glibc-headers-2.17-196.el7.ppc64le
kdesdk-common-4.10.5-6.el7.noarch
libvirt-daemon-driver-secret-3.2.0-14.el7.ppc64le
perl-Locale-Maketext-Simple-0.21-292.el7.noarch
gnome-keyring-3.20.0-3.el7.ppc64le
python-sss-murmur-1.15.2-50.el7.ppc64le
vim-enhanced-7.4.160-2.el7.ppc64le
perl-ExtUtils-MakeMaker-6.68-3.el7.noarch
emacs-filesystem-24.3-19.el7_3.noarch
libvncserver-0.9.9-9.el7_0.1.ppc64le
perl-Object-Accessor-0.42-292.el7.noarch
gnome-desktop3-3.22.2-2.el7.ppc64le
python-backports-1.0-8.el7.ppc64le
evolution-help-3.22.6-10.el7.noarch
systemtap-devel-3.1-3.el7.ppc64le
langtable-0.0.31-3.el7.noarch
geocode-glib-3.20.1-1.el7.ppc64le
perl-Compress-Raw-Bzip2-2.061-3.el7.ppc64le
pygtk2-libglade-2.24.0-9.el7.ppc64le
python-urllib3-1.10.2-3.el7.noarch
orca-3.6.3-4.el7.ppc64le
perl-File-Fetch-0.42-2.el7.noarch
latencytop-common-0.5-13.el7.ppc64le
geoclue2-libs-2.4.5-1.el7.ppc64le
perl-Module-Loaded-0.08-292.el7.noarch
webkitgtk4-2.14.7-2.el7.ppc64le
python-paste-1.7.5.1-9.20111221hg1498.el7.noarch
totem-nautilus-3.22.1-1.el7.ppc64le
libtool-2.4.2-22.el7_3.ppc64le
smc-fonts-common-6.0-7.el7.noarch
libnice-0.1.3-4.el7.ppc64le
libdvdnav-5.0.3-1.el7.ppc64le
folks-0.11.3-1.el7.ppc64le
python-ipaddr-2.1.11-1.el7.noarch
xorg-x11-utils-7.5-22.el7.ppc64le
oxygen-icon-theme-4.10.5-2.el7.noarch
libkkc-common-0.3.1-9.el7.noarch
libgovirt-0.3.3-5.el7.ppc64le
boost-timer-1.53.0-27.el7.ppc64le
gnome-packagekit-common-3.22.1-2.el7.ppc64le
javapackages-tools-3.4.1-11.el7.noarch
sane-backends-devel-1.0.24-9.el7.ppc64le
konkretcmpi-0.9.1-5.el7.ppc64le
perl-srpm-macros-1-8.el7.noarch
chrony-3.1-2.el7.centos.ppc64le
fuse-2.9.2-8.el7.ppc64le
evolution-3.22.6-10.el7.ppc64le
python-urwid-1.1.1-3.el7.ppc64le
shotwell-0.24.5-1.el7.ppc64le
libreport-web-2.1.11-38.el7.centos.ppc64le
glibc-2.17-196.el7.ppc64le
usb_modeswitch-data-20160612-2.el7.noarch
patch-2.7.1-8.el7.ppc64le
file-roller-3.22.3-1.el7.ppc64le
python-netaddr-0.7.5-7.el7.noarch
ibus-table-chinese-1.4.6-3.el7.noarch
libreport-plugin-reportuploader-2.1.11-38.el7.centos.ppc64le
pcre-8.32-17.el7.ppc64le
libvirt-daemon-driver-network-3.2.0-14.el7.ppc64le
cyrus-sasl-plain-2.1.26-21.el7.ppc64le
glade-libs-3.20.0-1.el7.ppc64le
python-markupsafe-0.11-10.el7.ppc64le
kdenetwork-devel-4.10.5-8.el7_0.noarch
libreport-plugin-ureport-2.1.11-38.el7.centos.ppc64le
dbus-libs-1.6.12-17.el7.ppc64le
alsa-firmware-1.0.28-2.el7.noarch
mozjs17-17.0.0-19.el7.ppc64le
avahi-ui-gtk3-0.6.31-17.el7.ppc64le
python-cffi-1.6.0-5.el7.ppc64le
xdg-user-dirs-gtk-0.10-4.el7.ppc64le
gavl-1.4.0-4.el7.ppc64le
libjpeg-turbo-1.2.90-5.el7.ppc64le
device-mapper-multipath-0.4.9-111.el7.ppc64le
libcdio-0.92-1.el7.ppc64le
pulseaudio-module-bluetooth-10.0-3.el7.ppc64le
pytalloc-2.1.9-1.el7.ppc64le
ibus-sayura-1.3.2-3.el7.ppc64le
checkpolicy-2.5-4.el7.ppc64le
libICE-1.0.9-9.el7.ppc64le
libvirt-daemon-driver-interface-3.2.0-14.el7.ppc64le
libunistring-0.9.3-9.el7.ppc64le
libXScrnSaver-devel-1.2.2-6.1.el7.ppc64le
openlmi-python-base-0.5.0-4.el7.noarch
PyQt4-devel-4.10.1-13.el7.ppc64le
libndp-1.2-7.el7.ppc64le
libxml2-2.9.1-6.el7_2.3.ppc64le
sssd-krb5-common-1.15.2-50.el7.ppc64le
ncurses-5.9-13.20130511.el7.ppc64le
icedax-1.1.11-23.el7.ppc64le
libmsn-4.2.1-7.el7.ppc64le
evolution-data-server-devel-3.22.7-6.el7.ppc64le
poppler-0.26.5-16.el7.ppc64le
sed-4.2.2-5.el7.ppc64le
sssd-ldap-1.15.2-50.el7.ppc64le
fontconfig-2.10.95-11.el7.ppc64le
pinentry-qt-0.8.1-17.el7.ppc64le
cyrus-sasl-scram-2.1.26-21.el7.ppc64le
paps-0.6.8-28.el7.1.ppc64le
libyaml-0.1.4-11.el7_0.ppc64le
libgpg-error-1.12-3.el7.ppc64le
sgpio-1.2.0.10-13.el7.ppc64le
alsa-lib-1.1.3-3.el7.ppc64le
gutenprint-5.2.9-18.el7.ppc64le
openslp-2.0.0-6.el7.ppc64le
ruby-irb-2.0.0.648-30.el7.noarch
libgcrypt-1.5.3-14.el7.ppc64le
python-blivet-0.61.15.65-1.el7.noarch
gzip-1.5-9.el7.ppc64le
xorg-x11-drv-void-1.4.1-2.el7.ppc64le
nss-pem-1.0.3-4.el7.ppc64le
rubygem-rdoc-4.0.0-30.el7.noarch
libcap-ng-0.7.5-4.el7.ppc64le
rpm-build-libs-4.11.3-25.el7.ppc64le
shared-mime-info-1.8-3.el7.ppc64le
xorg-x11-drv-v4l-0.2.0-47.el7.ppc64le
nss-tools-3.28.4-8.el7.ppc64le
libsemanage-2.5-8.el7.ppc64le
libxcb-1.12-1.el7.ppc64le
flatpak-0.8.7-1.el7.ppc64le
gstreamer1-1.10.4-2.el7.ppc64le
xorg-x11-drv-nouveau-1.0.13-3.el7.ppc64le
sgml-common-0.6.3-39.el7.noarch
util-linux-2.23.2-43.el7.ppc64le
libtdb-1.3.12-2.el7.ppc64le
rpm-devel-4.11.3-25.el7.ppc64le
gobject-introspection-1.50.0-1.el7.ppc64le
qdox-1.12.1-10.el7.noarch
libteam-1.25-5.el7.ppc64le
openssh-clients-7.4p1-11.el7.ppc64le
libattr-2.4.46-12.el7.ppc64le
python-meh-0.25.2-1.el7.noarch
avahi-glib-0.6.31-17.el7.ppc64le
rhino-1.7R5-1.el7.noarch
perl-Pod-Checker-1.60-2.el7.noarch
rarian-0.8.1-11.el7.ppc64le
gmp-6.0.0-15.el7.ppc64le
createrepo-0.9.9-28.el7.noarch
python-gobject-base-3.22.0-1.el7.ppc64le
telepathy-haze-0.8.0-1.el7.ppc64le
perl-Version-Requirements-0.101022-244.el7.noarch
tog-pegasus-2.14.1-5.el7.ppc64le
lua-5.1.4-15.el7.ppc64le
libburn-1.2.8-4.el7.ppc64le
openssl-1.0.2k-8.el7.ppc64le
dleyna-server-0.5.0-1.el7.ppc64le
perl-IO-HTML-1.00-2.el7.noarch
libsemanage-python-2.5-8.el7.ppc64le
libidn-1.28-4.el7.ppc64le
nss-devel-3.28.4-8.el7.ppc64le
net-snmp-libs-5.7.2-28.el7.ppc64le
paps-libs-0.6.8-28.el7.1.ppc64le
perl-DBIx-Simple-1.35-7.el7.noarch
lzo-minilzo-2.06-8.el7.ppc64le
libref_array-0.1.5-27.el7.ppc64le
libX11-1.6.5-1.el7.ppc64le
xdg-utils-1.1.0-0.17.20120809git.el7.noarch
harfbuzz-devel-1.3.2-1.el7.ppc64le
perl-CGI-3.63-4.el7.noarch
libini_config-1.3.0-27.el7.ppc64le
xmlrpc-c-1.32.5-1905.svn2451.el7.ppc64le
libXfixes-5.0.3-1.el7.ppc64le
glibmm24-2.50.0-1.el7.ppc64le
webkitgtk4-devel-2.14.7-2.el7.ppc64le
perl-Devel-Symdump-2.10-2.el7.noarch
libpipeline-1.2.3-3.el7.ppc64le
mpfr-3.1.1-4.el7.ppc64le
libXrandr-1.5.1-2.el7.ppc64le
cyrus-sasl-gssapi-2.1.26-21.el7.ppc64le
gtk2-devel-2.24.31-1.el7.ppc64le
perl-URI-1.60-9.el7.noarch
kpartx-0.4.9-111.el7.ppc64le
file-libs-5.11-33.el7.ppc64le
libXext-devel-1.3.3-3.el7.ppc64le
libSM-devel-1.2.2-2.el7.ppc64le
qt-devel-4.8.5-13.el7.ppc64le
perl-HTTP-Date-6.02-8.el7.noarch
dracut-033-502.el7.ppc64le
libtool-ltdl-2.4.2-22.el7_3.ppc64le
libcanberra-0.30-5.el7.ppc64le
python-enum34-1.0.4-1.el7.noarch
libxkbfile-devel-1.0.9-3.el7.ppc64le
perl-HTTP-Cookies-6.01-5.el7.noarch
polkit-0.112-12.el7_3.ppc64le
libtheora-1.1.1-8.el7.ppc64le
libXpm-3.5.12-1.el7.ppc64le
libevent-2.0.21-4.el7.ppc64le
ibus-gtk2-1.5.3-13.el7.ppc64le
kdelibs-common-4.14.8-6.el7_3.ppc64le
systemd-sysv-219-42.el7.ppc64le
diffutils-3.3-4.el7.ppc64le
libXv-1.0.11-1.el7.ppc64le
pam-1.1.8-18.el7.ppc64le
imsettings-gsettings-1.6.3-9.el7.ppc64le
perl-YAML-Tiny-1.51-6.el7.noarch
GConf2-3.2.6-8.el7.ppc64le
libtasn1-4.10-1.el7.ppc64le
libxkbfile-1.0.9-3.el7.ppc64le
gettext-libs-0.19.8.1-2.el7.ppc64le
kdelibs-ktexteditor-4.14.8-6.el7_3.ppc64le
perl-Env-1.04-2.el7.noarch
libpciaccess-0.13.4-3.el7_3.ppc64le
nss-softokn-3.28.3-6.el7.ppc64le
pango-1.40.4-1.el7.ppc64le
telepathy-logger-0.8.0-5.el7.ppc64le
nepomuk-core-4.10.5-5.el7.ppc64le
perl-Net-HTTP-6.06-2.el7.noarch
samba-common-4.6.2-8.el7.noarch
libsigc++20-2.10.0-1.el7.ppc64le
cogl-1.22.2-1.el7.ppc64le
pcre-devel-8.32-17.el7.ppc64le
kdenetwork-kopete-libs-4.10.5-8.el7_0.ppc64le
icoutils-0.31.3-1.el7_3.ppc64le
pyparted-3.9-13.el7.ppc64le
apr-util-1.5.2-6.el7.ppc64le
giflib-4.1.6-9.el7.ppc64le
expat-devel-2.1.0-10.el7_3.ppc64le
kdesdk-okteta-4.10.5-6.el7.ppc64le
papi-5.2.0-23.el7.ppc64le
abrt-python-2.1.11-48.el7.centos.ppc64le
lzo-2.06-8.el7.ppc64le
java-1.8.0-openjdk-1.8.0.131-11.b12.el7.ppc64le
libffi-devel-3.0.13-18.el7.ppc64le
kwin-libs-4.11.19-8.el7.ppc64le
xorg-x11-font-utils-7.5-20.el7.ppc64le
iscsi-initiator-utils-iscsiuio-6.2.0.874-4.el7.ppc64le
file-5.11-33.el7.ppc64le
libXft-devel-2.3.2-2.el7.ppc64le
libipa_hbac-1.15.2-50.el7.ppc64le
kwin-gles-libs-4.11.19-8.el7.ppc64le
libsamplerate-0.1.8-6.el7.ppc64le
cronie-1.4.11-17.el7.ppc64le
xml-common-0.6.3-39.el7.noarch
ghostscript-9.07-28.el7.ppc64le
libpinyin-data-0.9.93-4.el7.ppc64le
kde-runtime-libs-4.10.5-8.el7.ppc64le
ipset-6.29-1.el7.ppc64le
plymouth-0.8.9-0.28.20140113.el7.centos.ppc64le
taglib-1.8-7.20130218git.el7.ppc64le
at-spi2-core-2.22.0-1.el7.ppc64le
xfsprogs-4.5.0-12.el7.ppc64le
kdepim-runtime-4.10.5-3.el7.ppc64le
libusbmuxd-1.0.10-5.el7.ppc64le
libstoragemgmt-python-1.4.0-3.el7.noarch
libseccomp-2.3.1-3.el7.ppc64le
gstreamer1-plugins-good-1.10.4-2.el7.ppc64le
pyusb-1.0.0-0.11.b1.el7.noarch
nepomuk-core-devel-4.10.5-5.el7.ppc64le
libofa-0.9.3-24.el7.ppc64le
device-mapper-event-1.02.140-8.el7.ppc64le
librtas-2.0.1-1.el7.ppc64le
libXcomposite-devel-0.4.4-4.1.el7.ppc64le
audit-libs-python-2.7.6-3.el7.ppc64le
okular-libs-4.10.5-4.el7.ppc64le
gdisk-0.8.6-5.el7.ppc64le
libibumad-13-7.el7.ppc64le
libsndfile-1.0.25-10.el7.ppc64le
libXxf86misc-1.0.3-7.1.el7.ppc64le
pyparsing-1.5.6-9.el7.noarch
kdesdk-kmtrace-libs-4.10.5-6.el7.ppc64le
attr-2.4.46-12.el7.ppc64le
rpcbind-0.2.0-42.el7.ppc64le
slang-2.2.4-11.el7.ppc64le
gtk2-2.24.31-1.el7.ppc64le
libssh2-1.4.3-10.el7_2.1.ppc64le
kdesdk-kompare-4.10.5-6.el7.ppc64le
openssl-devel-1.0.2k-8.el7.ppc64le
bluez-5.44-2.el7.ppc64le
boost-thread-1.53.0-27.el7.ppc64le
clutter-gtk-1.8.2-1.el7.ppc64le
soundtouch-1.4.0-9.el7.ppc64le
ibus-table-1.5.0-5.el7.noarch
setools-libs-3.3.8-1.1.el7.ppc64le
ppp-2.4.5-33.el7.ppc64le
libvpd-2.2.5-1.el7.ppc64le
clutter-gst3-3.0.22-1.el7.ppc64le
boost-test-1.53.0-27.el7.ppc64le
libgphoto2-2.5.2-5.el7.ppc64le
libcurl-7.29.0-42.el7.ppc64le
libmtp-1.1.6-5.el7.ppc64le
unzip-6.0-16.el7.ppc64le
vte291-0.46.2-1.el7.ppc64le
boost-random-1.53.0-27.el7.ppc64le
hplip-libs-3.15.9-3.el7.ppc64le
openldap-2.4.44-5.el7.ppc64le
rsync-3.0.9-18.el7.ppc64le
psmisc-22.20-15.el7.ppc64le
compat-cheese314-3.14.2-1.el7.ppc64le
dosfstools-3.0.20-9.el7.ppc64le
sane-backends-drivers-cameras-1.0.24-9.el7.ppc64le
kde-filesystem-4-47.el7.ppc64le
cryptsetup-1.7.4-3.el7.ppc64le
boost-program-options-1.53.0-27.el7.ppc64le
libgnomekbd-3.22.0.1-1.el7.ppc64le
libsrtp-1.4.4-10.20101004cvs.el7.ppc64le
speech-dispatcher-python-0.7.1-15.el7.ppc64le
raptor2-2.0.9-3.el7.ppc64le
grub2-tools-2.02-0.64.el7.centos.ppc64le
libiodbc-3.52.7-7.el7.ppc64le
gtk-vnc2-0.7.0-2.el7.ppc64le
libdv-1.0.0-17.el7.ppc64le
libXxf86dga-1.1.4-2.1.el7.ppc64le
python-deltarpm-3.6-3.el7.ppc64le
ibacm-13-7.el7.ppc64le
opus-1.0.2-6.el7.ppc64le
system-config-printer-libs-1.4.1-19.el7.noarch
libthai-0.1.14-9.el7.ppc64le
tracker-1.10.5-4.el7.ppc64le
shared-desktop-ontologies-devel-0.11.0-2.el7.noarch
qt-4.8.5-13.el7.ppc64le
pcre2-10.23-2.el7.ppc64le
gtkspell3-3.0.3-4.el7.ppc64le
libevdev-1.5.6-1.el7.ppc64le
totem-3.22.1-1.el7.ppc64le
virtuoso-opensource-6.1.6-6.el7.ppc64le
strigi-libs-0.7.7-12.20120626.el7.ppc64le
boost-wave-1.53.0-27.el7.ppc64le
libXmu-devel-1.1.2-2.el7.ppc64le
iproute-3.10.0-87.el7.ppc64le
firewalld-0.4.4.4-6.el7.noarch
color-filesystem-1-13.el7.noarch
automoc-1.0-0.20.rc3.el7.ppc64le
perl-Pod-Perldoc-3.20-4.el7.noarch
poppler-utils-0.26.5-16.el7.ppc64le
boost-1.53.0-27.el7.ppc64le
pcp-libs-3.11.8-7.el7.ppc64le
pykickstart-1.99.66.12-1.el7.noarch
openldap-devel-2.4.44-5.el7.ppc64le
perl-Encode-2.51-7.el7.ppc64le
python-gobject-3.22.0-1.el7.ppc64le
krb5-workstation-1.15.1-8.el7.ppc64le
libwacom-0.24-1.el7.ppc64le
isomd5sum-1.0.10-5.el7.ppc64le
abrt-addon-vmcore-2.1.11-48.el7.centos.ppc64le
perl-constant-1.27-2.el7.noarch
compat-libcogl12-1.14.0-3.el7.ppc64le
python-libipa_hbac-1.15.2-50.el7.ppc64le
gdm-3.22.3-11.el7.ppc64le
gstreamer1-devel-1.10.4-2.el7.ppc64le
abrt-retrace-client-2.1.11-48.el7.centos.ppc64le
perl-Exporter-5.68-3.el7.noarch
libXpm-devel-3.5.12-1.el7.ppc64le
python2-pyasn1-modules-0.1.9-7.el7.noarch
gnome-shell-extension-alternate-tab-3.22.2-10.el7.noarch
ttmkfdir-3.0.9-42.el7.ppc64le
samba-libs-4.6.2-8.el7.ppc64le
perl-File-Temp-0.23.01-3.el7.noarch
brltty-4.5-15.el7.ppc64le
sos-3.4-6.el7.centos.noarch
gnome-shell-extension-window-list-3.22.2-10.el7.noarch
clucene-core-2.3.3.4-11.el7.ppc64le
osinfo-db-20170423-2.el7.noarch
perl-macros-5.16.3-292.el7.ppc64le
python-brlapi-0.6.0-15.el7.ppc64le
libselinux-devel-2.5-11.el7.ppc64le
quota-nls-4.01-14.el7.noarch
elfutils-libs-0.168-8.el7.ppc64le
oddjob-mkhomedir-0.31.5-4.el7.ppc64le
perl-5.16.3-292.el7.ppc64le
opal-3.10.10-4.el7.ppc64le
gstreamer-tools-0.10.36-7.el7.ppc64le
libvirt-daemon-driver-storage-scsi-3.2.0-14.el7.ppc64le
satyr-0.13-14.el7.ppc64le
polkit-docs-0.112-12.el7_3.noarch
perl-Compress-Raw-Zlib-2.061-4.el7.ppc64le
compat-libcogl-pango12-1.14.0-3.el7.ppc64le
alsa-lib-devel-1.1.3-3.el7.ppc64le
libvirt-daemon-driver-storage-mpath-3.2.0-14.el7.ppc64le
NetworkManager-libnm-1.8.0-9.el7.ppc64le
tcsh-6.18.01-15.el7.ppc64le
perl-XML-Dumper-0.81-17.el7.noarch
libpfm-devel-4.7.0-4.el7.ppc64le
unixODBC-devel-2.3.1-11.el7.ppc64le
rcs-5.9.0-5.el7.ppc64le
ltrace-0.7.91-14.el7.ppc64le
ed-1.9-4.el7.ppc64le
wqy-zenhei-fonts-0.9.46-11.el7.noarch
lohit-bengali-fonts-2.5.3-4.el7.noarch
paratype-pt-sans-fonts-20101909-3.el7.noarch
paktype-naskh-basic-fonts-4.1-3.el7.noarch
lklug-fonts-0.6-10.20090803cvs.el7.noarch
lohit-kannada-fonts-2.5.3-3.el7.noarch
cjkuni-uming-fonts-0.2.20080216.1-53.el7.noarch
vlgothic-fonts-20130607-2.el7.noarch
lohit-telugu-fonts-2.5.3-3.el7.noarch
gnu-free-serif-fonts-20120503-8.el7.noarch
jomolhari-fonts-0.003-17.el7.noarch
scl-utils-20130529-17.el7_1.ppc64le
diffstat-1.57-4.el7.ppc64le
xorg-x11-drivers-7.7-6.el7.ppc64le
setserial-2.17-33.el7.ppc64le
vinagre-3.22.0-8.el7.ppc64le
man-pages-overrides-7.4.3-1.el7.ppc64le
gedit-3.22.0-3.el7.ppc64le
iwl5150-firmware-8.24.2.2-56.el7.noarch
gnome-contacts-3.22.1-1.el7.ppc64le
words-3.0-22.el7.noarch
setroubleshoot-3.2.28-3.el7.ppc64le
iwl7265-firmware-22.0.7.0-56.el7.noarch
gnome-system-monitor-3.22.2-2.el7.ppc64le
man-pages-3.53-5.el7.noarch
librsvg2-devel-2.40.16-1.el7.ppc64le
gpg-pubkey-f4a80eb5-53a7ff4b
system-config-printer-udev-1.4.1-19.el7.ppc64le
gnome-calculator-3.22.3-1.el7.ppc64le
libgcc-4.8.5-16.el7_4.1.ppc64le
gvfs-afp-1.30.4-3.el7.ppc64le
cpp-4.8.5-16.el7_4.1.ppc64le
latencytop-0.5-13.el7.ppc64le
gcc-c++-4.8.5-16.el7_4.1.ppc64le
gtk3-immodule-xim-3.22.10-4.el7.ppc64le
mousetweaks-3.12.0-1.el7.ppc64le
qt3-MySQL-3.3.8b-51.el7.ppc64le
xvattr-1.3-27.el7.ppc64le
yum-langpacks-0.4.2-7.el7.noarch
rpm-build-4.11.3-25.el7.ppc64le
virt-install-1.4.1-7.el7.noarch
samba-client-4.6.2-8.el7.ppc64le
qt-odbc-4.8.5-13.el7.ppc64le
NetworkManager-tui-1.8.0-9.el7.ppc64le
avahi-0.6.31-17.el7.ppc64le
httpd-manual-2.4.6-67.el7.centos.noarch
PackageKit-gstreamer-plugin-1.1.5-1.el7.centos.ppc64le
tuned-2.8.0-5.el7.noarch
qemu-guest-agent-2.8.0-2.el7.ppc64le
smartmontools-6.2-8.el7.ppc64le
openssh-server-7.4p1-11.el7.ppc64le
dracut-config-rescue-033-502.el7.ppc64le
openlmi-providers-devel-0.5.0-4.el7.ppc64le
oprofile-0.9.9-22.el7.ppc64le
perl-homedir-1.008010-4.el7.noarch
libgudev1-devel-219-42.el7.ppc64le
sudo-1.8.19p2-10.el7.ppc64le
libacl-devel-2.2.51-12.el7.ppc64le
perl-XML-Twig-3.44-2.el7.noarch
crash-trace-command-2.0-12.el7.ppc64le
crash-gcore-command-1.3.1-0.el7.ppc64le
libgnome-keyring-devel-3.12.0-1.el7.ppc64le
binutils-devel-2.25.1-31.base.el7.ppc64le
libcap-ng-devel-0.7.5-4.el7.ppc64le
bash-completion-2.1-6.el7.noarch
dstat-0.7.2-12.el7.noarch
wget-1.14-15.el7.ppc64le
gpg-pubkey-352c64e5-52ae6884
certmonger-0.78.4-3.el7.ppc64le
libatomic-static-4.8.5-16.el7.ppc64le
libicu-devel-50.1.2-15.el7.ppc64le
caribou-0.4.21-1.el7.ppc64le
grub2-common-2.02-0.64.el7.centos.noarch
plymouth-graphics-libs-0.8.9-0.28.20140113.el7.centos.ppc64le
kernel-3.10.0-693.el7.ppc64le
perl-Perl-OSType-1.003-3.el7.noarch
libvirt-daemon-3.2.0-14.el7.ppc64le
ledmon-0.80-2.el7.ppc64le
gupnp-av-0.12.10-1.el7.ppc64le
cups-1.6.3-29.el7.ppc64le
mozilla-filesystem-1.9-11.el7.ppc64le
libqmi-utils-1.16.0-1.el7.ppc64le
anaconda-core-21.48.22.121-1.el7.centos.ppc64le
perl-JSON-PP-2.27202-2.el7.noarch
libvirt-client-3.2.0-14.el7.ppc64le
numactl-devel-2.0.9-6.el7_2.ppc64le
cups-client-1.6.3-29.el7.ppc64le
mutter-3.22.3-11.el7.ppc64le
ipa-common-4.5.0-20.el7.centos.noarch
glibc-devel-2.17-196.el7.ppc64le
firefox-52.2.0-2.el7.centos.ppc64le
perl-Params-Check-0.38-2.el7.noarch
virt-manager-common-1.4.1-7.el7.noarch
indent-2.2.11-13.el7.ppc64le
python-linux-procfs-0.4.9-3.el7.noarch
gnome-session-3.22.3-4.el7.ppc64le
adwaita-cursor-theme-3.22.0-1.el7.noarch
perl-Archive-Extract-0.68-3.el7.noarch
gnome-initial-setup-3.22.1-4.el7.ppc64le
perl-IO-Compress-2.061-2.el7.noarch
geoclue2-2.4.5-1.el7.ppc64le
khmeros-base-fonts-5.0-17.el7.noarch
python-tempita-0.5.1-6.el7.noarch
gnome-online-accounts-3.22.5-1.el7.ppc64le
nhn-nanum-fonts-common-3.020-9.el7.noarch
gobject-introspection-devel-1.50.0-1.el7.ppc64le
rhythmbox-3.4.1-1.el7.ppc64le
libavc1394-0.5.3-14.el7.ppc64le
telepathy-gabble-0.18.1-4.el7.ppc64le
stix-fonts-1.1.0-5.el7.noarch
python-javapackages-3.4.1-11.el7.noarch
gnome-packagekit-installer-3.22.1-2.el7.ppc64le
mesa-filesystem-17.0.1-6.20170307.el7.ppc64le
konkretcmpi-python-0.9.1-5.el7.ppc64le
libsane-hpaio-3.15.9-3.el7.ppc64le
copy-jdk-configs-2.2-3.el7.noarch
usb_modeswitch-2.4.0-5.el7.ppc64le
nhn-nanum-gothic-fonts-3.020-9.el7.noarch
pytz-2016.10-2.el7.noarch
librsvg2-tools-2.40.16-1.el7.ppc64le
bash-4.2.46-28.el7.ppc64le
libreport-plugin-bugzilla-2.1.11-38.el7.centos.ppc64le
kde-workspace-devel-4.11.19-8.el7.ppc64le
libdb-devel-5.3.21-20.el7.ppc64le
fxload-2002_04_11-16.el7.ppc64le
google-crosextra-caladea-fonts-1.002-0.4.20130214.el7.noarch
python-pycparser-2.14-1.el7.noarch
libtimezonemap-0.4.4-1.el7.ppc64le
libcom_err-1.42.9-10.el7.ppc64le
frei0r-plugins-1.3-13.el7.ppc64le
ibus-m17n-1.3.4-13.el7.ppc64le
libcdio-paranoia-10.2+0.90-11.el7.ppc64le
netcf-libs-0.2.8-4.el7.ppc64le
lohit-punjabi-fonts-2.5.3-2.el7.noarch
cmpi-bindings-pywbem-0.9.5-6.el7.ppc64le
at-spi2-core-devel-2.22.0-1.el7.ppc64le
xz-libs-5.2.2-1.el7.ppc64le
libasyncns-0.8-7.el7.ppc64le
libcanberra-devel-0.30-5.el7.ppc64le
coreutils-8.22-18.el7.ppc64le
sssd-ad-1.15.2-50.el7.ppc64le
doxygen-1.8.5-3.el7.ppc64le
httpd-tools-2.4.6-67.el7.centos.ppc64le
libspectre-0.2.8-1.el7.ppc64le
cyrus-sasl-lib-2.1.26-21.el7.ppc64le
rubygem-bigdecimal-1.2.0-30.el7.ppc64le
icedtea-web-1.6.2-4.el7.ppc64le
libarchive-3.1.2-10.el7_2.ppc64le
python-pyblock-0.53-6.el7.ppc64le
byacc-1.9.20130304-3.el7.ppc64le
wodim-1.1.11-23.el7.ppc64le
xorg-x11-drv-qxl-0.1.5-3.el7.ppc64le
elfutils-libelf-0.168-8.el7.ppc64le
rubygem-thor-0.19.1-1.el7.noarch
file-roller-nautilus-3.22.3-1.el7.ppc64le
pkgconfig-0.27.1-4.el7.ppc64le
setroubleshoot-server-3.2.28-3.el7.ppc64le
iwl2030-firmware-18.168.6.1-56.el7.noarch
mailx-12.5-16.el7.ppc64le
xorg-x11-drv-fbdev-0.4.3-25.el7.ppc64le
libtevent-0.9.31-1.el7.ppc64le
policycoreutils-2.5-17.1.el7.ppc64le
java-1.7.0-openjdk-devel-1.7.0.141-2.6.10.5.el7.ppc64le
gsettings-desktop-schemas-3.22.0-1.el7.ppc64le
yum-3.4.3-154.el7.centos.noarch
iwl6000g2a-firmware-17.168.5.3-56.el7.noarch
perl-B-Lint-1.17-3.el7.noarch
gstreamer-plugins-bad-free-0.10.23-23.el7.ppc64le
libvorbis-1.3.3-8.el7.ppc64le
rarian-compat-0.8.1-11.el7.ppc64le
abrt-desktop-2.1.11-48.el7.centos.ppc64le
desktop-file-utils-0.23-1.el7.ppc64le
libiptcdata-1.0.4-11.el7.ppc64le
gpg-pubkey-f533f4fa-56585169
perl-DB_File-1.830-6.el7.ppc64le
compat-poppler022-qt-0.22.5-4.el7.ppc64le
libldb-1.1.29-1.el7.ppc64le
http-parser-2.7.1-1.el7.ppc64le
NetworkManager-libreswan-gnome-1.2.4-2.el7.ppc64le
centos-logos-70.0.6-3.el7.centos.noarch
libX11-common-1.6.5-1.el7.noarch
libstdc++-4.8.5-16.el7_4.1.ppc64le
perl-FCGI-0.74-8.el7.ppc64le
pango-devel-1.40.4-1.el7.ppc64le
libbasicobjects-0.1.1-27.el7.ppc64le
gtk2-immodule-xim-2.24.31-1.el7.ppc64le
libgnome-keyring-3.12.0-1.el7.ppc64le
libXrender-0.9.10-1.el7.ppc64le
libitm-devel-4.8.5-16.el7_4.1.ppc64le
perl-Business-ISBN-2.06-2.el7.noarch
freeglut-2.8.1-3.el7.ppc64le
device-mapper-1.02.140-8.el7.ppc64le
xdg-desktop-portal-gtk-0.5-1.el7.ppc64le
libudisks2-2.1.2-6.el7.ppc64le
pulseaudio-libs-10.0-3.el7.ppc64le
perl-HTTP-Daemon-6.01-5.el7.noarch
xorg-x11-xauth-1.0.9-1.el7.ppc64le
nettle-2.7.1-8.el7.ppc64le
polkit-pkla-compat-0.1-4.el7.ppc64le
startup-notification-devel-0.12-8.el7.ppc64le
genisoimage-1.1.11-23.el7.ppc64le
dbus-x11-1.6.12-17.el7.ppc64le
perl-Text-Soundex-3.04-4.el7.ppc64le
xdg-user-dirs-0.15-4.el7.ppc64le
jansson-2.10-1.el7.ppc64le
NetworkManager-glib-1.8.0-9.el7.ppc64le
rpm-sign-4.11.3-25.el7.ppc64le
gettext-0.19.8.1-2.el7.ppc64le
cairo-1.14.8-2.el7.ppc64le
perl-IO-Socket-SSL-1.94-6.el7.noarch
kdepimlibs-kxmlrpcclient-4.10.5-4.el7.ppc64le
libplist-1.12-3.el7.ppc64le
libwbclient-4.6.2-8.el7.ppc64le
cgdcbxd-1.0.2-7.el7.ppc64le
glib2-devel-2.50.3-3.el7.ppc64le
gdk-pixbuf2-devel-2.36.5-1.el7.ppc64le
theora-tools-1.1.1-8.el7.ppc64le
libkipi-4.10.5-3.el7.ppc64le
libmng-1.0.10-14.el7.ppc64le
abrt-addon-kerneloops-2.1.11-48.el7.centos.ppc64le
grub2-2.02-0.64.el7.centos.ppc64le
xz-devel-5.2.2-1.el7.ppc64le
xorg-x11-xkb-utils-7.7-12.el7.ppc64le
libverto-tevent-0.2.5-4.el7.ppc64le
libkdcraw-devel-4.10.5-4.el7.ppc64le
bzip2-1.0.6-13.el7.ppc64le
iputils-20160308-10.el7.ppc64le
cifs-utils-6.2-10.el7.ppc64le
libpinyin-0.9.93-4.el7.ppc64le
libao-1.1.0-8.el7.ppc64le
gdbm-devel-1.10-8.el7.ppc64le
kdepim-libs-4.10.5-6.el7.ppc64le
libxshmfence-1.2-1.el7.ppc64le
libstoragemgmt-1.4.0-3.el7.ppc64le
psacct-6.6.1-13.el7.ppc64le
pyliblzma-0.5.3-11.el7.ppc64le
libXcursor-devel-1.1.14-8.el7.ppc64le
hesiod-3.2.1-3.el7.ppc64le
okular-devel-4.10.5-4.el7.ppc64le
gsm-1.0.13-11.el7.ppc64le
telepathy-mission-control-5.16.3-3.el7.ppc64le
rng-tools-5-11.el7.ppc64le
python-chardet-2.2.1-1.el7_1.noarch
libcanberra-gtk3-0.30-5.el7.ppc64le
krb5-devel-1.15.1-8.el7.ppc64le
kdesdk-kompare-devel-4.10.5-6.el7.ppc64le
unixODBC-2.3.1-11.el7.ppc64le
dbus-devel-1.6.12-17.el7.ppc64le
kpatch-0.4.0-1.el7.noarch
graphite2-1.3.6-1.el7_2.ppc64le
nautilus-extensions-3.22.3-3.el7.ppc64le
libdb-utils-5.3.21-20.el7.ppc64le
sane-backends-libs-1.0.24-9.el7.ppc64le
zip-3.0-11.el7.ppc64le
mdadm-4.0-5.el7.ppc64le
memstomp-0.1.4-11.el7.ppc64le
libconfig-1.4.9-5.el7.ppc64le
clutter-gst2-2.0.18-1.el7.ppc64le
postgresql-libs-9.2.21-1.el7.ppc64le
gsound-1.0.2-2.el7.ppc64le
ilmbase-1.0.3-7.el7.ppc64le
udisks2-2.1.2-6.el7.ppc64le
perl-core-5.16.3-292.el7.ppc64le
pcsc-lite-libs-1.8.8-6.el7.ppc64le
gvnc-0.7.0-2.el7.ppc64le
qemu-img-1.5.3-141.el7.ppc64le
libappstream-glib-0.6.10-1.el7.ppc64le
sg3_utils-libs-1.37-12.el7.ppc64le
librdmacm-13-7.el7.ppc64le
adcli-0.8.1-3.el7.ppc64le
libnfnetlink-1.0.1-4.el7.ppc64le
colord-gtk-0.1.25-4.el7.ppc64le
libuser-python-0.60-7.el7_1.ppc64le
libfprint-0.5.0-4.el7.ppc64le
OpenEXR-libs-1.7.1-7.el7.ppc64le
attica-devel-0.4.2-1.el7.ppc64le
papi-devel-5.2.0-23.el7.ppc64le
m17n-lib-1.6.4-14.el7.ppc64le
qimageblitz-0.0.6-7.el7.ppc64le
python-urlgrabber-3.10-8.el7.noarch
pcp-selinux-3.11.8-7.el7.ppc64le
perl-Text-ParseWords-3.29-4.el7.noarch
apr-util-devel-1.5.2-6.el7.ppc64le
readline-devel-6.2-10.el7.ppc64le
python-kitchen-1.1.1-5.el7.noarch
gnome-abrt-0.3.4-8.el7.ppc64le
check-devel-0.9.9-5.el7.ppc64le
pulseaudio-gdm-hooks-10.0-3.el7.ppc64le
perl-Scalar-List-Utils-1.27-248.el7.ppc64le
abrt-addon-ccpp-2.1.11-48.el7.centos.ppc64le
gnome-icon-theme-extras-3.12.0-1.el7.noarch
python-slip-0.4.0-2.el7.noarch
brlapi-0.6.0-15.el7.ppc64le
qpdf-libs-5.0.1-3.el7.ppc64le
yelp-xsl-3.20.1-1.el7.noarch
perl-Storable-2.45-3.el7.ppc64le
libosinfo-1.0.0-1.el7.ppc64le
libcap-devel-2.22-9.el7.ppc64le
libepoxy-devel-1.3.1-1.el7.ppc64le
festival-1.96-28.el7.ppc64le
libusbx-1.0.20-1.el7.ppc64le
libvirt-daemon-driver-storage-disk-3.2.0-14.el7.ppc64le
perl-Test-Harness-3.28-3.el7.noarch
polkit-devel-0.112-12.el7_3.ppc64le
perl-Crypt-SSLeay-0.64-5.el7.ppc64le
libverto-devel-0.2.5-4.el7.ppc64le
caribou-gtk2-module-0.4.21-1.el7.ppc64le
vim-filesystem-7.4.160-2.el7.ppc64le
procps-ng-3.3.10-16.el7.ppc64le
NetworkManager-libreswan-1.2.4-2.el7.ppc64le
perl-Module-Metadata-1.000018-2.el7.noarch
pixman-devel-0.34.0-1.el7.ppc64le
patchutils-0.3.3-4.el7.ppc64le
filesystem-3.2-21.el7.ppc64le
cups-filesystem-1.6.3-29.el7.noarch
gettext-devel-0.19.8.1-2.el7.ppc64le
usbredir-0.7.1-2.el7.ppc64le
neon-0.30.0-3.el7.ppc64le
perl-LWP-MediaTypes-6.02-2.el7.noarch
python-qrcode-core-5.0.1-1.el7.noarch
hyphen-en-2.8.6-5.el7.noarch
gnu-free-fonts-common-20120503-8.el7.noarch
gtkmm30-3.22.0-1.el7.ppc64le
initial-setup-gui-0.3.9.40-1.el7.centos.ppc64le
libhugetlbfs-2.16-12.el7.ppc64le
subversion-libs-1.7.14-10.el7.ppc64le
perl-Encode-Locale-1.03-5.el7.noarch
python-inotify-0.9.4-4.el7.noarch
nano-2.3.1-10.el7.ppc64le
mobile-broadband-provider-info-1.20170310-1.el7.noarch
adwaita-gtk2-theme-3.22.2-1.el7.ppc64le
ipa-client-4.5.0-20.el7.centos.ppc64le
perl-IPC-Cmd-0.80-4.el7.noarch
libsoup-2.56.0-3.el7.ppc64le
perl-Term-UI-0.36-2.el7.noarch
python-setuptools-0.9.8-7.el7.noarch
dejavu-sans-mono-fonts-2.33-6.el7.noarch
bind-license-9.9.4-50.el7.noarch
webkitgtk4-jsc-2.14.7-2.el7.ppc64le
firewall-config-0.4.4.4-6.el7.noarch
perl-CPAN-1.9800-292.el7.noarch
gupnp-1.0.1-1.el7.ppc64le
boost-graph-1.53.0-27.el7.ppc64le
python-perf-3.10.0-693.el7.ppc64le
overpass-fonts-2.1-1.el7.noarch
thai-scalable-fonts-common-0.5.0-7.el7.noarch
webkitgtk4-jsc-devel-2.14.7-2.el7.ppc64le
pulseaudio-module-x11-10.0-3.el7.ppc64le
marisa-0.2.4-4.el7.ppc64le
gnutls-c++-3.3.26-9.el7.ppc64le
ca-certificates-2017.2.14-71.el7.noarch
python-idna-2.4-1.el7.noarch
strace-4.12-4.el7.ppc64le
nss-softokn-freebl-3.28.3-6.el7.ppc64le
vino-3.22.0-3.el7.ppc64le
libXaw-devel-1.0.13-4.el7.ppc64le
libreport-centos-2.1.11-38.el7.centos.ppc64le
alsa-utils-1.1.3-2.el7.ppc64le
libnl3-cli-3.2.28-4.el7.ppc64le
python-iniparse-0.4-9.el7.noarch
traceroute-2.0.22-2.el7.ppc64le
libselinux-2.5-11.el7.ppc64le
keybinder3-0.3.0-1.el7.ppc64le
kdepim-devel-4.10.5-6.el7.ppc64le
pakchois-0.4-10.el7.ppc64le
cryptsetup-python-1.7.4-3.el7.ppc64le
libjpeg-turbo-devel-1.2.90-5.el7.ppc64le
python-jwcrypto-0.2.1-1.el7.noarch
lohit-malayalam-fonts-2.5.3-2.el7.noarch
libpng-1.5.13-7.el7_2.ppc64le
freerdp-plugins-1.0.2-10.el7.ppc64le
ibus-chewing-1.4.4-14.el7.ppc64le
libfastjson-0.99.4-2.el7.ppc64le
libsss_sudo-1.15.2-50.el7.ppc64le
redhat-menus-12.0.2-8.el7.noarch
bind-libs-9.9.4-50.el7.ppc64le
gnu-free-sans-fonts-20120503-8.el7.noarch
libuuid-2.23.2-43.el7.ppc64le
festival-freebsoft-utils-0.10-7.el7.noarch
unique3-devel-3.0.2-8.el7.ppc64le
compat-poppler022-0.22.5-4.el7.ppc64le
sssd-proxy-1.15.2-50.el7.ppc64le
python-2.7.5-58.el7.ppc64le
libwvstreams-4.6.1-11.el7.ppc64le
lrzsz-0.12.20-36.el7.ppc64le
sqlite-3.7.17-8.el7.ppc64le
xorg-x11-server-common-1.19.3-11.el7.ppc64le
sushi-3.21.91-1.el7.ppc64le
rubygem-psych-2.0.0-30.el7.ppc64le
gnupg2-2.0.22-4.el7.ppc64le
libmount-2.23.2-43.el7.ppc64le
nss-3.28.4-8.el7.ppc64le
iwl3160-firmware-22.0.7.0-56.el7.noarch
libnl3-3.2.28-4.el7.ppc64le
xorg-x11-drv-ati-7.7.1-3.20160928git3fc839ff.el7.ppc64le
evolution-mapi-3.22.6-1.el7.ppc64le
libservicelog-1.1.17-2.el7.ppc64le
perl-PAR-Dist-0.49-2.el7.noarch
dbus-glib-0.100-7.el7.ppc64le
docbook-style-xsl-1.78.1-3.el7.noarch
iwl100-firmware-39.31.5.1-56.el7.noarch
libxslt-1.1.28-5.el7.ppc64le
junit-4.11-8.el7.noarch
gnome-session-xsession-3.22.3-4.el7.ppc64le
selinux-policy-3.13.1-166.el7.noarch
PackageKit-1.1.5-1.el7.centos.ppc64le
zlib-devel-1.2.7-17.el7.ppc64le
perl-libxml-perl-0.08-19.el7.noarch
iwl4965-firmware-228.61.2.24-56.el7.noarch
p11-kit-0.23.5-3.el7.ppc64le
spice-gtk3-0.33-6.el7.ppc64le
pygobject3-devel-3.22.0-1.el7.ppc64le
systemtap-runtime-3.1-3.el7.ppc64le
nss-softokn-freebl-devel-3.28.3-6.el7.ppc64le
libgee-0.18.1-1.el7.ppc64le
perl-PlRPC-0.2020-14.el7.noarch
python34-libs-3.4.5-4.el7.ppc64le
json-c-0.11-4.el7_0.ppc64le
plymouth-plugin-two-step-0.8.9-0.28.20140113.el7.centos.ppc64le
gnome-font-viewer-3.22.0-1.el7.ppc64le
sssd-client-1.15.2-50.el7.ppc64le
libXext-1.3.3-3.el7.ppc64le
nspr-devel-4.13.1-1.0.el7_3.ppc64le
perl-Algorithm-Diff-1.1902-17.el7.noarch
libgomp-4.8.5-16.el7_4.1.ppc64le
tcp_wrappers-libs-7.6-77.el7.ppc64le
libgdata-devel-0.17.8-1.el7.ppc64le
gnome-screenshot-3.22.0-1.el7.ppc64le
mtdev-1.1.5-5.el7.ppc64le
mesa-libEGL-17.0.1-6.20170307.el7.ppc64le
libpng-devel-1.5.13-7.el7_2.ppc64le
perl-Digest-SHA1-2.13-9.el7.ppc64le
libdhash-0.4.3-27.el7.ppc64le
phonon-devel-4.6.0-10.el7.ppc64le
qt3-ODBC-3.3.8b-51.el7.ppc64le
systemd-219-42.el7.ppc64le
libXinerama-1.1.3-2.1.el7.ppc64le
gdb-7.6.1-100.el7.ppc64le
perl-File-Listing-6.04-7.el7.noarch
jasper-libs-1.900.1-31.el7.ppc64le
ibus-setup-1.5.3-13.el7.noarch
spice-vdagent-0.14.0-14.el7.ppc64le
PackageKit-glib-1.1.5-1.el7.centos.ppc64le
libXmu-1.1.2-2.el7.ppc64le
atkmm-2.24.2-1.el7.ppc64le
perl-Sys-Syslog-0.33-3.el7.ppc64le
libXdmcp-1.1.2-6.el7.ppc64le
kdelibs-devel-4.14.8-6.el7_3.ppc64le
targetcli-2.1.fb46-1.el7.noarch
libcgroup-0.41-13.el7.ppc64le
qt-x11-4.8.5-13.el7.ppc64le
libxcb-devel-1.12-1.el7.ppc64le
perl-HTML-Format-2.10-7.el7.noarch
libsss_idmap-1.15.2-50.el7.ppc64le
kactivities-4.10.5-3.el7.ppc64le
httpd-devel-2.4.6-67.el7.centos.ppc64le
abrt-2.1.11-48.el7.centos.ppc64le
java-1.7.0-openjdk-headless-1.7.0.141-2.6.10.5.el7.ppc64le
apr-devel-1.4.8-3.el7.ppc64le
cdparanoia-10.2-17.el7.ppc64le
libpcap-1.5.3-9.el7.ppc64le
libkworkspace-4.11.19-8.el7.ppc64le
dbus-glib-devel-0.100-7.el7.ppc64le
crontabs-1.11-6.20121102git.el7.noarch
libXi-devel-1.7.9-1.el7.ppc64le
gnome-menus-3.13.3-3.el7.ppc64le
libieee1284-devel-0.2.11-15.el7.ppc64le
kmod-libs-20-15.el7.ppc64le
kde-runtime-4.10.5-8.el7.ppc64le
mod_ssl-2.4.6-67.el7.centos.ppc64le
cyrus-sasl-2.1.26-21.el7.ppc64le
libXScrnSaver-1.2.2-6.1.el7.ppc64le
python-augeas-0.5.0-2.el7.noarch
LibRaw-0.14.8-5.el7.20120830git98d925.ppc64le
hyphen-2.8.6-5.el7.ppc64le
kdenetwork-krdc-libs-4.10.5-8.el7_0.ppc64le
opal-prd-5.5.0-1.el7.ppc64le
rdma-core-13-7.el7.ppc64le
pulseaudio-10.0-3.el7.ppc64le
python-sssdconfig-1.15.2-50.el7.noarch
libisofs-1.2.8-4.el7.ppc64le
libverto-0.2.5-4.el7.ppc64le
kdesdk-kmtrace-devel-4.10.5-6.el7.ppc64le
systemd-devel-219-42.el7.ppc64le
mesa-dri-drivers-17.0.1-6.20170307.el7.ppc64le
clutter-1.26.0-1.el7.ppc64le
fipscheck-1.4.1-6.el7.ppc64le
dwz-0.11-3.el7.ppc64le
boost-regex-1.53.0-27.el7.ppc64le
libXaw-1.0.13-4.el7.ppc64le
systemd-python-219-42.el7.ppc64le
zenity-3.22.0-1.el7.ppc64le
boost-atomic-1.53.0-27.el7.ppc64le
rpm-libs-4.11.3-25.el7.ppc64le
GeoIP-1.5.0-11.el7.ppc64le
libksane-devel-4.10.5-4.el7.ppc64le
rubygem-bundler-1.7.8-3.el7.noarch
git-1.8.3.1-11.el7.ppc64le
brasero-libs-3.12.1-2.el7.ppc64le
c-ares-1.10.0-3.el7.ppc64le
libnfsidmap-0.25-17.el7.ppc64le
cdparanoia-libs-10.2-17.el7.ppc64le
tk-8.5.13-6.el7.ppc64le
libhugetlbfs-devel-2.16-12.el7.ppc64le
NetworkManager-wifi-1.8.0-9.el7.ppc64le
libcanberra-gtk2-0.30-5.el7.ppc64le
hostname-3.13-3.el7.ppc64le
redland-1.0.16-6.el7.ppc64le
libdaemon-0.14-7.el7.ppc64le
brasero-3.12.1-2.el7.ppc64le
cups-devel-1.6.3-29.el7.ppc64le
qca2-2.0.3-7.el7.ppc64le
pangomm-2.40.1-1.el7.ppc64le
libnetfilter_conntrack-1.0.6-1.el7_3.ppc64le
sip-devel-4.14.6-4.el7.ppc64le
perl-parent-0.225-244.el7.noarch
libkkc-0.3.1-9.el7.ppc64le
crypto-utils-2.4.1-42.el7.ppc64le
lvm2-2.02.171-8.el7.ppc64le
poppler-glib-0.26.5-16.el7.ppc64le
crash-7.1.9-2.el7.ppc64le
libbluray-0.2.3-5.el7.ppc64le
perl-Filter-1.49-3.el7.ppc64le
control-center-3.22.2-5.el7.ppc64le
c-ares-devel-1.10.0-3.el7.ppc64le
sysstat-10.1.5-12.el7.ppc64le
mesa-libGL-devel-17.0.1-6.20170307.el7.ppc64le
python-pwquality-1.2.3-4.el7.ppc64le
liblouis-python-2.5.2-10.el7.noarch
perl-PathTools-3.40-5.el7.ppc64le
gnome-shell-extension-apps-menu-3.22.2-10.el7.noarch
hunspell-devel-1.3.2-15.el7.ppc64le
policycoreutils-python-2.5-17.1.el7.ppc64le
libwnck3-3.20.1-1.el7.ppc64le
gsettings-desktop-schemas-devel-3.22.0-1.el7.ppc64le
lsof-4.87-4.el7.ppc64le
perl-Getopt-Long-2.40-2.el7.noarch
nfs-utils-1.3.0-0.48.el7.ppc64le
mtr-0.85-7.el7.ppc64le
autofs-5.0.7-69.el7.ppc64le
cairo-devel-1.14.8-2.el7.ppc64le
xorg-x11-xbitmaps-1.1.1-6.el7.noarch
libreport-2.1.11-38.el7.centos.ppc64le
perl-XML-Parser-2.41-10.el7.ppc64le
libvirt-daemon-driver-storage-3.2.0-14.el7.ppc64le
python2-caribou-0.4.21-1.el7.noarch
fontpackages-filesystem-1.44-8.el7.noarch
perl-Test-Pod-1.48-3.el7.noarch
libuuid-devel-2.23.2-43.el7.ppc64le
perl-Package-Constants-0.02-292.el7.noarch
gnutls-3.3.26-9.el7.ppc64le
libreport-cli-2.1.11-38.el7.centos.ppc64le
gettext-common-devel-0.19.8.1-2.el7.noarch
cups-filters-1.0.35-22.el7.ppc64le
xkeyboard-config-2.20-1.el7.noarch
bison-3.0.4-1.el7.ppc64le
compat-libcolord1-1.0.4-1.el7.ppc64le
perl-Digest-MD5-2.52-3.el7.ppc64le
gnutls-dane-3.3.26-9.el7.ppc64le
libusbx-devel-1.0.20-1.el7.ppc64le
initial-setup-0.3.9.40-1.el7.centos.ppc64le
libchamplain-gtk-0.12.15-1.el7.ppc64le
libreport-filesystem-2.1.11-38.el7.centos.ppc64le
m17n-contrib-1.1.14-3.el7.noarch
newt-python-0.52.15-4.el7.ppc64le
perl-Locale-Maketext-1.23-3.el7.noarch
libvirt-daemon-driver-nodedev-3.2.0-14.el7.ppc64le
perl-ExtUtils-Install-1.58-292.el7.noarch
libvirt-3.2.0-14.el7.ppc64le
gnome-themes-standard-3.22.2-1.el7.ppc64le
gl-manpages-1.1-7.20130122.el7.noarch
lohit-gujarati-fonts-2.5.3-2.el7.noarch
python-backports-ssl_match_hostname-3.4.0.2-4.el7.noarch
perl-local-lib-1.008010-4.el7.noarch
rest-0.8.0-1.el7.ppc64le
perl-Module-Build-0.40.05-2.el7.noarch
ibus-kkc-1.5.18-7.el7.ppc64le
webkitgtk4-plugin-process-gtk2-2.14.7-2.el7.ppc64le
basesystem-10.0-7.el7.centos.noarch
madan-fonts-2.000-11.el7.noarch
python-beaker-1.5.4-10.el7.noarch
boost-locale-1.53.0-27.el7.ppc64le
dleyna-core-0.5.0-1.el7.ppc64le
liberation-sans-fonts-1.07.2-15.el7.noarch
tk-devel-8.5.13-6.el7.ppc64le
gnome-packagekit-updater-3.22.1-2.el7.ppc64le
cim-schema-2.33.0-6.el7.noarch
lohit-assamese-fonts-2.5.3-2.el7.noarch
tagsoup-1.2.1-8.el7.noarch
libshout-2.2.2-11.el7.ppc64le
ntpdate-4.2.6p5-25.el7.centos.2.ppc64le
libproxy-0.4.11-10.el7.ppc64le
gvfs-gphoto2-1.30.4-3.el7.ppc64le
gspell-1.2.3-1.el7.ppc64le
sil-nuosu-fonts-2.1.1-5.el7.noarch
python-ntplib-0.3.2-1.el7.noarch
bc-1.06.95-13.el7.ppc64le
libvirt-daemon-driver-lxc-3.2.0-14.el7.ppc64le
libreport-anaconda-2.1.11-38.el7.centos.ppc64le
kdepimlibs-devel-4.10.5-4.el7.ppc64le
unique3-3.0.2-8.el7.ppc64le
freetype-2.4.11-15.el7.ppc64le
lohit-marathi-fonts-2.5.3-2.el7.noarch
python2-cryptography-1.7.2-1.el7.ppc64le
libss-1.42.9-10.el7.ppc64le
kernel-tools-libs-3.10.0-693.el7.ppc64le
libsysfs-2.1.0-16.el7.ppc64le
ibus-hangul-1.4.2-10.el7.ppc64le
freerdp-1.0.2-10.el7.ppc64le
popt-1.13-16.el7.ppc64le
open-sans-fonts-1.10-1.el7.noarch
bind-libs-lite-9.9.4-50.el7.ppc64le
lksctp-tools-1.0.17-2.el7.ppc64le
sssd-common-pac-1.15.2-50.el7.ppc64le
libtiff-4.0.3-27.el7_3.ppc64le
gnome-desktop3-devel-3.22.2-2.el7.ppc64le
cdrdao-1.2.3-20.el7.ppc64le
expat-2.1.0-10.el7_3.ppc64le
latrace-0.5.11-6.1.el7.ppc64le
perl-Net-SSLeay-1.55-6.el7.ppc64le
cups-libs-1.6.3-29.el7.ppc64le
dmraid-events-1.0.0.rc16-28.el7.ppc64le
rubygem-io-console-0.4.2-30.el7.ppc64le
gutenprint-cups-5.2.9-18.el7.ppc64le
xorg-x11-server-Xorg-1.19.3-11.el7.ppc64le
libtalloc-2.1.9-1.el7.ppc64le
iwl6000g2b-firmware-17.168.5.2-56.el7.noarch
nss-sysinit-3.28.4-8.el7.ppc64le
glib2-2.50.3-3.el7.ppc64le
rpm-python-4.11.3-25.el7.ppc64le
ustr-1.0.4-16.el7.ppc64le
gucharmap-3.18.2-1.el7.ppc64le
xorg-x11-drv-dummy-0.3.7-1.el7.ppc64le
libogg-1.3.0-7.el7.ppc64le
iwl6000-firmware-9.221.4.1-56.el7.noarch
docbook-dtds-1.0-60.el7.noarch
xorg-x11-proto-devel-7.7-20.el7.noarch
pygpgme-0.3-9.el7.ppc64le
openssh-7.4p1-11.el7.ppc64le
cheese-3.22.1-1.el7.ppc64le
jline-1.0-8.el7.noarch
libcap-2.22-9.el7.ppc64le
ivtv-firmware-20080701-26.el7.noarch
perl-Pod-LaTeX-0.61-2.el7.noarch
enchant-1.6.0-8.el7.ppc64le
python2-ipalib-4.5.0-20.el7.centos.noarch
tog-pegasus-libs-2.14.1-5.el7.ppc64le
firstboot-19.12-1.el7.ppc64le
gupnp-dlna-0.10.5-1.el7.ppc64le
which-2.20-7.el7.ppc64le
epel-release-7-9.noarch
perl-Net-Daemon-0.48-5.el7.noarch
libcroco-0.6.11-1.el7.ppc64le
liboauth-devel-0.9.7-4.el7.ppc64le
libhangul-0.1.0-8.el7.ppc64le
eog-3.20.5-2.el7.ppc64le
plymouth-theme-charge-0.8.9-0.28.20140113.el7.centos.ppc64le
libcollection-0.6.2-27.el7.ppc64le
libgfortran-4.8.5-16.el7_4.1.ppc64le
perl-Locale-Codes-3.26-2.el7.noarch
pygobject2-2.28.6-11.el7.ppc64le
libXdamage-1.1.4-4.1.el7.ppc64le
libestr-0.1.9-2.el7.ppc64le
PackageKit-gtk3-module-1.1.5-1.el7.centos.ppc64le
libgweather-devel-3.20.4-1.el7.ppc64le
xz-5.2.2-1.el7.ppc64le
perl-WWW-RobotRules-6.02-5.el7.noarch
libICE-devel-1.0.9-9.el7.ppc64le
libXft-2.3.2-2.el7.ppc64le
cryptsetup-libs-1.7.4-3.el7.ppc64le
alsa-plugins-pulseaudio-1.1.1-1.el7.ppc64le
glx-utils-8.2.0-3.el7.ppc64le
speex-1.2-0.19.rc1.el7.ppc64le
perl-HTTP-Negotiate-6.01-5.el7.noarch
libtirpc-0.2.4-0.10.el7.ppc64le
pulseaudio-libs-glib2-10.0-3.el7.ppc64le
mesa-libgbm-17.0.1-6.20170307.el7.ppc64le
pulseaudio-libs-devel-10.0-3.el7.ppc64le
imsettings-1.6.3-9.el7.ppc64le
hunspell-en-US-0.20121024-6.el7.noarch
perl-IO-Socket-IP-0.21-4.el7.noarch
nss-util-devel-3.28.4-3.el7.ppc64le
libXxf86vm-1.1.4-1.el7.ppc64le
hwdata-0.252-8.6.el7.ppc64le
kernel-tools-3.10.0-693.el7.ppc64le
nepomuk-core-libs-4.10.5-5.el7.ppc64le
exiv2-libs-0.23-6.el7.ppc64le
perl-libwww-perl-6.05-2.el7.noarch
p11-kit-devel-0.23.5-3.el7.ppc64le
librsvg2-2.40.16-1.el7.ppc64le
libsmbclient-4.6.2-8.el7.ppc64le
abrt-console-notification-2.1.11-48.el7.centos.ppc64le
kdesdk-okteta-libs-4.10.5-6.el7.ppc64le
boost-chrono-1.53.0-27.el7.ppc64le
iw-4.3-1.el7.ppc64le
libcom_err-devel-1.42.9-10.el7.ppc64le
akonadi-1.9.2-4.el7.ppc64le
accountsservice-libs-0.6.45-2.el7.ppc64le
wvdial-1.61-9.el7.ppc64le
libkexiv2-devel-4.10.5-3.el7.ppc64le
libmpc-1.0.1-3.el7.ppc64le
lm_sensors-devel-3.4.0-4.20160601gitf9185e5.el7.ppc64le
meanwhile-1.1.0-12.el7.ppc64le
libXt-devel-1.1.5-3.el7.ppc64le
plymouth-scripts-0.8.9-0.28.20140113.el7.centos.ppc64le
mod_fcgid-2.3.9-4.el7.ppc64le
kdepim-runtime-libs-4.10.5-3.el7.ppc64le
mesa-libglapi-17.0.1-6.20170307.el7.ppc64le
hunspell-en-GB-0.20121024-6.el7.noarch
sip-4.14.6-4.el7.ppc64le
cairomm-1.12.0-1.el7.ppc64le
abrt-addon-xorg-2.1.11-48.el7.centos.ppc64le
ModemManager-1.6.0-2.el7.ppc64le
kdenetwork-krdc-devel-4.10.5-8.el7_0.ppc64le
libieee1284-0.2.11-15.el7.ppc64le
highlight-3.13-3.el7.ppc64le
pyOpenSSL-0.13.1-3.el7.ppc64le
gtk-update-icon-cache-3.22.10-4.el7.ppc64le
NetworkManager-1.8.0-9.el7.ppc64le
crda-3.13_2016.02.08-1.el7.ppc64le
kdesdk-kompare-libs-4.10.5-6.el7.ppc64le
newt-0.52.15-4.el7.ppc64le
xcb-util-0.4.0-2.el7.ppc64le
automake-1.13.4-3.el7.noarch
libgweather-3.20.4-1.el7.ppc64le
lockdev-1.0.4-0.13.20111007git.el7.ppc64le
man-db-2.6.3-9.el7.ppc64le
gd-2.0.35-26.el7.ppc64le
exempi-2.2.0-8.el7.ppc64le
curl-7.29.0-42.el7.ppc64le
snappy-1.1.0-3.el7.ppc64le
libreport-gtk-2.1.11-38.el7.centos.ppc64le
unbound-libs-1.4.20-34.el7.ppc64le
tcpdump-4.9.0-5.el7.ppc64le
sane-backends-drivers-scanners-1.0.24-9.el7.ppc64le
libedit-3.0-12.20121213cvs.el7.ppc64le
liboauth-0.9.7-4.el7.ppc64le
libmpcdec-1.2.6-12.el7.ppc64le
libnm-gtk-1.8.0-3.el7.ppc64le
grub2-tools-extra-2.02-0.64.el7.centos.ppc64le
libdmx-1.1.3-3.el7.ppc64le
wavpack-4.60.1-9.el7.ppc64le
rasqal-0.9.30-4.el7.ppc64le
autogen-libopts-5.18-5.el7.ppc64le
gnome-bluetooth-libs-3.20.1-1.el7.ppc64le
qt-settings-19-23.5.el7.centos.noarch
libxslt-devel-1.1.28-5.el7.ppc64le
grilo-plugins-0.3.4-1.el7.ppc64le
SDL-1.2.15-14.el7.ppc64le
sip-macros-4.14.6-4.el7.ppc64le
iptables-1.4.21-18.0.1.el7.centos.ppc64le
gstreamer-plugins-good-0.10.31-13.el7.ppc64le
qjson-0.8.1-4.el7.ppc64le
perl-Test-Pod-Coverage-1.08-21.el7.noarch
pcp-conf-3.11.8-7.el7.ppc64le
perl-podlators-2.5.1-3.el7.noarch
libcurl-devel-7.29.0-42.el7.ppc64le
graphite2-devel-1.3.6-1.el7_2.ppc64le
pygtk2-2.24.0-9.el7.ppc64le
kexec-tools-2.0.14-17.el7.ppc64le
iptables-devel-1.4.21-18.0.1.el7.centos.ppc64le
gnome-shell-3.22.3-17.el7.ppc64le
perl-Carp-1.26-244.el7.noarch
liblouis-2.5.2-10.el7.ppc64le
dvd+rw-tools-7.1-15.el7.ppc64le
ptlib-2.10.10-6.el7.ppc64le
samba-common-libs-4.6.2-8.el7.ppc64le
gvfs-devel-1.30.4-3.el7.ppc64le
gnome-shell-extension-launch-new-instance-3.22.2-10.el7.noarch
perl-libs-5.16.3-292.el7.ppc64le
libselinux-utils-2.5-11.el7.ppc64le
libsepol-devel-2.5-6.el7.ppc64le
festival-lib-1.96-28.el7.ppc64le
oddjob-0.31.5-4.el7.ppc64le
latencytop-tui-0.5-13.el7.ppc64le
libvirt-daemon-driver-storage-core-3.2.0-14.el7.ppc64le
perl-Data-Dumper-2.145-3.el7.ppc64le
libreport-python-2.1.11-38.el7.centos.ppc64le
libical-devel-1.0.1-1.el7.ppc64le
libmx-1.4.7-10.el7.ppc64le
cups-pk-helper-0.2.6-2.el7.ppc64le
=== TEST BEGIN ===
Install prefix    /var/tmp/patchew-tester-tmp-q3ovq1d2/src/install
BIOS directory    /var/tmp/patchew-tester-tmp-q3ovq1d2/src/install/share/qemu
firmware path     /var/tmp/patchew-tester-tmp-q3ovq1d2/src/install/share/qemu-firmware
binary directory  /var/tmp/patchew-tester-tmp-q3ovq1d2/src/install/bin
library directory /var/tmp/patchew-tester-tmp-q3ovq1d2/src/install/lib
module directory  /var/tmp/patchew-tester-tmp-q3ovq1d2/src/install/lib/qemu
libexec directory /var/tmp/patchew-tester-tmp-q3ovq1d2/src/install/libexec
include directory /var/tmp/patchew-tester-tmp-q3ovq1d2/src/install/include
config directory  /var/tmp/patchew-tester-tmp-q3ovq1d2/src/install/etc
local state directory   /var/tmp/patchew-tester-tmp-q3ovq1d2/src/install/var
Manual directory  /var/tmp/patchew-tester-tmp-q3ovq1d2/src/install/share/man
ELF interp prefix /usr/gnemul/qemu-%M
Source path       /var/tmp/patchew-tester-tmp-q3ovq1d2/src
GIT binary        git
GIT submodules    ui/keycodemapdb dtc capstone
C compiler        cc
Host C compiler   cc
C++ compiler      c++
Objective-C compiler cc
ARFLAGS           rv
CFLAGS            -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -g 
QEMU_CFLAGS       -I/usr/include/pixman-1   -I$(SRC_PATH)/dtc/libfdt -Werror -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include   -DNCURSES_WIDECHAR   -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv  -Wendif-labels -Wno-missing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-declaration -Wold-style-definition -Wtype-limits -fstack-protector-strong -Wno-missing-braces -I/usr/include/p11-kit-1       -I/usr/include/libpng15   -I$(SRC_PATH)/capstone/include
LDFLAGS           -Wl,--warn-common -m64 -g 
make              make
install           install
python            python -B
smbd              /usr/sbin/smbd
module support    no
host CPU          ppc64
host big endian   no
target list       aarch64-softmmu alpha-softmmu arm-softmmu cris-softmmu hppa-softmmu i386-softmmu lm32-softmmu m68k-softmmu microblazeel-softmmu microblaze-softmmu mips64el-softmmu mips64-softmmu mipsel-softmmu mips-softmmu moxie-softmmu nios2-softmmu or1k-softmmu ppc64-softmmu ppcemb-softmmu ppc-softmmu s390x-softmmu sh4eb-softmmu sh4-softmmu sparc64-softmmu sparc-softmmu tricore-softmmu unicore32-softmmu x86_64-softmmu xtensaeb-softmmu xtensa-softmmu aarch64_be-linux-user aarch64-linux-user alpha-linux-user armeb-linux-user arm-linux-user cris-linux-user hppa-linux-user i386-linux-user m68k-linux-user microblazeel-linux-user microblaze-linux-user mips64el-linux-user mips64-linux-user mipsel-linux-user mips-linux-user mipsn32el-linux-user mipsn32-linux-user nios2-linux-user or1k-linux-user ppc64abi32-linux-user ppc64le-linux-user ppc64-linux-user ppc-linux-user s390x-linux-user sh4eb-linux-user sh4-linux-user sparc32plus-linux-user sparc64-linux-user sparc-linux-user tilegx-linux-user x86_64-linux-user
gprof enabled     no
sparse enabled    no
strip binaries    yes
profiler          no
static build      no
SDL support       yes (1.2.15)
GTK support       yes (3.22.10)
GTK GL support    no
VTE support       no 
TLS priority      NORMAL
GNUTLS support    yes
GNUTLS rnd        yes
libgcrypt         no
libgcrypt kdf     no
nettle            yes (2.7.1)
nettle kdf        yes
libtasn1          yes
curses support    yes
virgl support     no
curl support      yes
mingw32 support   no
Audio drivers     oss
Block whitelist (rw) 
Block whitelist (ro) 
VirtFS support    yes
Multipath support no
VNC support       yes
VNC SASL support  yes
VNC JPEG support  yes
VNC PNG support   yes
xen support       no
brlapi support    no
bluez  support    no
Documentation     no
PIE               no
vde support       no
netmap support    no
Linux AIO support yes
ATTR/XATTR support yes
Install blobs     yes
KVM support       yes
HAX support       no
HVF support       no
TCG support       yes
TCG debug enabled no
TCG interpreter   no
malloc trim support yes
RDMA support      yes
fdt support       yes
preadv support    yes
fdatasync         yes
madvise           yes
posix_madvise     yes
libcap-ng support yes
vhost-net support yes
vhost-scsi support yes
vhost-vsock support yes
vhost-user support yes
Trace backends    log
spice support     no 
rbd support       no
xfsctl support    no
smartcard support no
libusb            yes
usb net redir     no
OpenGL support    no
OpenGL dmabufs    no
libiscsi support  no
libnfs support    no
build guest agent yes
QGA VSS support   no
QGA w32 disk info no
QGA MSI support   no
seccomp support   no
coroutine backend ucontext
coroutine pool    yes
debug stack usage no
crypto afalg      no
GlusterFS support no
gcov              gcov
gcov enabled      no
TPM support       yes
libssh2 support   no
TPM passthrough   no
TPM emulator      yes
QOM debugging     yes
Live block migration yes
lzo support       no
snappy support    no
bzip2 support     yes
NUMA host support yes
libxml2           yes
tcmalloc support  no
jemalloc support  no
avx2 optimization no
replication support yes
VxHS block device no
capstone          git

WARNING: Use of SDL 1.2 is deprecated and will be removed in
WARNING: future releases. Please switch to using SDL 2.0
  GEN     aarch64-softmmu/config-devices.mak.tmp
  GEN     alpha-softmmu/config-devices.mak.tmp
  GEN     arm-softmmu/config-devices.mak.tmp
  GEN     cris-softmmu/config-devices.mak.tmp
  GEN     hppa-softmmu/config-devices.mak.tmp
  GEN     i386-softmmu/config-devices.mak.tmp
  GEN     lm32-softmmu/config-devices.mak.tmp
  GEN     microblazeel-softmmu/config-devices.mak.tmp
  GEN     microblaze-softmmu/config-devices.mak.tmp
  GEN     m68k-softmmu/config-devices.mak.tmp
  GEN     mips64el-softmmu/config-devices.mak.tmp
  GEN     mips64-softmmu/config-devices.mak.tmp
  GEN     mipsel-softmmu/config-devices.mak.tmp
  GEN     mips-softmmu/config-devices.mak.tmp
  GEN     cris-softmmu/config-devices.mak
  GEN     moxie-softmmu/config-devices.mak.tmp
  GEN     alpha-softmmu/config-devices.mak
  GEN     ppcemb-softmmu/config-devices.mak.tmp
  GEN     lm32-softmmu/config-devices.mak
  GEN     ppc-softmmu/config-devices.mak.tmp
  GEN     s390x-softmmu/config-devices.mak.tmp
  GEN     sh4eb-softmmu/config-devices.mak.tmp
  GEN     sh4-softmmu/config-devices.mak.tmp
  GEN     sparc-softmmu/config-devices.mak.tmp
  GEN     tricore-softmmu/config-devices.mak.tmp
  GEN     microblaze-softmmu/config-devices.mak
  GEN     x86_64-softmmu/config-devices.mak.tmp
  GEN     xtensa-softmmu/config-devices.mak.tmp
  GEN     unicore32-softmmu/config-devices.mak.tmp
  GEN     or1k-softmmu/config-devices.mak.tmp
  GEN     sparc64-softmmu/config-devices.mak.tmp
  GEN     aarch64_be-linux-user/config-devices.mak.tmp
  GEN     ppc64-softmmu/config-devices.mak.tmp
  GEN     aarch64-softmmu/config-devices.mak
  GEN     tricore-softmmu/config-devices.mak
  GEN     aarch64-linux-user/config-devices.mak.tmp
  GEN     alpha-linux-user/config-devices.mak.tmp
  GEN     nios2-softmmu/config-devices.mak.tmp
  GEN     arm-linux-user/config-devices.mak.tmp
  GEN     cris-linux-user/config-devices.mak.tmp
  GEN     xtensaeb-softmmu/config-devices.mak.tmp
  GEN     hppa-linux-user/config-devices.mak.tmp
  GEN     m68k-softmmu/config-devices.mak
  GEN     i386-linux-user/config-devices.mak.tmp
  GEN     armeb-linux-user/config-devices.mak.tmp
  GEN     aarch64_be-linux-user/config-devices.mak
  GEN     arm-softmmu/config-devices.mak
  GEN     microblazeel-linux-user/config-devices.mak.tmp
  GEN     microblaze-linux-user/config-devices.mak.tmp
  GEN     m68k-linux-user/config-devices.mak.tmp
  GEN     mips64el-linux-user/config-devices.mak.tmp
  GEN     mips64-linux-user/config-devices.mak.tmp
  GEN     mipsel-linux-user/config-devices.mak.tmp
  GEN     mips-linux-user/config-devices.mak.tmp
  GEN     mipsn32el-linux-user/config-devices.mak.tmp
  GEN     mipsn32-linux-user/config-devices.mak.tmp
  GEN     i386-softmmu/config-devices.mak
  GEN     s390x-softmmu/config-devices.mak
  GEN     or1k-softmmu/config-devices.mak
  GEN     mips64el-linux-user/config-devices.mak
  GEN     nios2-linux-user/config-devices.mak.tmp
  GEN     ppc64abi32-linux-user/config-devices.mak.tmp
  GEN     sparc-softmmu/config-devices.mak
  GEN     ppc64le-linux-user/config-devices.mak.tmp
  GEN     cris-linux-user/config-devices.mak
  GEN     i386-linux-user/config-devices.mak
  GEN     sh4eb-softmmu/config-devices.mak
  GEN     ppc64-linux-user/config-devices.mak.tmp
  GEN     or1k-linux-user/config-devices.mak.tmp
  GEN     alpha-linux-user/config-devices.mak
  GEN     mipsn32el-linux-user/config-devices.mak
  GEN     nios2-softmmu/config-devices.mak
  GEN     unicore32-softmmu/config-devices.mak
  GEN     moxie-softmmu/config-devices.mak
  GEN     mips-softmmu/config-devices.mak
  GEN     m68k-linux-user/config-devices.mak
  GEN     xtensa-softmmu/config-devices.mak
  GEN     hppa-softmmu/config-devices.mak
  GEN     aarch64-linux-user/config-devices.mak
  GEN     ppcemb-softmmu/config-devices.mak
  GEN     armeb-linux-user/config-devices.mak
  GEN     arm-linux-user/config-devices.mak
  GEN     hppa-linux-user/config-devices.mak
  GEN     x86_64-softmmu/config-devices.mak
  GEN     xtensaeb-softmmu/config-devices.mak
  GEN     microblazeel-softmmu/config-devices.mak
  GEN     mips64-softmmu/config-devices.mak
  GEN     ppc64-softmmu/config-devices.mak
  GEN     ppc-softmmu/config-devices.mak
  GEN     mipsel-softmmu/config-devices.mak
  GEN     microblazeel-linux-user/config-devices.mak
  GEN     microblaze-linux-user/config-devices.mak
  GEN     mips64-linux-user/config-devices.mak
  GEN     mipsel-linux-user/config-devices.mak
  GEN     mips-linux-user/config-devices.mak
  GEN     mipsn32-linux-user/config-devices.mak
  GEN     mips64el-softmmu/config-devices.mak
  GEN     sh4-softmmu/config-devices.mak
  GEN     sparc64-softmmu/config-devices.mak
  GEN     nios2-linux-user/config-devices.mak
  GEN     or1k-linux-user/config-devices.mak
  GEN     ppc64abi32-linux-user/config-devices.mak
  GEN     ppc64le-linux-user/config-devices.mak
  GEN     ppc64-linux-user/config-devices.mak
  GEN     ppc-linux-user/config-devices.mak.tmp
  GEN     s390x-linux-user/config-devices.mak.tmp
  GEN     sh4eb-linux-user/config-devices.mak.tmp
  GEN     sh4-linux-user/config-devices.mak.tmp
  GEN     sparc32plus-linux-user/config-devices.mak.tmp
  GEN     sparc64-linux-user/config-devices.mak.tmp
  GEN     sparc-linux-user/config-devices.mak.tmp
  GEN     tilegx-linux-user/config-devices.mak.tmp
  GEN     x86_64-linux-user/config-devices.mak.tmp
  GEN     sh4eb-linux-user/config-devices.mak
  GEN     sh4-linux-user/config-devices.mak
  GEN     ppc-linux-user/config-devices.mak
  GEN     s390x-linux-user/config-devices.mak
  GEN     sparc32plus-linux-user/config-devices.mak
  GEN     sparc64-linux-user/config-devices.mak
  GEN     sparc-linux-user/config-devices.mak
  GEN     config-host.h
  GEN     tilegx-linux-user/config-devices.mak
  GIT     ui/keycodemapdb dtc capstone
  GEN     x86_64-linux-user/config-devices.mak
  GEN     qemu-options.def
  GEN     qapi-gen
  GEN     trace/generated-tcg-tracers.h
  GEN     trace/generated-helpers-wrappers.h
  GEN     trace/generated-helpers.h
  GEN     trace/generated-helpers.c
  GEN     module_block.h
  GEN     tests/test-qapi-gen
  GEN     trace-root.h
  GEN     util/trace.h
  GEN     crypto/trace.h
  GEN     io/trace.h
  GEN     migration/trace.h
  GEN     block/trace.h
  GEN     chardev/trace.h
  GEN     hw/block/trace.h
  GEN     hw/block/dataplane/trace.h
  GEN     hw/char/trace.h
  GEN     hw/intc/trace.h
  GEN     hw/net/trace.h
  GEN     hw/virtio/trace.h
  GEN     hw/audio/trace.h
  GEN     hw/misc/trace.h
  GEN     hw/usb/trace.h
  GEN     hw/scsi/trace.h
  GEN     hw/nvram/trace.h
  GEN     hw/display/trace.h
  GEN     hw/input/trace.h
  GEN     hw/timer/trace.h
  GEN     hw/dma/trace.h
  GEN     hw/sparc/trace.h
  GEN     hw/sparc64/trace.h
  GEN     hw/sd/trace.h
  GEN     hw/isa/trace.h
  GEN     hw/mem/trace.h
  GEN     hw/i386/trace.h
  GEN     hw/i386/xen/trace.h
  GEN     hw/9pfs/trace.h
  GEN     hw/ppc/trace.h
  GEN     hw/pci/trace.h
  GEN     hw/pci-host/trace.h
  GEN     hw/s390x/trace.h
  GEN     hw/vfio/trace.h
  GEN     hw/acpi/trace.h
  GEN     hw/arm/trace.h
  GEN     hw/alpha/trace.h
  GEN     hw/hppa/trace.h
  GEN     hw/xen/trace.h
  GEN     hw/ide/trace.h
  GEN     ui/trace.h
  GEN     audio/trace.h
  GEN     net/trace.h
  GEN     target/arm/trace.h
  GEN     target/i386/trace.h
  GEN     target/mips/trace.h
  GEN     target/sparc/trace.h
  GEN     target/s390x/trace.h
  GEN     target/ppc/trace.h
  GEN     qom/trace.h
  GEN     linux-user/trace.h
  GEN     qapi/trace.h
  GEN     accel/tcg/trace.h
  GEN     accel/kvm/trace.h
  GEN     nbd/trace.h
  GEN     scsi/trace.h
  GEN     trace-root.c
  GEN     util/trace.c
  GEN     crypto/trace.c
  GEN     io/trace.c
  GEN     migration/trace.c
  GEN     block/trace.c
  GEN     chardev/trace.c
  GEN     hw/block/trace.c
  GEN     hw/block/dataplane/trace.c
  GEN     hw/char/trace.c
  GEN     hw/intc/trace.c
  GEN     hw/net/trace.c
  GEN     hw/virtio/trace.c
  GEN     hw/audio/trace.c
  GEN     hw/misc/trace.c
  GEN     hw/usb/trace.c
  GEN     hw/scsi/trace.c
  GEN     hw/nvram/trace.c
  GEN     hw/display/trace.c
  GEN     hw/input/trace.c
  GEN     hw/timer/trace.c
  GEN     hw/dma/trace.c
  GEN     hw/sparc/trace.c
  GEN     hw/sparc64/trace.c
  GEN     hw/sd/trace.c
  GEN     hw/isa/trace.c
  GEN     hw/mem/trace.c
  GEN     hw/i386/trace.c
  GEN     hw/i386/xen/trace.c
  GEN     hw/9pfs/trace.c
  GEN     hw/ppc/trace.c
  GEN     hw/pci/trace.c
  GEN     hw/pci-host/trace.c
  GEN     hw/s390x/trace.c
  GEN     hw/vfio/trace.c
  GEN     hw/acpi/trace.c
  GEN     hw/arm/trace.c
  GEN     hw/alpha/trace.c
  GEN     hw/hppa/trace.c
  GEN     hw/xen/trace.c
  GEN     hw/ide/trace.c
  GEN     ui/trace.c
  GEN     audio/trace.c
  GEN     net/trace.c
  GEN     target/arm/trace.c
  GEN     target/i386/trace.c
  GEN     target/mips/trace.c
  GEN     target/sparc/trace.c
  GEN     target/s390x/trace.c
  GEN     target/ppc/trace.c
  GEN     qom/trace.c
  GEN     linux-user/trace.c
  GEN     qapi/trace.c
  GEN     accel/tcg/trace.c
  GEN     accel/kvm/trace.c
  GEN     nbd/trace.c
  GEN     scsi/trace.c
  GEN     config-all-devices.mak
  GEN     ui/input-keymap-atset1-to-qcode.c
  GEN     ui/input-keymap-linux-to-qcode.c
  GEN     ui/input-keymap-qcode-to-atset1.c
  GEN     ui/input-keymap-qcode-to-atset2.c
  GEN     ui/input-keymap-qcode-to-atset3.c
  GEN     ui/input-keymap-qcode-to-linux.c
  GEN     ui/input-keymap-qcode-to-qnum.c
  GEN     ui/input-keymap-qcode-to-sun.c
  GEN     ui/input-keymap-qnum-to-qcode.c
  GEN     ui/input-keymap-usb-to-qcode.c
  GEN     ui/input-keymap-win32-to-qcode.c
  GEN     ui/input-keymap-x11-to-qcode.c
  GEN     ui/input-keymap-xorgevdev-to-qcode.c
  CC      cs.o
  GEN     ui/input-keymap-xorgkbd-to-qcode.c
  GEN     ui/input-keymap-xorgxquartz-to-qcode.c
  CC      SStream.o
  CC      utils.o
  GEN     ui/input-keymap-xorgxwin-to-qcode.c
  CC      MCRegisterInfo.o
  CC      MCInstrDesc.o
  CC      arch/ARM/ARMDisassembler.o
  CC      arch/ARM/ARMInstPrinter.o
  CC      arch/ARM/ARMMapping.o
  CC      arch/ARM/ARMModule.o
  CC      arch/AArch64/AArch64Disassembler.o
  CC      arch/AArch64/AArch64BaseInfo.o
  CC      arch/AArch64/AArch64InstPrinter.o
  CC      arch/AArch64/AArch64Mapping.o
  CC      arch/AArch64/AArch64Module.o
  CC      arch/Mips/MipsDisassembler.o
  CC      arch/Mips/MipsMapping.o
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/dumptrees.c
  CC      arch/Mips/MipsInstPrinter.o
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/trees.S
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/testutils.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/value-labels.c
  CC      arch/Mips/MipsModule.o
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/asm_tree_dump.c
  CC      arch/PowerPC/PPCDisassembler.o
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/overlay_bad_fixup.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/truncated_property.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/subnode_iterate.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/integer-expressions.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/property_iterate.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/overlay.c
  CC      arch/PowerPC/PPCModule.o
  CC      arch/PowerPC/PPCMapping.o
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/check_path.c
  CC      arch/Sparc/SparcDisassembler.o
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/utilfdt_test.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/path_offset_aliases.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/add_subnode_with_nops.c
  CC      arch/PowerPC/PPCInstPrinter.o
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/dtbs_equal_unordered.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/incbin.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/extra-terminating-null.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/boot-cpuid.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/path-references.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/string_escapes.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/dtbs_equal_ordered.c
  CC      arch/Sparc/SparcMapping.o
  CC      arch/SystemZ/SystemZDisassembler.o
  CC      arch/Sparc/SparcInstPrinter.o
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/dtb_reverse.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/references.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/phandle_format.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/propname_escapes.c
  CC      arch/SystemZ/SystemZMapping.o
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/del_node.c
  CC      arch/Sparc/SparcModule.o
  CC      arch/SystemZ/SystemZInstPrinter.o
  CC      arch/SystemZ/SystemZModule.o
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/del_property.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/appendprop2.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/appendprop1.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/setprop.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/nopulate.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/mangle-layout.c
  CC      arch/X86/X86IntelInstPrinter.o
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/move_and_save.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/sw_tree1.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/nop_node.c
  CC      arch/X86/X86ATTInstPrinter.o
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/nop_property.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/setprop_inplace.c
  CC      arch/X86/X86Mapping.o
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/set_name.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/stringlist.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/notfound.c
  CC      arch/XCore/XCoreInstPrinter.o
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/sized_cells.c
  CC      arch/XCore/XCoreDisassembler.o
  CC      arch/X86/X86Disassembler.o
  CC      arch/X86/X86Module.o
  CC      arch/X86/X86DisassemblerDecoder.o
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/open_pack.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/get_alias.c
  CC      arch/SystemZ/SystemZMCTargetDesc.o
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/node_offset_by_compatible.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/node_check_compatible.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/addr_size_cells.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/node_offset_by_phandle.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/char_literal.c
  CC      arch/XCore/XCoreModule.o
  CC      arch/XCore/XCoreMapping.o
  CC      MCInst.o
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/rw_tree1.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/node_offset_by_prop_value.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/parent_offset.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/supernode_atdepth_offset.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/get_path.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/get_phandle.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/getprop.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/get_name.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/subnode_offset.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/path_offset.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/find_property.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/root_node.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/tests/get_mem_rsv.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/libfdt/fdt_addresses.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/libfdt/fdt_overlay.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/libfdt/fdt_empty_tree.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/libfdt/fdt_strerror.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/libfdt/fdt_sw.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/libfdt/fdt_rw.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/libfdt/fdt_ro.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/libfdt/fdt_wip.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/libfdt/fdt.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/util.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/fdtoverlay.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/fdtput.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/fdtget.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/fdtdump.c
	 LEX convert-dtsv0-lexer.lex.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/srcpos.c
	 BISON dtc-parser.tab.c
	 LEX dtc-lexer.lex.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/treesource.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/livetree.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/fstree.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/flattree.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/data.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/dtc.c
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/checks.c
	 DEP convert-dtsv0-lexer.lex.c
	 DEP dtc-parser.tab.c
	 DEP dtc-lexer.lex.c
	CHK version_gen.h
	UPD version_gen.h
	 DEP /var/tmp/patchew-tester-tmp-q3ovq1d2/src/dtc/util.c
	 CC libfdt/fdt.o
	 CC libfdt/fdt_ro.o
	 CC libfdt/fdt_wip.o
	 CC libfdt/fdt_sw.o
	 CC libfdt/fdt_rw.o
	 CC libfdt/fdt_strerror.o
	 CC libfdt/fdt_overlay.o
	 CC libfdt/fdt_empty_tree.o
	 CC libfdt/fdt_addresses.o
	 AR libfdt/libfdt.a
ar: creating libfdt/libfdt.a
a - libfdt/fdt.o
a - libfdt/fdt_ro.o
a - libfdt/fdt_wip.o
a - libfdt/fdt_sw.o
a - libfdt/fdt_rw.o
a - libfdt/fdt_strerror.o
a - libfdt/fdt_empty_tree.o
a - libfdt/fdt_addresses.o
a - libfdt/fdt_overlay.o
  AR      libcapstone.a
ar: creating /var/tmp/patchew-tester-tmp-q3ovq1d2/src/build/capstone/libcapstone.a
  CC      tests/qemu-iotests/socket_scm_helper.o
  GEN     qga/qapi-generated/qapi-gen
  CC      qapi-builtin-types.o
  CC      qapi-builtin-visit.o
  CC      qapi-types.o
  CC      qapi/qapi-types-block-core.o
  CC      qapi/qapi-types-block.o
  CC      qapi/qapi-types-char.o
  CC      qapi/qapi-types-common.o
  CC      qapi/qapi-types-crypto.o
  CC      qapi/qapi-types-introspect.o
  CC      qapi/qapi-types-migration.o
  CC      qapi/qapi-types-misc.o
  CC      qapi/qapi-types-net.o
  CC      qapi/qapi-types-rocker.o
  CC      qapi/qapi-types-run-state.o
  CC      qapi/qapi-types-sockets.o
  CC      qapi/qapi-types-tpm.o
  CC      qapi/qapi-types-trace.o
  CC      qapi/qapi-types-transaction.o
  CC      qapi/qapi-types-ui.o
  CC      qmp-introspect.o
  CC      qapi-visit.o
  CC      qapi-event.o
  CC      qapi/qapi-dealloc-visitor.o
  CC      qapi/qobject-input-visitor.o
  CC      qapi/qapi-visit-core.o
  CC      qapi/qobject-output-visitor.o
  CC      qapi/qmp-registry.o
  CC      qapi/qmp-dispatch.o
  CC      qapi/string-input-visitor.o
  CC      qapi/string-output-visitor.o
  CC      qapi/opts-visitor.o
  CC      qapi/qmp-event.o
  CC      qapi/qapi-clone-visitor.o
  CC      qapi/qapi-util.o
  CC      qobject/qnull.o
  CC      qobject/qnum.o
  CC      qobject/qstring.o
  CC      qobject/qbool.o
  CC      qobject/qlist.o
  CC      qobject/qdict.o
  CC      qobject/json-lexer.o
  CC      qobject/json-parser.o
  CC      qobject/qlit.o
  CC      qobject/qobject.o
  CC      util/osdep.o
  CC      util/cutils.o
  CC      qobject/qjson.o
  CC      trace/qmp.o
  CC      util/unicode.o
  CC      util/qemu-timer-common.o
  CC      util/bufferiszero.o
  CC      util/async.o
  CC      util/aiocb.o
  CC      util/iohandler.o
  CC      util/qemu-timer.o
  CC      util/thread-pool.o
  CC      qobject/json-streamer.o
  CC      trace/control.o
  CC      util/aio-posix.o
  CC      util/compatfd.o
  CC      util/event_notifier-posix.o
  CC      util/main-loop.o
  CC      util/lockcnt.o
  CC      util/mmap-alloc.o
  CC      util/oslib-posix.o
  CC      util/qemu-openpty.o
  CC      util/qemu-thread-posix.o
  CC      util/memfd.o
  CC      util/path.o
  CC      util/envlist.o
  CC      util/module.o
  CC      util/bitmap.o
  CC      util/host-utils.o
  CC      util/bitops.o
  CC      util/hbitmap.o
  CC      util/fifo8.o
  CC      util/acl.o
  CC      util/cacheinfo.o
  CC      util/error.o
  CC      util/qemu-error.o
  CC      util/id.o
  CC      util/qemu-config.o
  CC      util/qemu-sockets.o
  CC      util/iov.o
  CC      util/uri.o
  CC      util/notify.o
  CC      util/qemu-option.o
  CC      util/qemu-progress.o
  CC      util/keyval.o
  CC      util/hexdump.o
  CC      util/crc32c.o
  CC      util/throttle.o
  CC      util/uuid.o
  CC      util/readline.o
  CC      util/getauxval.o
  CC      util/rcu.o
  CC      util/qemu-coroutine.o
  CC      util/qemu-coroutine-lock.o
  CC      util/qemu-coroutine-sleep.o
  CC      util/qemu-coroutine-io.o
  CC      util/coroutine-ucontext.o
  CC      util/buffer.o
  CC      util/timed-average.o
  CC      util/base64.o
  CC      util/log.o
  CC      util/pagesize.o
  CC      util/qht.o
  CC      util/qdist.o
  CC      util/range.o
  CC      util/stats64.o
  CC      util/systemd.o
  CC      util/trace.o
  CC      trace-root.o
  CC      crypto/trace.o
  CC      io/trace.o
  CC      migration/trace.o
  CC      block/trace.o
  CC      chardev/trace.o
  CC      hw/block/dataplane/trace.o
  CC      hw/block/trace.o
  CC      hw/char/trace.o
  CC      hw/audio/trace.o
  CC      hw/net/trace.o
  CC      hw/intc/trace.o
  CC      hw/usb/trace.o
  CC      hw/misc/trace.o
  CC      hw/virtio/trace.o
  CC      hw/scsi/trace.o
  CC      hw/nvram/trace.o
  CC      hw/display/trace.o
  CC      hw/input/trace.o
  CC      hw/timer/trace.o
  CC      hw/dma/trace.o
  CC      hw/sparc64/trace.o
  CC      hw/sparc/trace.o
  CC      hw/isa/trace.o
  CC      hw/i386/trace.o
  CC      hw/mem/trace.o
  CC      hw/sd/trace.o
  CC      hw/i386/xen/trace.o
  CC      hw/9pfs/trace.o
  CC      hw/ppc/trace.o
  CC      hw/pci/trace.o
  CC      hw/s390x/trace.o
  CC      hw/pci-host/trace.o
  CC      hw/vfio/trace.o
  CC      hw/acpi/trace.o
  CC      hw/arm/trace.o
  CC      hw/alpha/trace.o
  CC      hw/hppa/trace.o
  CC      hw/xen/trace.o
  CC      hw/ide/trace.o
  CC      ui/trace.o
  CC      audio/trace.o
  CC      net/trace.o
  CC      target/arm/trace.o
  CC      target/i386/trace.o
  CC      target/mips/trace.o
  CC      target/sparc/trace.o
  CC      target/s390x/trace.o
  CC      target/ppc/trace.o
  CC      qom/trace.o
  CC      linux-user/trace.o
  CC      accel/tcg/trace.o
  CC      qapi/trace.o
  CC      accel/kvm/trace.o
  CC      nbd/trace.o
  CC      scsi/trace.o
  CC      crypto/pbkdf-stub.o
  CC      stubs/arch-query-cpu-def.o
  CC      stubs/arch-query-cpu-model-expansion.o
  CC      stubs/arch-query-cpu-model-comparison.o
  CC      stubs/arch-query-cpu-model-baseline.o
  CC      stubs/bdrv-next-monitor-owned.o
  CC      stubs/blk-commit-all.o
  CC      stubs/blockdev-close-all-bdrv-states.o
  CC      stubs/clock-warp.o
  CC      stubs/cpu-get-icount.o
  CC      stubs/cpu-get-clock.o
  CC      stubs/dump.o
  CC      stubs/error-printf.o
  CC      stubs/fdset.o
  CC      stubs/gdbstub.o
  CC      stubs/get-vm-name.o
  CC      stubs/iothread.o
  CC      stubs/linux-aio.o
  CC      stubs/iothread-lock.o
  CC      stubs/is-daemonized.o
  CC      stubs/machine-init-done.o
  CC      stubs/change-state-handler.o
  CC      stubs/monitor.o
  CC      stubs/migr-blocker.o
  CC      stubs/notify-event.o
  CC      stubs/qtest.o
  CC      stubs/replay.o
  CC      stubs/runstate-check.o
  CC      stubs/slirp.o
  CC      stubs/sysbus.o
  CC      stubs/tpm.o
  CC      stubs/set-fd-handler.o
  CC      stubs/trace-control.o
  CC      stubs/uuid.o
  CC      stubs/vm-stop.o
  CC      stubs/vmstate.o
  CC      stubs/qmp_pc_dimm.o
  CC      stubs/target-monitor-defs.o
  CC      stubs/pc_madt_cpu_entry.o
  CC      stubs/target-get-monitor-def.o
  CC      stubs/vmgenid.o
  CC      stubs/xen-common.o
  CC      stubs/pci-host-piix.o
  CC      stubs/xen-hvm.o
  CC      contrib/ivshmem-client/ivshmem-client.o
  CC      contrib/ivshmem-client/main.o
  CC      contrib/ivshmem-server/ivshmem-server.o
  CC      contrib/ivshmem-server/main.o
  CC      qemu-nbd.o
  CC      block.o
  CC      blockjob.o
  CC      qemu-io-cmds.o
  CC      replication.o
  CC      block/raw-format.o
  CC      block/qcow.o
  CC      block/vdi.o
  CC      block/vmdk.o
  CC      block/cloop.o
  CC      block/bochs.o
  CC      block/vpc.o
  CC      block/vvfat.o
  CC      block/qcow2.o
  CC      block/qcow2-refcount.o
  CC      block/qcow2-cluster.o
  CC      block/qcow2-snapshot.o
  CC      block/dmg.o
  CC      block/qcow2-cache.o
  CC      block/qcow2-bitmap.o
  CC      block/qed.o
  CC      block/qed-l2-cache.o
  CC      block/qed-table.o
  CC      block/qed-cluster.o
  CC      block/qed-check.o
  CC      block/vhdx-endian.o
  CC      block/vhdx.o
  CC      block/vhdx-log.o
  CC      block/quorum.o
  CC      block/parallels.o
  CC      block/blkdebug.o
  CC      block/blkverify.o
  CC      block/blkreplay.o
  CC      block/block-backend.o
In file included from /var/tmp/patchew-tester-tmp-q3ovq1d2/src/block.c:29:0:
/var/tmp/patchew-tester-tmp-q3ovq1d2/src/include/block/nbd.h:262:40: error: unknown type name ‘NbdServerRemoveMode’
 void nbd_export_remove(NBDExport *exp, NbdServerRemoveMode mode, Error **errp);
                                        ^
  CC      block/qapi.o
  CC      block/snapshot.o
  CC      block/linux-aio.o
  CC      block/mirror.o
  CC      block/null.o
  CC      block/commit.o
  CC      block/file-posix.o
  CC      block/io.o
  CC      block/throttle-groups.o
  CC      block/nbd.o
  CC      block/nbd-client.o
  CC      block/sheepdog.o
  CC      block/dirty-bitmap.o
  CC      block/accounting.o
  CC      block/write-threshold.o
  CC      block/backup.o
  CC      block/replication.o
  CC      block/throttle.o
  CC      block/crypto.o
  CC      nbd/common.o
  CC      scsi/utils.o
  CC      nbd/server.o
In file included from /var/tmp/patchew-tester-tmp-q3ovq1d2/src/qemu-nbd.c:28:0:
/var/tmp/patchew-tester-tmp-q3ovq1d2/src/include/block/nbd.h:262:40: error: unknown type name ‘NbdServerRemoveMode’
 void nbd_export_remove(NBDExport *exp, NbdServerRemoveMode mode, Error **errp);
                                        ^
  CC      nbd/client.o
  CC      scsi/pr-manager.o
  CC      scsi/pr-manager-helper.o
  CC      block/curl.o
  CC      block/dmg-bz2.o
  CC      crypto/init.o
  CC      crypto/hash.o
  CC      crypto/hash-nettle.o
make: *** [block.o] Error 1
make: *** Waiting for unfinished jobs....
make: *** [qemu-nbd.o] Error 1
In file included from /var/tmp/patchew-tester-tmp-q3ovq1d2/src/nbd/nbd-internal.h:12:0,
                 from /var/tmp/patchew-tester-tmp-q3ovq1d2/src/nbd/server.c:23:
/var/tmp/patchew-tester-tmp-q3ovq1d2/src/include/block/nbd.h:262:40: error: unknown type name ‘NbdServerRemoveMode’
 void nbd_export_remove(NBDExport *exp, NbdServerRemoveMode mode, Error **errp);
                                        ^
/var/tmp/patchew-tester-tmp-q3ovq1d2/src/nbd/server.c:1180:40: error: unknown type name ‘NbdServerRemoveMode’
 void nbd_export_remove(NBDExport *exp, NbdServerRemoveMode mode, Error **errp)
                                        ^
make: *** [nbd/server.o] Error 1
In file included from /var/tmp/patchew-tester-tmp-q3ovq1d2/src/nbd/nbd-internal.h:12:0,
                 from /var/tmp/patchew-tester-tmp-q3ovq1d2/src/nbd/client.c:23:
/var/tmp/patchew-tester-tmp-q3ovq1d2/src/include/block/nbd.h:262:40: error: unknown type name ‘NbdServerRemoveMode’
 void nbd_export_remove(NBDExport *exp, NbdServerRemoveMode mode, Error **errp);
                                        ^
In file included from /var/tmp/patchew-tester-tmp-q3ovq1d2/src/block/nbd-client.h:5:0,
                 from /var/tmp/patchew-tester-tmp-q3ovq1d2/src/block/nbd-client.c:32:
/var/tmp/patchew-tester-tmp-q3ovq1d2/src/include/block/nbd.h:262:40: error: unknown type name ‘NbdServerRemoveMode’
 void nbd_export_remove(NBDExport *exp, NbdServerRemoveMode mode, Error **errp);
                                        ^
make: *** [nbd/client.o] Error 1
In file included from /var/tmp/patchew-tester-tmp-q3ovq1d2/src/block/nbd-client.h:5:0,
                 from /var/tmp/patchew-tester-tmp-q3ovq1d2/src/block/nbd.c:30:
/var/tmp/patchew-tester-tmp-q3ovq1d2/src/include/block/nbd.h:262:40: error: unknown type name ‘NbdServerRemoveMode’
 void nbd_export_remove(NBDExport *exp, NbdServerRemoveMode mode, Error **errp);
                                        ^
make: *** [block/nbd-client.o] Error 1
In file included from /var/tmp/patchew-tester-tmp-q3ovq1d2/src/block/replication.c:17:0:
/var/tmp/patchew-tester-tmp-q3ovq1d2/src/include/block/nbd.h:262:40: error: unknown type name ‘NbdServerRemoveMode’
 void nbd_export_remove(NBDExport *exp, NbdServerRemoveMode mode, Error **errp);
                                        ^
make: *** [block/nbd.o] Error 1
make: *** [block/replication.o] Error 1
In file included from /var/tmp/patchew-tester-tmp-q3ovq1d2/src/nbd/nbd-internal.h:12:0,
                 from /var/tmp/patchew-tester-tmp-q3ovq1d2/src/nbd/common.c:21:
/var/tmp/patchew-tester-tmp-q3ovq1d2/src/include/block/nbd.h:262:40: error: unknown type name ‘NbdServerRemoveMode’
 void nbd_export_remove(NBDExport *exp, NbdServerRemoveMode mode, Error **errp);
                                        ^
make: *** [nbd/common.o] Error 1
=== OUTPUT END ===

Test command exited with code: 2


---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@freelists.org

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 08/21] qapi: Touch generated files only when they change
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 08/21] qapi: Touch generated files only when they change Markus Armbruster
@ 2018-02-02 19:42   ` Eric Blake
  2018-02-03  9:05     ` Markus Armbruster
  0 siblings, 1 reply; 87+ messages in thread
From: Eric Blake @ 2018-02-02 19:42 UTC (permalink / raw)
  To: Markus Armbruster, qemu-devel; +Cc: marcandre.lureau, mdroth

[-- Attachment #1: Type: text/plain, Size: 2557 bytes --]

On 02/02/2018 07:03 AM, Markus Armbruster wrote:
> A massive number of objects depends on QAPI-generated headers.  In my
> "build everything" tree, it's roughly 4500 out of 4800.  This is
> particularly annoying when only some of the generated files change,
> say for a doc fix.
> 
> Improve qapi-gen.py to touch its output files only if they actually
> change.  Rebuild time for a QAPI doc fix drops from many minutes to a
> few seconds.  Rebuilds get faster for certain code changes, too.  For
> instance, adding a simple QMP event now recompiles less than 200
> instead of 4500 objects.  But adding a QAPI type is as bad as ever; we
> clearly got more work to do.

The last phrase sounds quite colloquial.  It may have been intentional;
but if not, s/we/we've/

> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  scripts/qapi/common.py | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py
> index cfa2671ca3..be0fcc548a 100644
> --- a/scripts/qapi/common.py
> +++ b/scripts/qapi/common.py
> @@ -1944,9 +1944,16 @@ class QAPIGen(object):
>              except os.error as e:
>                  if e.errno != errno.EEXIST:
>                      raise
> -        f = open(os.path.join(output_dir, fname), 'w')
> -        f.write(self.top(fname) + self._preamble + self._body
> +        fd = os.open(os.path.join(output_dir, fname),
> +                     os.O_RDWR | os.O_CREAT, 0666)
> +        f = os.fdopen(fd, 'r+')
> +        text = (self.top(fname) + self._preamble + self._body
>                  + self.bottom(fname))
> +        oldtext = f.read(len(text) + 1)
> +        if text != oldtext:
> +            f.seek(0)
> +            f.truncate(0)
> +            f.write(text)

In-memory rewrite rather than playing games with a secondary file
combined with the rename(2) syscall.  It means you're not atomic (an
external reader has a window of time where they can see an incomplete
version of the file).  But I think make dependency rules mean we don't
care - even in a parallel rule, as long as all clients depend on the
timestamp file, and the timestamp file isn't updated until all our
rewrites (if any) have settled, then we don't create any of those
external readers that can find the window of incomplete contents.

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code
  2018-02-02 13:03 [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code Markus Armbruster
                   ` (24 preceding siblings ...)
  2018-02-02 19:33 ` no-reply
@ 2018-02-02 20:11 ` no-reply
  2018-02-02 21:13 ` no-reply
                   ` (2 subsequent siblings)
  28 siblings, 0 replies; 87+ messages in thread
From: no-reply @ 2018-02-02 20:11 UTC (permalink / raw)
  To: armbru; +Cc: famz, qemu-devel, marcandre.lureau, mdroth

Hi,

This series failed build test on s390x host. Please find the details below.

Type: series
Message-id: 20180202130336.24719-1-armbru@redhat.com
Subject: [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code

=== TEST SCRIPT BEGIN ===
#!/bin/bash
# Testing script will be invoked under the git checkout with
# HEAD pointing to a commit that has the patches applied on top of "base"
# branch
set -e
echo "=== ENV ==="
env
echo "=== PACKAGES ==="
rpm -qa
echo "=== TEST BEGIN ==="
CC=$HOME/bin/cc
INSTALL=$PWD/install
BUILD=$PWD/build
echo -n "Using CC: "
realpath $CC
mkdir -p $BUILD $INSTALL
SRC=$PWD
cd $BUILD
$SRC/configure --cc=$CC --prefix=$INSTALL
make -j4
# XXX: we need reliable clean up
# make check -j4 V=1
make install
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
Switched to a new branch 'test'
20edfbb769 qapi: Empty out qapi-schema.json
908a02511e Include less of qapi-types.h
cc0f486390 qapi/types: Generate separate .h, .c for each module
da8bb99aca qapi/common: Fix guardname() for funny filenames
c8a5aa0179 qapi/types qapi/visit: Generate built-in stuff into separate files
799da1022d qapi/types qapi/visit: Make visitors use QAPIGen more
1755f6ed36 qapi: Record 'include' directives in intermediate representation
4e1183baa6 qapi: Generate in source order
b9771d2e65 qapi: Record 'include' directives in parse tree
656629e139 qapi: Concentrate QAPISchemaParser.exprs updates in .__init__()
1bc777d460 qapi: Lift error reporting from QAPISchema.__init__() to callers
c531a76a97 qapi/common: Eliminate QAPISchema.exprs
7f7062dc58 qapi: Don't absolutize include file name in error messages
bd75734a2c qapi: Touch generated files only when they change
a4e94e3e75 qapi: Move parse_command_line() next to its only use
b9b12fa6c6 qapi-gen: New common driver for code and doc generators
3a56fc45c2 qapi: Turn generators into modules
c09593eb74 qapi: Reduce use of global variables in generators some
4e457ceed8 qapi: New classes QAPIGenC, QAPIGenH, QAPIGenDoc
d969856a53 qapi: Generate up-to-date copyright notice
a295c600fc qapi: Streamline boilerplate comment generation

=== OUTPUT BEGIN ===
=== ENV ===
LANG=en_US.UTF-8
XDG_SESSION_ID=38971
USER=fam
PWD=/var/tmp/patchew-tester-tmp-0t3s9f7b/src
HOME=/home/fam
SHELL=/bin/sh
SHLVL=2
PATCHEW=/home/fam/patchew/patchew-cli -s http://patchew.org --nodebug
LOGNAME=fam
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1012/bus
XDG_RUNTIME_DIR=/run/user/1012
PATH=/usr/bin:/bin
_=/usr/bin/env
=== PACKAGES ===
gpg-pubkey-873529b8-54e386ff
glibc-debuginfo-common-2.24-10.fc25.s390x
fedora-release-26-1.noarch
dejavu-sans-mono-fonts-2.35-4.fc26.noarch
xemacs-filesystem-21.5.34-22.20170124hgf412e9f093d4.fc26.noarch
bash-4.4.12-7.fc26.s390x
freetype-2.7.1-9.fc26.s390x
libSM-1.2.2-5.fc26.s390x
libmpc-1.0.2-6.fc26.s390x
libaio-0.3.110-7.fc26.s390x
libverto-0.2.6-7.fc26.s390x
perl-Scalar-List-Utils-1.48-1.fc26.s390x
iptables-libs-1.6.1-2.fc26.s390x
perl-threads-shared-1.57-1.fc26.s390x
p11-kit-trust-0.23.9-2.fc26.s390x
tcl-8.6.6-2.fc26.s390x
libxshmfence-1.2-4.fc26.s390x
expect-5.45-23.fc26.s390x
perl-Thread-Queue-3.12-1.fc26.noarch
perl-encoding-2.19-6.fc26.s390x
keyutils-1.5.10-1.fc26.s390x
gmp-devel-6.1.2-4.fc26.s390x
enchant-1.6.0-16.fc26.s390x
net-snmp-libs-5.7.3-17.fc26.s390x
python-gobject-base-3.24.1-1.fc26.s390x
python3-distro-1.0.3-1.fc26.noarch
python3-enchant-1.6.10-1.fc26.noarch
python-lockfile-0.11.0-6.fc26.noarch
python2-pyparsing-2.1.10-3.fc26.noarch
python2-lxml-4.1.1-1.fc26.s390x
librados2-10.2.7-2.fc26.s390x
trousers-lib-0.3.13-7.fc26.s390x
libpaper-1.1.24-14.fc26.s390x
libdatrie-0.2.9-4.fc26.s390x
libsoup-2.58.2-1.fc26.s390x
passwd-0.79-9.fc26.s390x
bind99-libs-9.9.10-3.P3.fc26.s390x
python3-rpm-4.13.0.2-1.fc26.s390x
mock-core-configs-27.4-1.fc26.noarch
systemd-233-7.fc26.s390x
virglrenderer-0.6.0-1.20170210git76b3da97b.fc26.s390x
s390utils-ziomon-1.36.1-3.fc26.s390x
s390utils-osasnmpd-1.36.1-3.fc26.s390x
libXrandr-1.5.1-2.fc26.s390x
libglvnd-glx-1.0.0-1.fc26.s390x
texlive-ifxetex-svn19685.0.5-33.fc26.2.noarch
texlive-psnfss-svn33946.9.2a-33.fc26.2.noarch
texlive-dvipdfmx-def-svn40328-33.fc26.2.noarch
texlive-natbib-svn20668.8.31b-33.fc26.2.noarch
texlive-xdvi-bin-svn40750-33.20160520.fc26.2.s390x
texlive-cm-svn32865.0-33.fc26.2.noarch
texlive-beton-svn15878.0-33.fc26.2.noarch
texlive-fpl-svn15878.1.002-33.fc26.2.noarch
texlive-mflogo-svn38628-33.fc26.2.noarch
texlive-texlive-docindex-svn41430-33.fc26.2.noarch
texlive-luaotfload-bin-svn34647.0-33.20160520.fc26.2.noarch
texlive-koma-script-svn41508-33.fc26.2.noarch
texlive-pst-tree-svn24142.1.12-33.fc26.2.noarch
texlive-breqn-svn38099.0.98d-33.fc26.2.noarch
texlive-xetex-svn41438-33.fc26.2.noarch
gstreamer1-plugins-bad-free-1.12.3-1.fc26.s390x
xorg-x11-font-utils-7.5-33.fc26.s390x
ghostscript-fonts-5.50-36.fc26.noarch
libXext-devel-1.3.3-5.fc26.s390x
libusbx-devel-1.0.21-2.fc26.s390x
libglvnd-devel-1.0.0-1.fc26.s390x
emacs-25.3-3.fc26.s390x
alsa-lib-devel-1.1.4.1-1.fc26.s390x
kbd-2.0.4-2.fc26.s390x
dconf-0.26.0-2.fc26.s390x
ccache-3.3.4-1.fc26.s390x
glibc-static-2.25-12.fc26.s390x
mc-4.8.19-5.fc26.s390x
doxygen-1.8.13-9.fc26.s390x
dpkg-1.18.24-1.fc26.s390x
libtdb-1.3.13-1.fc26.s390x
python2-pynacl-1.1.1-1.fc26.s390x
nss-sysinit-3.34.0-1.0.fc26.s390x
kernel-4.13.16-202.fc26.s390x
perl-Filter-1.58-1.fc26.s390x
python2-pip-9.0.1-11.fc26.noarch
dnf-2.7.5-2.fc26.noarch
pcre2-utf16-10.23-11.fc26.s390x
glusterfs-devel-3.10.8-1.fc26.s390x
sssd-common-1.16.0-4.fc26.s390x
python2-sssdconfig-1.16.0-4.fc26.noarch
acpica-tools-20171110-1.fc26.s390x
glibc-debuginfo-2.24-10.fc25.s390x
fedora-repos-26-1.noarch
dejavu-fonts-common-2.35-4.fc26.noarch
bind99-license-9.9.10-3.P3.fc26.noarch
ncurses-libs-6.0-8.20170212.fc26.s390x
libpng-1.6.28-2.fc26.s390x
libICE-1.0.9-9.fc26.s390x
kmod-24-1.fc26.s390x
libseccomp-2.3.2-1.fc26.s390x
perl-Text-ParseWords-3.30-366.fc26.noarch
libtool-ltdl-2.4.6-17.fc26.s390x
perl-threads-2.16-1.fc26.s390x
libselinux-utils-2.6-7.fc26.s390x
userspace-rcu-0.9.3-2.fc26.s390x
libXfont-1.5.2-5.fc26.s390x
perl-Class-Inspector-1.31-3.fc26.noarch
perl-open-1.10-395.fc26.noarch
keyutils-libs-devel-1.5.10-1.fc26.s390x
isl-0.16.1-1.fc26.s390x
libsecret-0.18.5-3.fc26.s390x
compat-openssl10-1.0.2m-1.fc26.s390x
python3-iniparse-0.4-24.fc26.noarch
python3-dateutil-2.6.0-3.fc26.noarch
python3-firewall-0.4.4.5-1.fc26.noarch
python-enum34-1.1.6-1.fc26.noarch
python2-pygments-2.2.0-7.fc26.noarch
python2-dockerfile-parse-0.0.7-1.fc26.noarch
perl-Net-SSLeay-1.81-1.fc26.s390x
hostname-3.18-2.fc26.s390x
libtirpc-1.0.2-0.fc26.s390x
rpm-build-libs-4.13.0.2-1.fc26.s390x
libutempter-1.1.6-9.fc26.s390x
systemd-pam-233-7.fc26.s390x
pcre-utf16-8.41-3.fc26.s390x
libXinerama-1.1.3-7.fc26.s390x
mesa-libGL-17.2.4-2.fc26.s390x
texlive-amsfonts-svn29208.3.04-33.fc26.2.noarch
texlive-caption-svn41409-33.fc26.2.noarch
texlive-enumitem-svn24146.3.5.2-33.fc26.2.noarch
texlive-pdftex-def-svn22653.0.06d-33.fc26.2.noarch
texlive-xdvi-svn40768-33.fc26.2.noarch
texlive-courier-svn35058.0-33.fc26.2.noarch
texlive-charter-svn15878.0-33.fc26.2.noarch
texlive-graphics-def-svn41879-33.fc26.2.noarch
texlive-mfnfss-svn19410.0-33.fc26.2.noarch
texlive-texlive-en-svn41185-33.fc26.2.noarch
texlive-ifplatform-svn21156.0.4-33.fc26.2.noarch
texlive-ms-svn29849.0-33.fc26.2.noarch
texlive-pst-tools-svn34067.0.05-33.fc26.2.noarch
texlive-powerdot-svn38984-33.fc26.2.noarch
texlive-xetexconfig-svn41133-33.fc26.2.noarch
libvdpau-1.1.1-4.fc26.s390x
zlib-devel-1.2.11-2.fc26.s390x
gdk-pixbuf2-devel-2.36.9-1.fc26.s390x
libX11-devel-1.6.5-2.fc26.s390x
libtasn1-devel-4.12-1.fc26.s390x
libglvnd-core-devel-1.0.0-1.fc26.s390x
SDL2-devel-2.0.7-2.fc26.s390x
webkitgtk3-2.4.11-5.fc26.s390x
grubby-8.40-4.fc26.s390x
uboot-tools-2017.05-4.fc26.s390x
cracklib-dicts-2.9.6-5.fc26.s390x
texinfo-6.3-3.fc26.s390x
time-1.7-52.fc26.s390x
python2-deltarpm-3.6-19.fc26.s390x
nss-3.34.0-1.0.fc26.s390x
webkitgtk4-2.18.3-1.fc26.s390x
net-tools-2.0-0.43.20160912git.fc26.s390x
python2-setuptools-37.0.0-1.fc26.noarch
python2-dnf-2.7.5-2.fc26.noarch
pcre2-10.23-11.fc26.s390x
groff-base-1.22.3-10.fc26.s390x
python2-devel-2.7.14-4.fc26.s390x
python2-GitPython-2.1.7-2.fc26.noarch
boost-iostreams-1.63.0-10.fc26.s390x
gpg-pubkey-efe550f5-5220ba41
gpg-pubkey-81b46521-55b3ca9a
filesystem-3.2-40.fc26.s390x
basesystem-11-3.fc26.noarch
js-jquery-3.2.1-1.fc26.noarch
pcre-8.41-3.fc26.s390x
elfutils-libelf-0.169-1.fc26.s390x
libidn-1.33-2.fc26.s390x
libogg-1.3.2-6.fc26.s390x
slang-2.3.1a-2.fc26.s390x
apr-1.6.3-1.fc26.s390x
libxkbcommon-0.7.1-3.fc26.s390x
perl-IO-1.36-395.fc26.s390x
libvorbis-1.3.5-2.fc26.s390x
less-487-3.fc26.s390x
lttng-ust-2.9.0-2.fc26.s390x
OpenEXR-libs-2.2.0-6.fc26.s390x
ipset-libs-6.29-3.fc26.s390x
perl-XML-XPath-1.42-1.fc26.noarch
lua-filesystem-1.6.3-3.fc24.s390x
sqlite-3.20.1-1.fc26.s390x
gstreamer1-1.12.3-1.fc26.s390x
libpwquality-1.3.0-8.fc26.s390x
gettext-libs-0.19.8.1-9.fc26.s390x
python3-chardet-2.3.0-3.fc26.noarch
python3-slip-dbus-0.6.4-6.fc26.noarch
python-chardet-2.3.0-3.fc26.noarch
python2-pyasn1-0.2.3-1.fc26.noarch
python-slip-dbus-0.6.4-6.fc26.noarch
libarchive-3.2.2-4.fc26.s390x
libbabeltrace-1.5.2-2.fc26.s390x
cdparanoia-libs-10.2-22.fc26.s390x
krb5-workstation-1.15.2-4.fc26.s390x
python3-requests-kerberos-0.10.0-4.fc26.noarch
gpgme-1.8.0-12.fc26.s390x
python2-gpg-1.8.0-12.fc26.s390x
shadow-utils-4.3.1-3.fc26.s390x
cryptsetup-libs-1.7.5-1.fc26.s390x
kpartx-0.4.9-88.fc26.s390x
net-snmp-agent-libs-5.7.3-17.fc26.s390x
libXi-1.7.9-2.fc26.s390x
texlive-tetex-svn41059-33.fc26.2.noarch
texlive-tools-svn40934-33.fc26.2.noarch
texlive-bibtex-bin-svn40473-33.20160520.fc26.2.s390x
texlive-mfware-bin-svn40473-33.20160520.fc26.2.s390x
texlive-underscore-svn18261.0-33.fc26.2.noarch
texlive-avantgar-svn31835.0-33.fc26.2.noarch
texlive-anysize-svn15878.0-33.fc26.2.noarch
texlive-lineno-svn21442.4.41-33.fc26.2.noarch
texlive-mathpazo-svn15878.1.003-33.fc26.2.noarch
texlive-soul-svn15878.2.4-33.fc26.2.noarch
texlive-luatexbase-svn38550-33.fc26.2.noarch
texlive-listings-svn37534.1.6-33.fc26.2.noarch
texlive-pstricks-svn41321-33.fc26.2.noarch
texlive-metalogo-svn18611.0.12-33.fc26.2.noarch
texlive-dvipdfmx-svn41149-33.fc26.2.noarch
kbd-legacy-2.0.4-2.fc26.noarch
nspr-devel-4.17.0-1.fc26.s390x
ghostscript-x11-9.20-10.fc26.s390x
libXrender-devel-0.9.10-2.fc26.s390x
libxkbcommon-devel-0.7.1-3.fc26.s390x
mesa-libGL-devel-17.2.4-2.fc26.s390x
sqlite-devel-3.20.1-1.fc26.s390x
usbredir-devel-0.7.1-3.fc26.s390x
libcap-devel-2.25-5.fc26.s390x
brlapi-devel-0.6.6-5.fc26.s390x
fedora-upgrade-27.1-1.fc26.noarch
python3-pygpgme-0.3-22.fc26.s390x
pinentry-0.9.7-3.fc26.s390x
perl-Test-Harness-3.39-1.fc26.noarch
qemu-sanity-check-nodeps-1.1.5-6.fc26.s390x
libldb-1.1.29-5.fc26.s390x
python-libxml2-2.9.4-2.fc26.s390x
nss-util-devel-3.34.0-1.0.fc26.s390x
vim-filesystem-8.0.1360-1.fc26.s390x
webkitgtk4-plugin-process-gtk2-2.18.3-1.fc26.s390x
python2-2.7.14-4.fc26.s390x
libwayland-cursor-1.13.0-3.fc26.s390x
mariadb-config-10.1.29-1.fc26.s390x
gdb-headless-8.0.1-33.fc26.s390x
pulseaudio-libs-devel-11.1-7.fc26.s390x
curl-7.53.1-13.fc26.s390x
json-c-0.12.1-5.fc26.s390x
gpg-pubkey-34ec9cba-54e38751
gpg-pubkey-030d5aed-55b577f0
setup-2.10.5-2.fc26.noarch
lato-fonts-2.015-3.fc26.noarch
web-assets-filesystem-5-5.fc26.noarch
libsepol-2.6-2.fc26.s390x
libcap-2.25-5.fc26.s390x
tcp_wrappers-libs-7.6-85.fc26.s390x
libnl3-3.3.0-1.fc26.s390x
pixman-0.34.0-3.fc26.s390x
lzo-2.08-9.fc26.s390x
perl-5.24.3-395.fc26.s390x
libnl3-cli-3.3.0-1.fc26.s390x
gpm-libs-1.20.7-10.fc26.s390x
libgo-7.2.1-2.fc26.s390x
iso-codes-3.74-2.fc26.noarch
ipset-6.29-3.fc26.s390x
lua-term-0.07-1.fc25.s390x
libdb-utils-5.3.28-24.fc26.s390x
system-python-libs-3.6.3-2.fc26.s390x
dbus-glib-0.108-2.fc26.s390x
pam-1.3.0-2.fc26.s390x
avahi-glib-0.6.32-7.fc26.s390x
python2-dateutil-2.6.0-3.fc26.noarch
python3-asn1crypto-0.23.0-1.fc26.noarch
python3-slip-0.6.4-6.fc26.noarch
python-backports-ssl_match_hostname-3.5.0.1-4.fc26.noarch
python2-pyOpenSSL-16.2.0-6.fc26.noarch
python-slip-0.6.4-6.fc26.noarch
nss-pem-1.0.3-3.fc26.s390x
fipscheck-1.5.0-1.fc26.s390x
elfutils-0.169-1.fc26.s390x
cyrus-sasl-lib-2.1.26-32.fc26.s390x
libkadm5-1.15.2-4.fc26.s390x
python3-kerberos-1.2.5-3.fc26.s390x
rpmconf-1.0.19-1.fc26.noarch
libsemanage-2.6-4.fc26.s390x
device-mapper-libs-1.02.137-6.fc26.s390x
yum-3.4.3-512.fc26.noarch
device-mapper-multipath-0.4.9-88.fc26.s390x
net-snmp-5.7.3-17.fc26.s390x
libXtst-1.2.3-2.fc26.s390x
libXxf86vm-1.1.4-4.fc26.s390x
texlive-amsmath-svn41561-33.fc26.2.noarch
texlive-xkeyval-svn35741.2.7a-33.fc26.2.noarch
texlive-bibtex-svn40768-33.fc26.2.noarch
texlive-mfware-svn40768-33.fc26.2.noarch
texlive-wasy-svn35831.0-33.fc26.2.noarch
texlive-bookman-svn31835.0-33.fc26.2.noarch
texlive-babel-english-svn30264.3.3p-33.fc26.2.noarch
texlive-fix2col-svn38770-33.fc26.2.noarch
texlive-mdwtools-svn15878.1.05.4-33.fc26.2.noarch
texlive-tex-gyre-math-svn41264-33.fc26.2.noarch
texlive-luaotfload-svn40902-33.fc26.2.noarch
texlive-showexpl-svn32737.v0.3l-33.fc26.2.noarch
texlive-pstricks-add-svn40744-33.fc26.2.noarch
texlive-l3experimental-svn41163-33.fc26.2.noarch
texlive-xetex-bin-svn41091-33.20160520.fc26.2.s390x
kbd-misc-2.0.4-2.fc26.noarch
libpng-devel-1.6.28-2.fc26.s390x
ghostscript-core-9.20-10.fc26.s390x
libXfixes-devel-5.0.3-2.fc26.s390x
libverto-devel-0.2.6-7.fc26.s390x
mesa-libEGL-devel-17.2.4-2.fc26.s390x
popt-devel-1.16-12.fc26.s390x
readline-devel-7.0-5.fc26.s390x
cyrus-sasl-devel-2.1.26-32.fc26.s390x
sendmail-8.15.2-19.fc26.s390x
systemd-bootchart-231-3.fc26.s390x
perl-IO-Socket-SSL-2.049-1.fc26.noarch
python2-enchant-1.6.10-1.fc26.noarch
perl-generators-1.10-2.fc26.noarch
createrepo-0.10.3-11.fc26.noarch
webkitgtk4-jsc-2.18.3-1.fc26.s390x
vim-common-8.0.1360-1.fc26.s390x
nss-tools-3.34.0-1.0.fc26.s390x
glusterfs-api-3.10.8-1.fc26.s390x
pulseaudio-libs-glib2-11.1-7.fc26.s390x
mariadb-common-10.1.29-1.fc26.s390x
dhcp-libs-4.3.5-10.fc26.s390x
pcre2-devel-10.23-11.fc26.s390x
libtiff-4.0.9-1.fc26.s390x
kernel-headers-4.14.8-200.fc26.s390x
fontpackages-filesystem-1.44-18.fc26.noarch
vte-profile-0.48.4-1.fc26.s390x
texlive-kpathsea-doc-svn41139-33.fc26.2.noarch
zlib-1.2.11-2.fc26.s390x
readline-7.0-5.fc26.s390x
libattr-2.4.47-18.fc26.s390x
libgomp-7.2.1-2.fc26.s390x
libglvnd-1.0.0-1.fc26.s390x
lz4-libs-1.8.0-1.fc26.s390x
libcrypt-nss-2.25-12.fc26.s390x
jansson-2.10-2.fc26.s390x
perl-File-Path-2.12-367.fc26.noarch
perl-Unicode-EastAsianWidth-1.33-9.fc26.noarch
hunspell-1.5.4-2.fc26.s390x
libasyncns-0.8-11.fc26.s390x
libnetfilter_conntrack-1.0.6-2.fc26.s390x
perl-Storable-2.56-368.fc26.s390x
autoconf-2.69-24.fc26.noarch
device-mapper-persistent-data-0.6.3-5.fc26.s390x
quota-4.03-9.fc26.s390x
crypto-policies-20170606-1.git7c32281.fc26.noarch
glib2-2.52.3-2.fc26.s390x
python2-idna-2.5-1.fc26.noarch
python2-libcomps-0.1.8-3.fc26.s390x
gsettings-desktop-schemas-3.24.1-1.fc26.s390x
javapackages-tools-4.7.0-17.fc26.noarch
libselinux-python3-2.6-7.fc26.s390x
python-backports-1.0-9.fc26.s390x
python2-cryptography-2.0.2-2.fc26.s390x
libselinux-python-2.6-7.fc26.s390x
Lmod-7.5.3-1.fc26.s390x
fipscheck-lib-1.5.0-1.fc26.s390x
elfutils-libs-0.169-1.fc26.s390x
krb5-libs-1.15.2-4.fc26.s390x
libuser-0.62-6.fc26.s390x
python2-requests-kerberos-0.10.0-4.fc26.noarch
npth-1.5-1.fc26.s390x
packagedb-cli-2.14.1-2.fc26.noarch
ustr-1.0.4-22.fc26.s390x
device-mapper-1.02.137-6.fc26.s390x
polkit-pkla-compat-0.1-8.fc26.s390x
fakeroot-1.22-1.fc26.s390x
libXmu-1.1.2-5.fc26.s390x
cairo-gobject-1.14.10-1.fc26.s390x
texlive-booktabs-svn40846-33.fc26.2.noarch
texlive-dvips-bin-svn40987-33.20160520.fc26.2.s390x
texlive-float-svn15878.1.3d-33.fc26.2.noarch
texlive-tex-svn40793-33.fc26.2.noarch
texlive-fancyref-svn15878.0.9c-33.fc26.2.noarch
texlive-manfnt-font-svn35799.0-33.fc26.2.noarch
texlive-cmap-svn41168-33.fc26.2.noarch
texlive-hyph-utf8-svn41189-33.fc26.2.noarch
texlive-paralist-svn39247-33.fc26.2.noarch
texlive-trimspaces-svn15878.1.1-33.fc26.2.noarch
texlive-tipa-svn29349.1.3-33.fc26.2.noarch
texlive-l3packages-svn41246-33.fc26.2.noarch
texlive-pst-pdf-svn31660.1.1v-33.fc26.2.noarch
texlive-tex-gyre-svn18651.2.004-33.fc26.2.noarch
texlive-beamer-svn36461.3.36-33.fc26.2.noarch
gd-2.2.5-1.fc26.s390x
elfutils-libelf-devel-0.169-1.fc26.s390x
gc-devel-7.6.0-2.fc26.s390x
libXft-devel-2.3.2-5.fc26.s390x
krb5-devel-1.15.2-4.fc26.s390x
rpm-devel-4.13.0.2-1.fc26.s390x
pcre-static-8.41-3.fc26.s390x
bluez-libs-devel-5.46-6.fc26.s390x
systemtap-3.2-2.fc26.s390x
trousers-0.3.13-7.fc26.s390x
iproute-tc-4.11.0-1.fc26.s390x
python2-sphinx-1.5.5-1.fc26.noarch
libgnome-keyring-3.12.0-8.fc26.s390x
perl-File-ShareDir-1.102-8.fc26.noarch
python2-paramiko-2.2.1-1.fc26.noarch
python2-openidc-client-0.4.0-1.20171113git54dee6e.fc26.noarch
openssh-server-7.5p1-4.fc26.s390x
pulseaudio-libs-11.1-7.fc26.s390x
python2-bodhi-2.12.2-3.fc26.noarch
lua-libs-5.3.4-7.fc26.s390x
dhcp-common-4.3.5-10.fc26.noarch
python3-pip-9.0.1-11.fc26.noarch
python3-sssdconfig-1.16.0-4.fc26.noarch
gpg-pubkey-95a43f54-5284415a
gpg-pubkey-fdb19c98-56fd6333
gpg-pubkey-64dab85d-57d33e22
tzdata-2017c-1.fc26.noarch
firewalld-filesystem-0.4.4.5-1.fc26.noarch
xkeyboard-config-2.21-3.fc26.noarch
texlive-texlive-common-doc-svn40682-33.fc26.2.noarch
ncurses-base-6.0-8.20170212.fc26.noarch
libselinux-2.6-7.fc26.s390x
bzip2-libs-1.0.6-22.fc26.s390x
libdb-5.3.28-24.fc26.s390x
mpfr-3.1.5-3.fc26.s390x
file-libs-5.30-11.fc26.s390x
libunistring-0.9.7-1.fc26.s390x
libxslt-1.1.29-1.fc26.s390x
libtasn1-4.12-1.fc26.s390x
gdbm-1.13-1.fc26.s390x
libepoxy-1.4.3-1.fc26.s390x
libpsl-0.18.0-1.fc26.s390x
perl-Carp-1.40-366.fc26.noarch
e2fsprogs-libs-1.43.4-2.fc26.s390x
libmnl-1.0.4-2.fc26.s390x
openjpeg2-2.2.0-3.fc26.s390x
perl-PathTools-3.63-367.fc26.s390x
perl-File-Temp-0.230.400-2.fc26.noarch
perl-XML-Parser-2.44-6.fc26.s390x
libss-1.43.4-2.fc26.s390x
ilmbase-2.2.0-8.fc26.s390x
fuse-libs-2.9.7-2.fc26.s390x
libdaemon-0.14-11.fc26.s390x
libbasicobjects-0.1.1-34.fc26.s390x
iptables-1.6.1-2.fc26.s390x
perl-TermReadKey-2.37-2.fc26.s390x
perl-Term-ANSIColor-4.06-2.fc26.noarch
perl-libintl-perl-1.26-2.fc26.s390x
usbredir-0.7.1-3.fc26.s390x
fftw-libs-double-3.3.5-4.fc26.s390x
rsync-3.1.2-5.fc26.s390x
libiscsi-1.15.0-3.fc26.s390x
ttmkfdir-3.0.9-49.fc26.s390x
texlive-base-2016-33.20160520.fc26.1.noarch
python2-six-1.10.0-9.fc26.noarch
atk-2.24.0-1.fc26.s390x
python2-kitchen-1.2.4-6.fc26.noarch
guile-2.0.14-1.fc26.s390x
desktop-file-utils-0.23-3.fc26.s390x
pyxattr-0.5.3-10.fc26.s390x
shared-mime-info-1.8-2.fc26.s390x
libyaml-0.1.7-2.fc26.s390x
python3-PyYAML-3.12-3.fc26.s390x
openssh-7.5p1-4.fc26.s390x
kernel-core-4.13.16-202.fc26.s390x
perl-Git-2.13.6-2.fc26.noarch
python3-dnf-plugins-extras-common-2.0.4-1.fc26.noarch
openssl-1.1.0g-1.fc26.s390x
gawk-4.1.4-6.fc26.s390x
gnutls-3.5.16-4.fc26.s390x
openldap-2.4.45-2.fc26.s390x
bind-license-9.11.1-4.P3.fc26.noarch
python2-gluster-3.10.8-1.fc26.s390x
selinux-policy-3.13.1-260.17.fc26.noarch
linux-firmware-20171215-81.git2451bb22.fc26.noarch
libpkgconf-1.3.12-1.fc26.s390x
NetworkManager-libnm-1.8.2-4.fc26.s390x
gnutls-devel-3.5.16-4.fc26.s390x
mariadb-libs-10.1.29-1.fc26.s390x
python2-urllib3-1.20-2.fc26.noarch
sssd-nfs-idmap-1.16.0-4.fc26.s390x
libsss_sudo-1.16.0-4.fc26.s390x
libgudev-232-1.fc26.s390x
python3-libs-3.6.3-2.fc26.s390x
python3-javapackages-4.7.0-17.fc26.noarch
python3-ply-3.9-3.fc26.noarch
python3-systemd-234-1.fc26.s390x
python3-requests-2.13.0-1.fc26.noarch
blktrace-1.1.0-4.fc26.s390x
python2-asn1crypto-0.23.0-1.fc26.noarch
python2-cffi-1.9.1-2.fc26.s390x
python2-sphinx_rtd_theme-0.2.4-1.fc26.noarch
lua-json-1.3.2-7.fc26.noarch
libcephfs1-10.2.7-2.fc26.s390x
glib-networking-2.50.0-2.fc26.s390x
elfutils-default-yama-scope-0.169-1.fc26.noarch
GeoIP-GeoLite-data-2017.10-1.fc26.noarch
libedit-3.1-17.20160618cvs.fc26.s390x
libverto-libev-0.2.6-7.fc26.s390x
libserf-1.3.9-3.fc26.s390x
createrepo_c-0.10.0-9.fc26.s390x
python2-kerberos-1.2.5-3.fc26.s390x
libsrtp-1.5.4-4.fc26.s390x
lzo-minilzo-2.08-9.fc26.s390x
librepo-1.8.0-1.fc26.s390x
koji-1.14.0-1.fc26.noarch
sg3_utils-1.42-1.fc26.s390x
libobjc-7.2.1-2.fc26.s390x
policycoreutils-2.6-6.fc26.s390x
libdrm-2.4.88-1.fc26.s390x
kernel-core-4.13.13-200.fc26.s390x
systemtap-client-3.2-2.fc26.s390x
lvm2-2.02.168-6.fc26.s390x
device-mapper-multipath-libs-0.4.9-88.fc26.s390x
libfdt-1.4.5-1.fc26.s390x
s390utils-cmsfs-1.36.1-3.fc26.s390x
libXdamage-1.1.4-9.fc26.s390x
libXaw-1.0.13-5.fc26.s390x
brltty-5.5-5.fc26.s390x
librsvg2-2.40.18-1.fc26.s390x
texlive-tetex-bin-svn36770.0-33.20160520.fc26.2.noarch
texlive-etex-pkg-svn39355-33.fc26.2.noarch
texlive-graphics-svn41015-33.fc26.2.noarch
texlive-dvips-svn41149-33.fc26.2.noarch
texlive-zapfding-svn31835.0-33.fc26.2.noarch
texlive-footmisc-svn23330.5.5b-33.fc26.2.noarch
texlive-makeindex-svn40768-33.fc26.2.noarch
texlive-pst-ovl-svn40873-33.fc26.2.noarch
texlive-texlive-scripts-svn41433-33.fc26.2.noarch
texlive-ltabptch-svn17533.1.74d-33.fc26.2.noarch
texlive-euro-svn22191.1.1-33.fc26.2.noarch
texlive-mflogo-font-svn36898.1.002-33.fc26.2.noarch
texlive-zapfchan-svn31835.0-33.fc26.2.noarch
texlive-cmextra-svn32831.0-33.fc26.2.noarch
texlive-finstrut-svn21719.0.5-33.fc26.2.noarch
texlive-hyphen-base-svn41138-33.fc26.2.noarch
texlive-marginnote-svn41382-33.fc26.2.noarch
texlive-parallel-svn15878.0-33.fc26.2.noarch
texlive-sepnum-svn20186.2.0-33.fc26.2.noarch
texlive-environ-svn33821.0.3-33.fc26.2.noarch
texlive-type1cm-svn21820.0-33.fc26.2.noarch
texlive-xunicode-svn30466.0.981-33.fc26.2.noarch
texlive-attachfile-svn38830-33.fc26.2.noarch
texlive-fontspec-svn41262-33.fc26.2.noarch
texlive-fancyvrb-svn18492.2.8-33.fc26.2.noarch
texlive-pst-pdf-bin-svn7838.0-33.20160520.fc26.2.noarch
texlive-xcolor-svn41044-33.fc26.2.noarch
texlive-pdfpages-svn40638-33.fc26.2.noarch
texlive-sansmathaccent-svn30187.0-33.fc26.2.noarch
texlive-ucs-svn35853.2.2-33.fc26.2.noarch
texlive-dvipdfmx-bin-svn40273-33.20160520.fc26.2.s390x
libotf-0.9.13-8.fc26.s390x
go-srpm-macros-2-8.fc26.noarch
pcre-devel-8.41-3.fc26.s390x
mesa-libwayland-egl-devel-17.2.4-2.fc26.s390x
ghostscript-9.20-10.fc26.s390x
libcephfs_jni-devel-10.2.7-2.fc26.s390x
libXdamage-devel-1.1.4-9.fc26.s390x
freetype-devel-2.7.1-9.fc26.s390x
ncurses-devel-6.0-8.20170212.fc26.s390x
fontconfig-devel-2.12.6-4.fc26.s390x
cairo-devel-1.14.10-1.fc26.s390x
libselinux-devel-2.6-7.fc26.s390x
guile-devel-2.0.14-1.fc26.s390x
libcap-ng-devel-0.7.8-3.fc26.s390x
bash-completion-2.6-1.fc26.noarch
libXevie-1.0.3-12.fc26.s390x
kernel-4.13.13-200.fc26.s390x
audit-2.8.1-1.fc26.s390x
gcc-objc-7.2.1-2.fc26.s390x
gcc-go-7.2.1-2.fc26.s390x
python-firewall-0.4.4.5-1.fc26.noarch
python3-html5lib-0.999-13.fc26.noarch
python2-simplejson-3.10.0-3.fc26.s390x
flex-2.6.1-3.fc26.s390x
telnet-0.17-69.fc26.s390x
gpg-pubkey-8e1431d5-53bcbac7
emacs-filesystem-25.3-3.fc26.noarch
fontawesome-fonts-4.7.0-2.fc26.noarch
fontawesome-fonts-web-4.7.0-2.fc26.noarch
tzdata-java-2017c-1.fc26.noarch
rpmconf-base-1.0.19-1.fc26.noarch
glibc-2.25-12.fc26.s390x
info-6.3-3.fc26.s390x
sqlite-libs-3.20.1-1.fc26.s390x
texlive-lib-2016-33.20160520.fc26.1.s390x
sed-4.4-1.fc26.s390x
libicu-57.1-7.fc26.s390x
libcap-ng-0.7.8-3.fc26.s390x
nettle-3.3-2.fc26.s390x
libidn2-2.0.4-1.fc26.s390x
lcms2-2.8-3.fc26.s390x
dbus-libs-1.11.18-1.fc26.s390x
perl-Exporter-5.72-367.fc26.noarch
unzip-6.0-34.fc26.s390x
iproute-4.11.0-1.fc26.s390x
zip-3.0-18.fc26.s390x
perl-constant-1.33-368.fc26.noarch
perl-MIME-Base64-3.15-366.fc26.s390x
lua-posix-33.3.1-4.fc26.s390x
bzip2-1.0.6-22.fc26.s390x
libstdc++-devel-7.2.1-2.fc26.s390x
hyphen-2.8.8-6.fc26.s390x
libdvdread-5.0.3-4.fc26.s390x
libcollection-0.7.0-34.fc26.s390x
libdvdnav-5.0.3-5.fc26.s390x
perl-version-0.99.18-1.fc26.s390x
perl-Encode-2.88-6.fc26.s390x
automake-1.15-9.fc26.noarch
plymouth-core-libs-0.9.3-0.7.20160620git0e65b86c.fc26.s390x
hesiod-3.2.1-7.fc26.s390x
jasper-libs-2.0.14-1.fc26.s390x
mozjs17-17.0.0-18.fc26.s390x
fontconfig-2.12.6-4.fc26.s390x
harfbuzz-1.4.4-1.fc26.s390x
alsa-lib-1.1.4.1-1.fc26.s390x
make-4.2.1-2.fc26.s390x
gobject-introspection-1.52.1-1.fc26.s390x
hicolor-icon-theme-0.15-5.fc26.noarch
gdk-pixbuf2-2.36.9-1.fc26.s390x
libgusb-0.2.11-1.fc26.s390x
libtalloc-2.1.10-2.fc26.s390x
libdhash-0.5.0-34.fc26.s390x
python2-bcrypt-3.1.4-2.fc26.s390x
PyYAML-3.12-3.fc26.s390x
nss-softokn-freebl-3.34.0-1.0.fc26.s390x
kernel-modules-4.13.16-202.fc26.s390x
git-2.13.6-2.fc26.s390x
gnupg2-smime-2.2.3-1.fc26.s390x
openssl-devel-1.1.0g-1.fc26.s390x
python2-dnf-plugins-extras-common-2.0.4-1.fc26.noarch
copy-jdk-configs-3.3-2.fc26.noarch
glusterfs-client-xlators-3.10.8-1.fc26.s390x
libcurl-7.53.1-13.fc26.s390x
bind-libs-lite-9.11.1-4.P3.fc26.s390x
glusterfs-extra-xlators-3.10.8-1.fc26.s390x
python3-setuptools-37.0.0-1.fc26.noarch
kernel-core-4.14.8-200.fc26.s390x
pkgconf-1.3.12-1.fc26.s390x
NetworkManager-1.8.2-4.fc26.s390x
libjpeg-turbo-devel-1.5.3-1.fc26.s390x
lua-5.3.4-7.fc26.s390x
boost-thread-1.63.0-10.fc26.s390x
wget-1.19.2-2.fc26.s390x
libwebp-0.6.1-1.fc26.s390x
kernel-devel-4.14.8-200.fc26.s390x
python3-lxml-4.1.1-1.fc26.s390x
python3-ordered-set-2.0.0-6.fc26.noarch
python3-rpmconf-1.0.19-1.fc26.noarch
python-offtrac-0.1.0-9.fc26.noarch
python2-pycparser-2.14-10.fc26.noarch
python2-sphinx-theme-alabaster-0.7.9-3.fc26.noarch
python2-pysocks-1.6.7-1.fc26.noarch
lua-lpeg-1.0.1-2.fc26.s390x
poppler-0.52.0-10.fc26.s390x
libproxy-0.4.15-2.fc26.s390x
crontabs-1.11-14.20150630git.fc26.noarch
java-1.8.0-openjdk-headless-1.8.0.151-1.b12.fc26.s390x
libev-4.24-2.fc26.s390x
libsigsegv-2.11-1.fc26.s390x
fedora-cert-0.6.0.1-2.fc26.noarch
drpm-0.3.0-6.fc26.s390x
createrepo_c-libs-0.10.0-9.fc26.s390x
python2-cccolutils-1.5-3.fc26.s390x
m17n-lib-1.7.0-6.fc26.s390x
lsscsi-0.28-4.fc26.s390x
python2-koji-1.14.0-1.fc26.noarch
python3-koji-1.14.0-1.fc26.noarch
python3-gpg-1.8.0-12.fc26.s390x
sg3_utils-libs-1.42-1.fc26.s390x
SDL2-2.0.7-2.fc26.s390x
util-linux-2.30.2-1.fc26.s390x
rpcbind-0.2.4-8.rc2.fc26.s390x
s390utils-mon_statd-1.36.1-3.fc26.s390x
GConf2-3.2.6-17.fc26.s390x
systemd-container-233-7.fc26.s390x
usermode-1.111-9.fc26.s390x
pcre-utf32-8.41-3.fc26.s390x
libXt-1.1.5-4.fc26.s390x
libXpm-3.5.12-2.fc26.s390x
at-spi2-core-2.24.1-1.fc26.s390x
cairo-1.14.10-1.fc26.s390x
texlive-kpathsea-bin-svn40473-33.20160520.fc26.2.s390x
texlive-ifluatex-svn41346-33.fc26.2.noarch
texlive-babel-svn40706-33.fc26.2.noarch
texlive-colortbl-svn29803.v1.0a-33.fc26.2.noarch
texlive-marvosym-svn29349.2.2a-33.fc26.2.noarch
texlive-euler-svn17261.2.5-33.fc26.2.noarch
texlive-latexconfig-svn40274-33.fc26.2.noarch
texlive-plain-svn40274-33.fc26.2.noarch
texlive-texconfig-bin-svn29741.0-33.20160520.fc26.2.noarch
giflib-4.1.6-16.fc26.s390x
texlive-microtype-svn41127-33.fc26.2.noarch
texlive-eurosym-svn17265.1.4_subrfix-33.fc26.2.noarch
texlive-symbol-svn31835.0-33.fc26.2.noarch
texlive-chngcntr-svn17157.1.0a-33.fc26.2.noarch
texlive-euenc-svn19795.0.1h-33.fc26.2.noarch
texlive-luatex-svn40963-33.fc26.2.noarch
texlive-knuth-local-svn38627-33.fc26.2.noarch
texlive-mparhack-svn15878.1.4-33.fc26.2.noarch
texlive-rcs-svn15878.0-33.fc26.2.noarch
texlive-texlive-msg-translations-svn41431-33.fc26.2.noarch
texlive-updmap-map-svn41159-33.fc26.2.noarch
texlive-geometry-svn19716.5.6-33.fc26.2.noarch
texlive-memoir-svn41203-33.fc26.2.noarch
texlive-l3kernel-svn41246-33.fc26.2.noarch
texlive-pst-eps-svn15878.1.0-33.fc26.2.noarch
texlive-pst-text-svn15878.1.00-33.fc26.2.noarch
texlive-amscls-svn36804.0-33.fc26.2.noarch
texlive-pst-slpe-svn24391.1.31-33.fc26.2.noarch
texlive-extsizes-svn17263.1.4a-33.fc26.2.noarch
texlive-xetex-def-svn40327-33.fc26.2.noarch
texlive-collection-latex-svn41011-33.20160520.fc26.2.noarch
gstreamer1-plugins-base-1.12.3-1.fc26.s390x
fpc-srpm-macros-1.1-2.fc26.noarch
xorg-x11-proto-devel-7.7-22.fc26.noarch
urw-fonts-2.4-23.fc26.noarch
atk-devel-2.24.0-1.fc26.s390x
ImageMagick-libs-6.9.9.22-1.fc26.s390x
libxcb-devel-1.12-3.fc26.s390x
libXrandr-devel-1.5.1-2.fc26.s390x
libcom_err-devel-1.43.4-2.fc26.s390x
dbus-devel-1.11.18-1.fc26.s390x
libepoxy-devel-1.4.3-1.fc26.s390x
libicu-devel-57.1-7.fc26.s390x
p11-kit-devel-0.23.9-2.fc26.s390x
rpm-build-4.13.0.2-1.fc26.s390x
libssh2-devel-1.8.0-5.fc26.s390x
graphviz-2.40.1-4.fc26.s390x
zlib-static-1.2.11-2.fc26.s390x
mesa-libgbm-devel-17.2.4-2.fc26.s390x
dracut-config-rescue-046-3.1.fc26.s390x
screen-4.6.2-1.fc26.s390x
python-osbs-client-0.39.1-1.fc26.noarch
gcc-gdb-plugin-7.2.1-2.fc26.s390x
pyparsing-2.1.10-3.fc26.noarch
python3-pyasn1-0.2.3-1.fc26.noarch
python2-html5lib-0.999-13.fc26.noarch
teamd-1.27-1.fc26.s390x
hardlink-1.3-1.fc26.s390x
chrpath-0.16-4.fc26.s390x
libgcc-7.2.1-2.fc26.s390x
python-rpm-macros-3-20.fc26.noarch
texlive-pdftex-doc-svn41149-33.fc26.2.noarch
glibc-common-2.25-12.fc26.s390x
libstdc++-7.2.1-2.fc26.s390x
nspr-4.17.0-1.fc26.s390x
grep-3.1-1.fc26.s390x
libgcrypt-1.7.9-1.fc26.s390x
libacl-2.2.52-15.fc26.s390x
cpio-2.12-4.fc26.s390x
libatomic_ops-7.4.4-2.fc26.s390x
p11-kit-0.23.9-2.fc26.s390x
gc-7.6.0-2.fc26.s390x
psmisc-22.21-9.fc26.s390x
systemd-libs-233-7.fc26.s390x
xz-5.2.3-2.fc26.s390x
perl-libs-5.24.3-395.fc26.s390x
kmod-libs-24-1.fc26.s390x
libpcap-1.8.1-3.fc26.s390x
perl-macros-5.24.3-395.fc26.s390x
perl-parent-0.236-2.fc26.noarch
perl-Text-Unidecode-1.30-2.fc26.noarch
newt-0.52.20-1.fc26.s390x
libcomps-0.1.8-3.fc26.s390x
libfontenc-1.1.3-4.fc26.s390x
ipcalc-0.2.0-1.fc26.s390x
libnfnetlink-1.0.1-9.fc26.s390x
libref_array-0.1.5-34.fc26.s390x
perl-Term-Cap-1.17-366.fc26.noarch
perl-Digest-1.17-367.fc26.noarch
perl-SelfLoader-1.23-395.fc26.noarch
perl-Pod-Simple-3.35-2.fc26.noarch
perl-URI-1.71-6.fc26.noarch
cpp-7.2.1-2.fc26.s390x
attr-2.4.47-18.fc26.s390x
gmp-c++-6.1.2-4.fc26.s390x
xapian-core-libs-1.4.4-1.fc26.s390x
system-python-3.6.3-2.fc26.s390x
harfbuzz-icu-1.4.4-1.fc26.s390x
libtevent-0.9.34-1.fc26.s390x
http-parser-2.7.1-5.fc26.s390x
libsodium-1.0.14-1.fc26.s390x
python-gssapi-1.2.0-5.fc26.s390x
nss-softokn-3.34.0-1.0.fc26.s390x
gnupg2-2.2.3-1.fc26.s390x
nss-devel-3.34.0-1.0.fc26.s390x
vim-minimal-8.0.1360-1.fc26.s390x
perl-libnet-3.11-1.fc26.noarch
kernel-devel-4.13.16-202.fc26.s390x
python2-libs-2.7.14-4.fc26.s390x
libwayland-client-1.13.0-3.fc26.s390x
python3-dnf-2.7.5-2.fc26.noarch
glusterfs-fuse-3.10.8-1.fc26.s390x
pcre2-utf32-10.23-11.fc26.s390x
kernel-modules-4.14.8-200.fc26.s390x
pkgconf-pkg-config-1.3.12-1.fc26.s390x
NetworkManager-ppp-1.8.2-4.fc26.s390x
wayland-devel-1.13.0-3.fc26.s390x
kernel-4.14.8-200.fc26.s390x
boost-random-1.63.0-10.fc26.s390x
libmicrohttpd-0.9.58-1.fc26.s390x
mailx-12.5-24.fc26.s390x
NetworkManager-glib-1.8.2-4.fc26.s390x
libcroco-0.6.12-1.fc26.s390x
libssh2-1.8.0-5.fc26.s390x
json-glib-1.2.6-1.fc26.s390x
libevent-2.0.22-3.fc26.s390x
gdk-pixbuf2-modules-2.36.9-1.fc26.s390x
colord-libs-1.3.5-1.fc26.s390x
python3-magic-5.30-11.fc26.noarch
python3-gobject-base-3.24.1-1.fc26.s390x
python3-pyroute2-0.4.13-1.fc26.noarch
python3-pysocks-1.6.7-1.fc26.noarch
python2-click-6.7-3.fc26.noarch
python-munch-2.1.0-2.fc26.noarch
python2-ply-3.9-3.fc26.noarch
python2-snowballstemmer-1.2.1-3.fc26.noarch
python-magic-5.30-11.fc26.noarch
python-beautifulsoup4-4.6.0-1.fc26.noarch
python2-gitdb-2.0.3-1.fc26.noarch
librados-devel-10.2.7-2.fc26.s390x
libcacard-2.5.3-1.fc26.s390x
libmodman-2.0.1-13.fc26.s390x
zziplib-0.13.62-8.fc26.s390x
lksctp-tools-1.0.16-6.fc26.s390x
procmail-3.22-44.fc26.s390x
libthai-0.1.25-2.fc26.s390x
libpipeline-1.4.1-3.fc26.s390x
python2-pycurl-7.43.0-8.fc26.s390x
deltarpm-3.6-19.fc26.s390x
subversion-libs-1.9.7-1.fc26.s390x
python-krbV-1.0.90-13.fc26.s390x
m17n-db-1.7.0-8.fc26.noarch
linux-atm-libs-2.5.1-17.fc26.s390x
python2-rpm-4.13.0.2-1.fc26.s390x
python2-librepo-1.8.0-1.fc26.s390x
python2-dnf-plugins-core-2.1.5-1.fc26.noarch
qrencode-libs-3.4.4-1.fc26.s390x
s390utils-iucvterm-1.36.1-3.fc26.s390x
libsmartcols-2.30.2-1.fc26.s390x
dbus-1.11.18-1.fc26.s390x
systemd-udev-233-7.fc26.s390x
device-mapper-event-1.02.137-6.fc26.s390x
polkit-0.113-8.fc26.s390x
mock-1.4.7-2.fc26.noarch
libwmf-lite-0.2.8.4-53.fc26.s390x
libXcomposite-0.4.4-9.fc26.s390x
libXcursor-1.1.14-8.fc26.s390x
at-spi2-atk-2.24.1-1.fc26.s390x
pango-1.40.12-1.fc26.s390x
texlive-metafont-bin-svn40987-33.20160520.fc26.2.s390x
texlive-url-svn32528.3.4-33.fc26.2.noarch
texlive-fp-svn15878.0-33.fc26.2.noarch
texlive-latex-fonts-svn28888.0-33.fc26.2.noarch
texlive-mptopdf-bin-svn18674.0-33.20160520.fc26.2.noarch
texlive-fancybox-svn18304.1.4-33.fc26.2.noarch
texlive-lua-alt-getopt-svn29349.0.7.0-33.fc26.2.noarch
texlive-tex-bin-svn40987-33.20160520.fc26.2.s390x
texlive-texconfig-svn40768-33.fc26.2.noarch
texlive-wasy2-ps-svn35830.0-33.fc26.2.noarch
texlive-psfrag-svn15878.3.04-33.fc26.2.noarch
texlive-helvetic-svn31835.0-33.fc26.2.noarch
texlive-times-svn35058.0-33.fc26.2.noarch
texlive-cite-svn36428.5.5-33.fc26.2.noarch
texlive-fancyhdr-svn15878.3.1-33.fc26.2.noarch
texlive-luatex-bin-svn41091-33.20160520.fc26.2.s390x
texlive-lm-math-svn36915.1.959-33.fc26.2.noarch
texlive-ntgclass-svn15878.2.1a-33.fc26.2.noarch
texlive-sansmath-svn17997.1.1-33.fc26.2.noarch
texlive-textcase-svn15878.0-33.fc26.2.noarch
texlive-unicode-data-svn39808-33.fc26.2.noarch
texlive-breakurl-svn29901.1.40-33.fc26.2.noarch
texlive-latex-svn40218-33.fc26.2.noarch
texlive-lualatex-math-svn40621-33.fc26.2.noarch
texlive-pst-coil-svn37377.1.07-33.fc26.2.noarch
texlive-pst-plot-svn41242-33.fc26.2.noarch
texlive-unicode-math-svn38462-33.fc26.2.noarch
texlive-pst-blur-svn15878.2.0-33.fc26.2.noarch
texlive-cm-super-svn15878.0-33.fc26.2.noarch
texlive-wasysym-svn15878.2.0-33.fc26.2.noarch
texlive-collection-fontsrecommended-svn35830.0-33.20160520.fc26.2.noarch
libXv-1.0.11-2.fc26.s390x
ghc-srpm-macros-1.4.2-5.fc26.noarch
latex2html-2017.2-2.fc26.noarch
libXau-devel-1.0.8-7.fc26.s390x
libXcursor-devel-1.1.14-8.fc26.s390x
graphite2-devel-1.3.10-1.fc26.s390x
pixman-devel-0.34.0-3.fc26.s390x
wayland-protocols-devel-1.9-1.fc26.noarch
mesa-libGLES-devel-17.2.4-2.fc26.s390x
redhat-rpm-config-63-1.fc26.noarch
vte291-devel-0.48.4-1.fc26.s390x
ceph-devel-compat-10.2.7-2.fc26.s390x
lzo-devel-2.08-9.fc26.s390x
libiscsi-devel-1.15.0-3.fc26.s390x
libfdt-devel-1.4.5-1.fc26.s390x
dnsmasq-2.76-5.fc26.s390x
avahi-autoipd-0.6.32-7.fc26.s390x
rpm-plugin-systemd-inhibit-4.13.0.2-1.fc26.s390x
gcc-c++-7.2.1-2.fc26.s390x
python2-ndg_httpsclient-0.4.0-7.fc26.noarch
gettext-0.19.8.1-9.fc26.s390x
btrfs-progs-4.9.1-2.fc26.s390x
fedora-logos-26.0.1-1.fc26.s390x
dejagnu-1.6-2.fc26.noarch
libaio-devel-0.3.110-7.fc26.s390x
dos2unix-7.3.4-2.fc26.s390x
distribution-gpg-keys-1.15-1.fc26.noarch
python-sphinx-locale-1.5.5-1.fc26.noarch
python2-rpm-macros-3-20.fc26.noarch
libxml2-2.9.4-2.fc26.s390x
popt-1.16-12.fc26.s390x
tar-1.29-5.fc26.s390x
avahi-libs-0.6.32-7.fc26.s390x
m4-1.4.18-3.fc26.s390x
perl-Socket-2.024-2.fc26.s390x
perl-Time-Local-1.250-2.fc26.noarch
libmetalink-0.1.3-2.fc26.s390x
jbigkit-libs-2.1-6.fc26.s390x
netpbm-10.80.00-2.fc26.s390x
perl-Digest-MD5-2.55-3.fc26.s390x
perl-Getopt-Long-2.49.1-2.fc26.noarch
libglvnd-opengl-1.0.0-1.fc26.s390x
libattr-devel-2.4.47-18.fc26.s390x
teckit-2.5.1-16.fc26.s390x
python3-six-1.10.0-9.fc26.noarch
python3-libcomps-0.1.8-3.fc26.s390x
gtk-update-icon-cache-3.22.21-2.fc26.s390x
python3-3.6.3-2.fc26.s390x
python3-pyparsing-2.1.10-3.fc26.noarch
python2-markupsafe-0.23-13.fc26.s390x
python2-mock-2.0.0-4.fc26.noarch
python2-yubico-1.3.2-7.fc26.noarch
python2-smmap-2.0.3-1.fc26.noarch
librbd-devel-10.2.7-2.fc26.s390x
pigz-2.3.4-2.fc26.s390x
gcc-7.2.1-2.fc26.s390x
libnghttp2-1.21.1-1.fc26.s390x
cups-libs-2.2.2-7.fc26.s390x
libnfsidmap-0.27-1.fc26.s390x
ykpers-1.18.0-2.fc26.s390x
python3-librepo-1.8.0-1.fc26.s390x
systemtap-runtime-3.2-2.fc26.s390x
geoclue2-2.4.5-4.fc26.s390x
initscripts-9.72-1.fc26.s390x
plymouth-0.9.3-0.7.20160620git0e65b86c.fc26.s390x
ebtables-2.0.10-22.fc26.s390x
gssproxy-0.7.0-9.fc26.s390x
libXext-1.3.3-5.fc26.s390x
mesa-libEGL-17.2.4-2.fc26.s390x
texlive-texlive.infra-bin-svn40312-33.20160520.fc26.2.s390x
texlive-thumbpdf-svn34621.3.16-33.fc26.2.noarch
texlive-carlisle-svn18258.0-33.fc26.2.noarch
texlive-gsftopk-svn40768-33.fc26.2.noarch
texlive-pdftex-svn41149-33.fc26.2.noarch
texlive-crop-svn15878.1.5-33.fc26.2.noarch
texlive-pxfonts-svn15878.0-33.fc26.2.noarch
texlive-enctex-svn34957.0-33.fc26.2.noarch
texlive-kastrup-svn15878.0-33.fc26.2.noarch
texlive-pspicture-svn15878.0-33.fc26.2.noarch
texlive-varwidth-svn24104.0.92-33.fc26.2.noarch
texlive-currfile-svn40725-33.fc26.2.noarch
texlive-pst-grad-svn15878.1.06-33.fc26.2.noarch
texlive-latex-bin-svn41438-33.fc26.2.noarch
texlive-ltxmisc-svn21927.0-33.fc26.2.noarch
lasi-1.1.2-7.fc26.s390x
adwaita-icon-theme-3.24.0-2.fc26.noarch
xz-devel-5.2.3-2.fc26.s390x
xorg-x11-fonts-Type1-7.5-17.fc26.noarch
libXi-devel-1.7.9-2.fc26.s390x
at-spi2-atk-devel-2.24.1-1.fc26.s390x
pango-devel-1.40.12-1.fc26.s390x
libcacard-devel-2.5.3-1.fc26.s390x
libseccomp-devel-2.3.2-1.fc26.s390x
subversion-1.9.7-1.fc26.s390x
sudo-1.8.21p2-1.fc26.s390x
pykickstart-2.35-2.fc26.noarch
e2fsprogs-1.43.4-2.fc26.s390x
libstdc++-static-7.2.1-2.fc26.s390x
libbsd-0.8.3-3.fc26.s390x
c-ares-1.13.0-1.fc26.s390x
python2-pyxdg-0.25-12.fc26.noarch
nss-softokn-freebl-devel-3.34.0-1.0.fc26.s390x
python2-rpkg-1.51-2.fc26.noarch
strace-4.20-1.fc26.s390x
valgrind-3.13.0-12.fc26.s390x
libsss_idmap-1.16.0-4.fc26.s390x
gnutls-c++-3.5.16-4.fc26.s390x
libwayland-server-1.13.0-3.fc26.s390x
dhcp-client-4.3.5-10.fc26.s390x
bind-libs-9.11.1-4.P3.fc26.s390x
man-pages-4.09-4.fc26.noarch
gpg-pubkey-a29cb19c-53bcbba6
quota-nls-4.03-9.fc26.noarch
qt5-srpm-macros-5.8.0-2.fc26.noarch
xz-libs-5.2.3-2.fc26.s390x
gmp-6.1.2-4.fc26.s390x
audit-libs-2.8.1-1.fc26.s390x
file-5.30-11.fc26.s390x
libusbx-1.0.21-2.fc26.s390x
binutils-2.27-28.fc26.s390x
perl-Errno-1.25-395.fc26.s390x
perl-HTTP-Tiny-0.070-2.fc26.noarch
xml-common-0.6.3-45.fc26.noarch
opus-1.2.1-1.fc26.s390x
kernel-devel-4.13.13-200.fc26.s390x
perl-podlators-4.09-2.fc26.noarch
flac-libs-1.3.2-2.fc26.s390x
libacl-devel-2.2.52-15.fc26.s390x
coreutils-common-8.27-7.fc26.s390x
cracklib-2.9.6-5.fc26.s390x
pyliblzma-0.5.3-17.fc26.s390x
libnotify-0.7.7-2.fc26.s390x
python3-idna-2.5-1.fc26.noarch
python3-pyOpenSSL-16.2.0-6.fc26.noarch
python2-pbr-1.10.0-4.fc26.noarch
pyusb-1.0.0-4.fc26.noarch
python2-fedora-0.9.0-6.fc26.noarch
librbd1-10.2.7-2.fc26.s390x
pcre-cpp-8.41-3.fc26.s390x
glibc-devel-2.25-12.fc26.s390x
libnfs-1.9.8-3.fc26.s390x
libsolv-0.6.30-2.fc26.s390x
python3-pycurl-7.43.0-8.fc26.s390x
libyubikey-1.13-3.fc26.s390x
rpmlint-1.10-5.fc26.noarch
python2-pygpgme-0.3-22.fc26.s390x
s390utils-base-1.36.1-3.fc26.s390x
ppp-2.4.7-11.fc26.s390x
s390utils-cpuplugd-1.36.1-3.fc26.s390x
nfs-utils-2.1.1-6.rc6.fc26.s390x
libXrender-0.9.10-2.fc26.s390x
libglvnd-gles-1.0.0-1.fc26.s390x
texlive-texlive.infra-svn41280-33.fc26.2.noarch
texlive-lm-svn28119.2.004-33.fc26.2.noarch
texlive-babelbib-svn25245.1.31-33.fc26.2.noarch
texlive-index-svn24099.4.1beta-33.fc26.2.noarch
texlive-pdftex-bin-svn40987-33.20160520.fc26.2.s390x
texlive-csquotes-svn39538-33.fc26.2.noarch
texlive-rsfs-svn15878.0-33.fc26.2.noarch
texlive-etex-svn37057.0-33.fc26.2.noarch
texlive-knuth-lib-svn35820.0-33.fc26.2.noarch
texlive-pst-math-svn34786.0.63-33.fc26.2.noarch
texlive-utopia-svn15878.0-33.fc26.2.noarch
texlive-eso-pic-svn37925.2.0g-33.fc26.2.noarch
texlive-pst-fill-svn15878.1.01-33.fc26.2.noarch
texlive-latex-bin-bin-svn14050.0-33.20160520.fc26.2.noarch
texlive-jknapltx-svn19440.0-33.fc26.2.noarch
texlive-collection-latexrecommended-svn35765.0-33.20160520.fc26.2.noarch
adwaita-cursor-theme-3.24.0-2.fc26.noarch
xorg-x11-fonts-ISO8859-1-100dpi-7.5-17.fc26.noarch
libXcomposite-devel-0.4.4-9.fc26.s390x
at-spi2-core-devel-2.24.1-1.fc26.s390x
harfbuzz-devel-1.4.4-1.fc26.s390x
rpmdevtools-8.10-2.fc26.noarch
texi2html-5.0-5.fc26.noarch
libnfs-devel-1.9.8-3.fc26.s390x
firewalld-0.4.4.5-1.fc26.noarch
wpa_supplicant-2.6-12.fc26.s390x
systemtap-sdt-devel-3.2-2.fc26.s390x
newt-python-0.52.20-1.fc26.s390x
perl-Mozilla-CA-20160104-4.fc26.noarch
pth-2.0.7-28.fc26.s390x
python3-pyxdg-0.25-12.fc26.noarch
nss-softokn-devel-3.34.0-1.0.fc26.s390x
fedpkg-1.30-4.fc26.noarch
timedatex-0.4-3.fc26.s390x
libjpeg-turbo-1.5.3-1.fc26.s390x
glusterfs-cli-3.10.8-1.fc26.s390x
libsss_nss_idmap-1.16.0-4.fc26.s390x
gdb-8.0.1-33.fc26.s390x
dnf-yum-2.7.5-2.fc26.noarch
perl-Data-Dumper-2.161-3.fc26.s390x
python-async-0.6.1-9.fc22.s390x
poppler-data-0.4.7-7.fc26.noarch
ocaml-srpm-macros-4-2.fc26.noarch
libuuid-2.30.2-1.fc26.s390x
libgpg-error-1.25-2.fc26.s390x
libassuan-2.4.3-2.fc26.s390x
graphite2-1.3.10-1.fc26.s390x
perl-Text-Tabs+Wrap-2013.0523-366.fc26.noarch
perl-Error-0.17024-8.fc26.noarch
which-2.21-2.fc26.s390x
libXau-1.0.8-7.fc26.s390x
orc-0.4.27-1.fc26.s390x
perl-Pod-Perldoc-3.28-1.fc26.noarch
libsndfile-1.0.28-6.fc26.s390x
patch-2.7.5-4.fc26.s390x
gzip-1.8-2.fc26.s390x
python-ipaddress-1.0.16-4.fc26.noarch
yum-metadata-parser-1.1.4-18.fc26.s390x
python3-dbus-1.2.4-6.fc26.s390x
python3-cryptography-2.0.2-2.fc26.s390x
python3-kickstart-2.35-2.fc26.noarch
python2-imagesize-0.7.1-5.fc26.noarch
python2-jinja2-2.9.6-1.fc26.noarch
libradosstriper-devel-10.2.7-2.fc26.s390x
soundtouch-1.9.2-4.fc26.s390x
glibc-headers-2.25-12.fc26.s390x
libndp-1.6-2.fc26.s390x
rpm-4.13.0.2-1.fc26.s390x
rest-0.8.0-2.fc26.s390x
libvisual-0.4.0-21.fc26.s390x
python2-hawkey-0.11.1-1.fc26.s390x
dnf-plugins-core-2.1.5-1.fc26.noarch
fakeroot-libs-1.22-1.fc26.s390x
device-mapper-event-libs-1.02.137-6.fc26.s390x
cyrus-sasl-2.1.26-32.fc26.s390x
kernel-modules-4.13.13-200.fc26.s390x
cronie-anacron-1.5.1-5.fc26.s390x
libpath_utils-0.2.1-34.fc26.s390x
libX11-common-1.6.5-2.fc26.noarch
libXft-2.3.2-5.fc26.s390x
gtk2-2.24.31-4.fc26.s390x
texlive-etoolbox-svn38031.2.2a-33.fc26.2.noarch
texlive-multido-svn18302.1.42-33.fc26.2.noarch
texlive-glyphlist-svn28576.0-33.fc26.2.noarch
texlive-setspace-svn24881.6.7a-33.fc26.2.noarch
texlive-mathtools-svn38833-33.fc26.2.noarch
texlive-ncntrsbk-svn31835.0-33.fc26.2.noarch
texlive-dvisvgm-def-svn41011-33.fc26.2.noarch
texlive-ifetex-svn24853.1.2-33.fc26.2.noarch
texlive-parskip-svn19963.2.0-33.fc26.2.noarch
texlive-bera-svn20031.0-33.fc26.2.noarch
texlive-pgf-svn40966-33.fc26.2.noarch
texlive-auto-pst-pdf-svn23723.0.6-33.fc26.2.noarch
texlive-ctable-svn38672-33.fc26.2.noarch
texlive-typehtml-svn17134.0-33.fc26.2.noarch
mesa-libGLES-17.2.4-2.fc26.s390x
vte291-0.48.4-1.fc26.s390x
libdrm-devel-2.4.88-1.fc26.s390x
libcephfs_jni1-10.2.7-2.fc26.s390x
bzip2-devel-1.0.6-22.fc26.s390x
expat-devel-2.2.4-1.fc26.s390x
libsepol-devel-2.6-2.fc26.s390x
glib2-static-2.52.3-2.fc26.s390x
virglrenderer-devel-0.6.0-1.20170210git76b3da97b.fc26.s390x
yum-utils-1.1.31-512.fc26.noarch
parted-3.2-24.fc26.s390x
python3-beautifulsoup4-4.6.0-1.fc26.noarch
python-bunch-1.0.1-10.fc26.noarch
perl-Time-HiRes-1.9746-1.fc26.s390x
lz4-1.8.0-1.fc26.s390x
nss-util-3.34.0-1.0.fc26.s390x
openssh-clients-7.5p1-4.fc26.s390x
chrony-3.2-1.fc26.s390x
dnf-conf-2.7.5-2.fc26.noarch
glusterfs-server-3.10.8-1.fc26.s390x
sssd-client-1.16.0-4.fc26.s390x
man-db-2.7.6.1-8.fc26.s390x
bodhi-client-2.12.2-3.fc26.noarch
perl-Module-CoreList-5.20171120-1.fc26.noarch
hawkey-0.6.4-3.fc25.s390x
python-srpm-macros-3-20.fc26.noarch
perl-srpm-macros-1-21.fc26.noarch
expat-2.2.4-1.fc26.s390x
chkconfig-1.10-1.fc26.s390x
findutils-4.6.0-12.fc26.s390x
mesa-libwayland-egl-17.2.4-2.fc26.s390x
procps-ng-3.3.10-13.fc26.s390x
mesa-libglapi-17.2.4-2.fc26.s390x
perl-Unicode-Normalize-1.25-366.fc26.s390x
perl-IO-Socket-IP-0.39-1.fc26.noarch
hunspell-en-US-0.20140811.1-6.fc26.noarch
libxcb-1.12-3.fc26.s390x
libgo-devel-7.2.1-2.fc26.s390x
perl-Pod-Escapes-1.07-366.fc26.noarch
perl-Pod-Usage-1.69-2.fc26.noarch
libtheora-1.1.1-15.fc26.s390x
tcp_wrappers-7.6-85.fc26.s390x
coreutils-8.27-7.fc26.s390x
libmount-2.30.2-1.fc26.s390x
python2-iniparse-0.4-24.fc26.noarch
python2-decorator-4.0.11-2.fc26.noarch
ModemManager-glib-1.6.10-1.fc26.s390x
python3-decorator-4.0.11-2.fc26.noarch
python3-cffi-1.9.1-2.fc26.s390x
python-bugzilla-cli-2.1.0-1.fc26.noarch
python2-funcsigs-1.0.2-5.fc26.noarch
python2-babel-2.3.4-5.fc26.noarch
python-bugzilla-2.1.0-1.fc26.noarch
libradosstriper1-10.2.7-2.fc26.s390x
snappy-1.1.4-3.fc26.s390x
dtc-1.4.5-1.fc26.s390x
libmpcdec-1.2.6-17.fc26.s390x
rpm-libs-4.13.0.2-1.fc26.s390x
python-urlgrabber-3.10.1-11.fc26.noarch
sysfsutils-2.1.0-20.fc26.s390x
python3-hawkey-0.11.1-1.fc26.s390x
python3-dnf-plugins-core-2.1.5-1.fc26.noarch
ethtool-4.13-1.fc26.s390x
iputils-20161105-5.fc26.s390x
plymouth-scripts-0.9.3-0.7.20160620git0e65b86c.fc26.s390x
cronie-1.5.1-5.fc26.s390x
libini_config-1.3.1-34.fc26.s390x
libX11-1.6.5-2.fc26.s390x
libglvnd-egl-1.0.0-1.fc26.s390x
texlive-kpathsea-svn41139-33.fc26.2.noarch
texlive-thumbpdf-bin-svn6898.0-33.20160520.fc26.2.noarch
texlive-subfig-svn15878.1.3-33.fc26.2.noarch
texlive-gsftopk-bin-svn40473-33.20160520.fc26.2.s390x
texlive-tex-ini-files-svn40533-33.fc26.2.noarch
texlive-qstest-svn15878.0-33.fc26.2.noarch
texlive-palatino-svn31835.0-33.fc26.2.noarch
texlive-ec-svn25033.1.0-33.fc26.2.noarch
texlive-iftex-svn29654.0.2-33.fc26.2.noarch
texlive-pslatex-svn16416.0-33.fc26.2.noarch
texlive-algorithms-svn38085.0.1-33.fc26.2.noarch
texlive-filehook-svn24280.0.5d-33.fc26.2.noarch
texlive-pst-node-svn40743-33.fc26.2.noarch
texlive-rotating-svn16832.2.16b-33.fc26.2.noarch
texlive-seminar-svn34011.1.62-33.fc26.2.noarch
gtk3-3.22.21-2.fc26.s390x
libuuid-devel-2.30.2-1.fc26.s390x
java-1.8.0-openjdk-1.8.0.151-1.b12.fc26.s390x
libXinerama-devel-1.1.3-7.fc26.s390x
emacs-common-25.3-3.fc26.s390x
gtk3-devel-3.22.21-2.fc26.s390x
fedora-packager-0.6.0.1-2.fc26.noarch
libxml2-devel-2.9.4-2.fc26.s390x
snappy-devel-1.1.4-3.fc26.s390x
python2-dnf-plugin-migrate-2.1.5-1.fc26.noarch
authconfig-7.0.1-2.fc26.s390x
newt-python3-0.52.20-1.fc26.s390x
python-decoratortools-1.8-13.fc26.noarch
python-systemd-doc-234-1.fc26.s390x
openssl-libs-1.1.0g-1.fc26.s390x
git-core-2.13.6-2.fc26.s390x
python3-dnf-plugin-system-upgrade-2.0.4-1.fc26.noarch
glusterfs-libs-3.10.8-1.fc26.s390x
ca-certificates-2017.2.20-1.0.fc26.noarch
unbound-libs-1.6.7-1.fc26.s390x
libsss_certmap-1.16.0-4.fc26.s390x
glusterfs-api-devel-3.10.8-1.fc26.s390x
selinux-policy-targeted-3.13.1-260.17.fc26.noarch
publicsuffix-list-dafsa-20171028-1.fc26.noarch
gpg-pubkey-a0a7badb-52844296
gpg-pubkey-e372e838-56fd7943
gpg-pubkey-3b921d09-57a87096
google-roboto-slab-fonts-1.100263-0.5.20150923git.fc26.noarch
libreport-filesystem-2.9.1-3.fc26.s390x
glibc-all-langpacks-2.25-12.fc26.s390x
libcom_err-1.43.4-2.fc26.s390x
libffi-3.1-12.fc26.s390x
keyutils-libs-1.5.10-1.fc26.s390x
diffutils-3.5-3.fc26.s390x
apr-util-1.5.4-6.fc26.s390x
bluez-libs-5.46-6.fc26.s390x
libksba-1.3.5-3.fc26.s390x
ncurses-6.0-8.20170212.fc26.s390x
gsm-1.0.17-1.fc26.s390x
libteam-1.27-1.fc26.s390x
perl-Fedora-VSP-0.001-5.fc26.noarch
libusb-0.1.5-8.fc26.s390x
acl-2.2.52-15.fc26.s390x
dwz-0.12-3.fc26.s390x
libblkid-2.30.2-1.fc26.s390x
polkit-libs-0.113-8.fc26.s390x
dbus-python-1.2.4-6.fc26.s390x
gts-0.7.6-30.20121130.fc26.s390x
libfdisk-2.30.2-1.fc26.s390x
python3-pycparser-2.14-10.fc26.noarch
python3-bugzilla-2.1.0-1.fc26.noarch
python2-docutils-0.13.1-4.fc26.noarch
pytz-2016.10-4.fc26.noarch
python2-requests-2.13.0-1.fc26.noarch
libcephfs-devel-10.2.7-2.fc26.s390x
ncurses-c++-libs-6.0-8.20170212.fc26.s390x
GeoIP-1.6.11-1.fc26.s390x
liblockfile-1.09-5.fc26.s390x
rpm-plugin-selinux-4.13.0.2-1.fc26.s390x
systemtap-devel-3.2-2.fc26.s390x
libsysfs-2.1.0-20.fc26.s390x
libdnf-0.11.1-1.fc26.s390x
libgfortran-7.2.1-2.fc26.s390x
mesa-libgbm-17.2.4-2.fc26.s390x
dracut-046-3.1.fc26.s390x
lvm2-libs-2.02.168-6.fc26.s390x
libXfixes-5.0.3-2.fc26.s390x
brlapi-0.6.6-5.fc26.s390x
texlive-metafont-svn40793-33.fc26.2.noarch
texlive-graphics-cfg-svn40269-33.fc26.2.noarch
texlive-mptopdf-svn41282-33.fc26.2.noarch
texlive-makeindex-bin-svn40473-33.20160520.fc26.2.s390x
texlive-texlive-scripts-bin-svn29741.0-33.20160520.fc26.2.noarch
texlive-sauerj-svn15878.0-33.fc26.2.noarch
texlive-txfonts-svn15878.0-33.fc26.2.noarch
texlive-filecontents-svn24250.1.3-33.fc26.2.noarch
texlive-lualibs-svn40370-33.fc26.2.noarch
texlive-section-svn20180.0-33.fc26.2.noarch
texlive-ucharcat-svn38907-33.fc26.2.noarch
texlive-hyperref-svn41396-33.fc26.2.noarch
texlive-pst-3d-svn17257.1.10-33.fc26.2.noarch
texlive-oberdiek-svn41346-33.fc26.2.noarch
texlive-ae-svn15878.1.4-33.fc26.2.noarch
texlive-collection-basic-svn41149-33.20160520.fc26.2.noarch
gnat-srpm-macros-4-2.fc26.noarch
glib2-devel-2.52.3-2.fc26.s390x
netpbm-progs-10.80.00-2.fc26.s390x
libXxf86vm-devel-1.1.4-4.fc26.s390x
nettle-devel-3.3-2.fc26.s390x
cairo-gobject-devel-1.14.10-1.fc26.s390x
fedora-rpm-macros-26-2.fc26.noarch
elfutils-devel-0.169-1.fc26.s390x
libidn-devel-1.33-2.fc26.s390x
s390utils-1.36.1-3.fc26.s390x
gcc-gfortran-7.2.1-2.fc26.s390x
libtool-2.4.6-17.fc26.s390x
python3-cssselect-0.9.2-4.fc26.noarch
python2-cssselect-0.9.2-4.fc26.noarch
bison-3.0.4-6.fc26.s390x
rootfiles-8.1-20.fc26.noarch
git-core-doc-2.13.6-2.fc26.s390x
vim-enhanced-8.0.1360-1.fc26.s390x
glusterfs-3.10.8-1.fc26.s390x
boost-system-1.63.0-10.fc26.s390x
gnutls-dane-3.5.16-4.fc26.s390x
pkgconf-m4-1.3.12-1.fc26.noarch
libcurl-devel-7.53.1-13.fc26.s390x
python3-urllib3-1.20-2.fc26.noarch
libsss_autofs-1.16.0-4.fc26.s390x
=== TEST BEGIN ===
Using CC: /home/fam/bin/cc
Install prefix    /var/tmp/patchew-tester-tmp-0t3s9f7b/src/install
BIOS directory    /var/tmp/patchew-tester-tmp-0t3s9f7b/src/install/share/qemu
firmware path     /var/tmp/patchew-tester-tmp-0t3s9f7b/src/install/share/qemu-firmware
binary directory  /var/tmp/patchew-tester-tmp-0t3s9f7b/src/install/bin
library directory /var/tmp/patchew-tester-tmp-0t3s9f7b/src/install/lib
module directory  /var/tmp/patchew-tester-tmp-0t3s9f7b/src/install/lib/qemu
libexec directory /var/tmp/patchew-tester-tmp-0t3s9f7b/src/install/libexec
include directory /var/tmp/patchew-tester-tmp-0t3s9f7b/src/install/include
config directory  /var/tmp/patchew-tester-tmp-0t3s9f7b/src/install/etc
local state directory   /var/tmp/patchew-tester-tmp-0t3s9f7b/src/install/var
Manual directory  /var/tmp/patchew-tester-tmp-0t3s9f7b/src/install/share/man
ELF interp prefix /usr/gnemul/qemu-%M
Source path       /var/tmp/patchew-tester-tmp-0t3s9f7b/src
GIT binary        git
GIT submodules    ui/keycodemapdb capstone
C compiler        /home/fam/bin/cc
Host C compiler   cc
C++ compiler      c++
Objective-C compiler /home/fam/bin/cc
ARFLAGS           rv
CFLAGS            -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -g 
QEMU_CFLAGS       -I/usr/include/pixman-1   -Werror -DHAS_LIBSSH2_SFTP_FSYNC -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -DNCURSES_WIDECHAR -D_GNU_SOURCE -D_DEFAULT_SOURCE  -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv  -Wexpansion-to-defined -Wendif-labels -Wno-shift-negative-value -Wno-missing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-declaration -Wold-style-definition -Wtype-limits -fstack-protector-strong -I/usr/include/p11-kit-1     -I/usr/include/libpng16  -I/usr/include/libdrm   -I$(SRC_PATH)/capstone/include
LDFLAGS           -Wl,--warn-common -m64 -g 
make              make
install           install
python            python -B
smbd              /usr/sbin/smbd
module support    no
host CPU          s390x
host big endian   yes
target list       aarch64-softmmu alpha-softmmu arm-softmmu cris-softmmu hppa-softmmu i386-softmmu lm32-softmmu m68k-softmmu microblazeel-softmmu microblaze-softmmu mips64el-softmmu mips64-softmmu mipsel-softmmu mips-softmmu moxie-softmmu nios2-softmmu or1k-softmmu ppc64-softmmu ppcemb-softmmu ppc-softmmu s390x-softmmu sh4eb-softmmu sh4-softmmu sparc64-softmmu sparc-softmmu tricore-softmmu unicore32-softmmu x86_64-softmmu xtensaeb-softmmu xtensa-softmmu aarch64_be-linux-user aarch64-linux-user alpha-linux-user armeb-linux-user arm-linux-user cris-linux-user hppa-linux-user i386-linux-user m68k-linux-user microblazeel-linux-user microblaze-linux-user mips64el-linux-user mips64-linux-user mipsel-linux-user mips-linux-user mipsn32el-linux-user mipsn32-linux-user nios2-linux-user or1k-linux-user ppc64abi32-linux-user ppc64le-linux-user ppc64-linux-user ppc-linux-user s390x-linux-user sh4eb-linux-user sh4-linux-user sparc32plus-linux-user sparc64-linux-user sparc-linux-user tilegx-linux-user x86_64-linux-user
gprof enabled     no
sparse enabled    no
strip binaries    yes
profiler          no
static build      no
SDL support       yes (2.0.7)
GTK support       yes (3.22.21)
GTK GL support    yes
VTE support       yes (0.48.4)
TLS priority      NORMAL
GNUTLS support    yes
GNUTLS rnd        yes
libgcrypt         no
libgcrypt kdf     no
nettle            yes (3.3)
nettle kdf        yes
libtasn1          yes
curses support    yes
virgl support     yes
curl support      yes
mingw32 support   no
Audio drivers     oss
Block whitelist (rw) 
Block whitelist (ro) 
VirtFS support    yes
Multipath support no
VNC support       yes
VNC SASL support  yes
VNC JPEG support  yes
VNC PNG support   yes
xen support       no
brlapi support    yes
bluez  support    yes
Documentation     yes
PIE               no
vde support       no
netmap support    no
Linux AIO support yes
ATTR/XATTR support yes
Install blobs     yes
KVM support       yes
HAX support       no
HVF support       no
TCG support       yes
TCG debug enabled no
TCG interpreter   no
malloc trim support yes
RDMA support      no
fdt support       yes
preadv support    yes
fdatasync         yes
madvise           yes
posix_madvise     yes
libcap-ng support yes
vhost-net support yes
vhost-scsi support yes
vhost-vsock support yes
vhost-user support yes
Trace backends    log
spice support     no 
rbd support       yes
xfsctl support    no
smartcard support yes
libusb            yes
usb net redir     yes
OpenGL support    yes
OpenGL dmabufs    yes
libiscsi support  yes
libnfs support    yes
build guest agent yes
QGA VSS support   no
QGA w32 disk info no
QGA MSI support   no
seccomp support   yes
coroutine backend ucontext
coroutine pool    yes
debug stack usage no
crypto afalg      no
GlusterFS support yes
gcov              gcov
gcov enabled      no
TPM support       yes
libssh2 support   yes
TPM passthrough   no
TPM emulator      yes
QOM debugging     yes
Live block migration yes
lzo support       yes
snappy support    yes
bzip2 support     yes
NUMA host support no
libxml2           yes
tcmalloc support  no
jemalloc support  no
avx2 optimization no
replication support yes
VxHS block device no
capstone          git
  GEN     aarch64-softmmu/config-devices.mak.tmp
  GEN     alpha-softmmu/config-devices.mak.tmp
  GEN     arm-softmmu/config-devices.mak.tmp
  GEN     cris-softmmu/config-devices.mak.tmp
  GEN     cris-softmmu/config-devices.mak
  GEN     alpha-softmmu/config-devices.mak
  GEN     arm-softmmu/config-devices.mak
  GEN     aarch64-softmmu/config-devices.mak
  GEN     i386-softmmu/config-devices.mak.tmp
  GEN     lm32-softmmu/config-devices.mak.tmp
  GEN     hppa-softmmu/config-devices.mak.tmp
  GEN     m68k-softmmu/config-devices.mak.tmp
  GEN     m68k-softmmu/config-devices.mak
  GEN     lm32-softmmu/config-devices.mak
  GEN     microblazeel-softmmu/config-devices.mak.tmp
  GEN     hppa-softmmu/config-devices.mak
  GEN     microblaze-softmmu/config-devices.mak.tmp
  GEN     mips64el-softmmu/config-devices.mak.tmp
  GEN     i386-softmmu/config-devices.mak
  GEN     microblaze-softmmu/config-devices.mak
  GEN     mips64-softmmu/config-devices.mak.tmp
  GEN     microblazeel-softmmu/config-devices.mak
  GEN     mipsel-softmmu/config-devices.mak.tmp
  GEN     mips-softmmu/config-devices.mak.tmp
  GEN     mips64el-softmmu/config-devices.mak
  GEN     moxie-softmmu/config-devices.mak.tmp
  GEN     mips-softmmu/config-devices.mak
  GEN     mipsel-softmmu/config-devices.mak
  GEN     mips64-softmmu/config-devices.mak
  GEN     nios2-softmmu/config-devices.mak.tmp
  GEN     moxie-softmmu/config-devices.mak
  GEN     or1k-softmmu/config-devices.mak.tmp
  GEN     ppc64-softmmu/config-devices.mak.tmp
  GEN     ppcemb-softmmu/config-devices.mak.tmp
  GEN     nios2-softmmu/config-devices.mak
  GEN     or1k-softmmu/config-devices.mak
  GEN     ppc-softmmu/config-devices.mak.tmp
  GEN     s390x-softmmu/config-devices.mak.tmp
  GEN     ppcemb-softmmu/config-devices.mak
  GEN     s390x-softmmu/config-devices.mak
  GEN     sh4eb-softmmu/config-devices.mak.tmp
  GEN     sh4-softmmu/config-devices.mak.tmp
  GEN     ppc64-softmmu/config-devices.mak
  GEN     ppc-softmmu/config-devices.mak
  GEN     sparc64-softmmu/config-devices.mak.tmp
  GEN     sparc-softmmu/config-devices.mak.tmp
  GEN     sparc-softmmu/config-devices.mak
  GEN     sh4eb-softmmu/config-devices.mak
  GEN     tricore-softmmu/config-devices.mak.tmp
  GEN     sh4-softmmu/config-devices.mak
  GEN     sparc64-softmmu/config-devices.mak
  GEN     unicore32-softmmu/config-devices.mak.tmp
  GEN     x86_64-softmmu/config-devices.mak.tmp
  GEN     xtensaeb-softmmu/config-devices.mak.tmp
  GEN     tricore-softmmu/config-devices.mak
  GEN     xtensa-softmmu/config-devices.mak.tmp
  GEN     unicore32-softmmu/config-devices.mak
  GEN     xtensaeb-softmmu/config-devices.mak
  GEN     aarch64_be-linux-user/config-devices.mak.tmp
  GEN     aarch64-linux-user/config-devices.mak.tmp
  GEN     xtensa-softmmu/config-devices.mak
  GEN     x86_64-softmmu/config-devices.mak
  GEN     alpha-linux-user/config-devices.mak.tmp
  GEN     armeb-linux-user/config-devices.mak.tmp
  GEN     aarch64-linux-user/config-devices.mak
  GEN     aarch64_be-linux-user/config-devices.mak
  GEN     arm-linux-user/config-devices.mak.tmp
  GEN     armeb-linux-user/config-devices.mak
  GEN     alpha-linux-user/config-devices.mak
  GEN     cris-linux-user/config-devices.mak.tmp
  GEN     hppa-linux-user/config-devices.mak.tmp
  GEN     i386-linux-user/config-devices.mak.tmp
  GEN     cris-linux-user/config-devices.mak
  GEN     arm-linux-user/config-devices.mak
  GEN     m68k-linux-user/config-devices.mak.tmp
  GEN     microblazeel-linux-user/config-devices.mak.tmp
  GEN     hppa-linux-user/config-devices.mak
  GEN     i386-linux-user/config-devices.mak
  GEN     microblaze-linux-user/config-devices.mak.tmp
  GEN     mips64el-linux-user/config-devices.mak.tmp
  GEN     m68k-linux-user/config-devices.mak
  GEN     microblazeel-linux-user/config-devices.mak
  GEN     mips64-linux-user/config-devices.mak.tmp
  GEN     mipsel-linux-user/config-devices.mak.tmp
  GEN     microblaze-linux-user/config-devices.mak
  GEN     mips64el-linux-user/config-devices.mak
  GEN     mips-linux-user/config-devices.mak.tmp
  GEN     mipsn32el-linux-user/config-devices.mak.tmp
  GEN     mipsel-linux-user/config-devices.mak
  GEN     mips64-linux-user/config-devices.mak
  GEN     mipsn32-linux-user/config-devices.mak.tmp
  GEN     nios2-linux-user/config-devices.mak.tmp
  GEN     mipsn32el-linux-user/config-devices.mak
  GEN     mips-linux-user/config-devices.mak
  GEN     or1k-linux-user/config-devices.mak.tmp
  GEN     ppc64abi32-linux-user/config-devices.mak.tmp
  GEN     mipsn32-linux-user/config-devices.mak
  GEN     nios2-linux-user/config-devices.mak
  GEN     ppc64le-linux-user/config-devices.mak.tmp
  GEN     ppc64-linux-user/config-devices.mak.tmp
  GEN     or1k-linux-user/config-devices.mak
  GEN     ppc64abi32-linux-user/config-devices.mak
  GEN     ppc-linux-user/config-devices.mak.tmp
  GEN     ppc64le-linux-user/config-devices.mak
  GEN     s390x-linux-user/config-devices.mak.tmp
  GEN     sh4eb-linux-user/config-devices.mak.tmp
  GEN     ppc64-linux-user/config-devices.mak
  GEN     sh4-linux-user/config-devices.mak.tmp
  GEN     s390x-linux-user/config-devices.mak
  GEN     sparc32plus-linux-user/config-devices.mak.tmp
  GEN     ppc-linux-user/config-devices.mak
  GEN     sh4eb-linux-user/config-devices.mak
  GEN     sparc64-linux-user/config-devices.mak.tmp
  GEN     sparc-linux-user/config-devices.mak.tmp
  GEN     sh4-linux-user/config-devices.mak
  GEN     sparc32plus-linux-user/config-devices.mak
  GEN     tilegx-linux-user/config-devices.mak.tmp
  GEN     x86_64-linux-user/config-devices.mak.tmp
  GEN     sparc64-linux-user/config-devices.mak
  GEN     sparc-linux-user/config-devices.mak
  GEN     config-host.h
  GEN     tilegx-linux-user/config-devices.mak
  GIT     ui/keycodemapdb capstone
  GEN     x86_64-linux-user/config-devices.mak
  GEN     qemu-options.def
  GEN     qapi-gen
  GEN     trace/generated-tcg-tracers.h
  GEN     trace/generated-helpers-wrappers.h
  GEN     trace/generated-helpers.h
  GEN     trace/generated-helpers.c
  GEN     module_block.h
  GEN     tests/test-qapi-gen
  GEN     trace-root.h
  GEN     util/trace.h
  GEN     crypto/trace.h
  GEN     io/trace.h
  GEN     migration/trace.h
  GEN     block/trace.h
  GEN     chardev/trace.h
  GEN     hw/block/trace.h
Submodule 'capstone' (git://git.qemu.org/capstone.git) registered for path 'capstone'
Submodule 'ui/keycodemapdb' (git://git.qemu.org/keycodemapdb.git) registered for path 'ui/keycodemapdb'
  GEN     hw/block/dataplane/trace.h
  GEN     hw/char/trace.h
Cloning into '/var/tmp/patchew-tester-tmp-0t3s9f7b/src/capstone'...
  GEN     hw/intc/trace.h
  GEN     hw/net/trace.h
  GEN     hw/virtio/trace.h
  GEN     hw/audio/trace.h
  GEN     hw/misc/trace.h
  GEN     hw/usb/trace.h
  GEN     hw/scsi/trace.h
  GEN     hw/nvram/trace.h
  GEN     hw/display/trace.h
  GEN     hw/input/trace.h
  GEN     hw/timer/trace.h
  GEN     hw/dma/trace.h
  GEN     hw/sparc/trace.h
  GEN     hw/sparc64/trace.h
  GEN     hw/sd/trace.h
  GEN     hw/isa/trace.h
  GEN     hw/mem/trace.h
  GEN     hw/i386/trace.h
  GEN     hw/i386/xen/trace.h
  GEN     hw/9pfs/trace.h
  GEN     hw/ppc/trace.h
  GEN     hw/pci/trace.h
  GEN     hw/pci-host/trace.h
  GEN     hw/s390x/trace.h
  GEN     hw/vfio/trace.h
  GEN     hw/acpi/trace.h
  GEN     hw/arm/trace.h
  GEN     hw/alpha/trace.h
  GEN     hw/hppa/trace.h
  GEN     hw/xen/trace.h
  GEN     hw/ide/trace.h
  GEN     ui/trace.h
  GEN     audio/trace.h
  GEN     net/trace.h
  GEN     target/arm/trace.h
  GEN     target/i386/trace.h
  GEN     target/mips/trace.h
  GEN     target/sparc/trace.h
  GEN     target/s390x/trace.h
  GEN     target/ppc/trace.h
  GEN     qom/trace.h
  GEN     linux-user/trace.h
  GEN     qapi/trace.h
  GEN     accel/tcg/trace.h
  GEN     accel/kvm/trace.h
  GEN     nbd/trace.h
  GEN     trace-root.c
  GEN     scsi/trace.h
  GEN     util/trace.c
  GEN     crypto/trace.c
  GEN     io/trace.c
  GEN     migration/trace.c
  GEN     block/trace.c
  GEN     chardev/trace.c
  GEN     hw/block/trace.c
  GEN     hw/block/dataplane/trace.c
  GEN     hw/char/trace.c
  GEN     hw/intc/trace.c
  GEN     hw/net/trace.c
  GEN     hw/virtio/trace.c
  GEN     hw/audio/trace.c
  GEN     hw/misc/trace.c
  GEN     hw/usb/trace.c
  GEN     hw/scsi/trace.c
  GEN     hw/nvram/trace.c
  GEN     hw/display/trace.c
  GEN     hw/input/trace.c
  GEN     hw/timer/trace.c
  GEN     hw/dma/trace.c
  GEN     hw/sparc/trace.c
  GEN     hw/sparc64/trace.c
  GEN     hw/sd/trace.c
  GEN     hw/isa/trace.c
  GEN     hw/mem/trace.c
  GEN     hw/i386/trace.c
  GEN     hw/i386/xen/trace.c
  GEN     hw/9pfs/trace.c
  GEN     hw/ppc/trace.c
  GEN     hw/pci/trace.c
  GEN     hw/pci-host/trace.c
  GEN     hw/s390x/trace.c
  GEN     hw/vfio/trace.c
  GEN     hw/acpi/trace.c
  GEN     hw/arm/trace.c
  GEN     hw/alpha/trace.c
  GEN     hw/hppa/trace.c
  GEN     hw/xen/trace.c
  GEN     hw/ide/trace.c
  GEN     ui/trace.c
  GEN     audio/trace.c
  GEN     net/trace.c
  GEN     target/arm/trace.c
  GEN     target/i386/trace.c
  GEN     target/mips/trace.c
  GEN     target/sparc/trace.c
  GEN     target/s390x/trace.c
  GEN     target/ppc/trace.c
  GEN     qom/trace.c
  GEN     linux-user/trace.c
  GEN     qapi/trace.c
  GEN     accel/tcg/trace.c
  GEN     accel/kvm/trace.c
  GEN     nbd/trace.c
  GEN     scsi/trace.c
  GEN     config-all-devices.mak
Cloning into '/var/tmp/patchew-tester-tmp-0t3s9f7b/src/ui/keycodemapdb'...
  GEN     ui/input-keymap-atset1-to-qcode.c
  GEN     ui/input-keymap-linux-to-qcode.c
  GEN     ui/input-keymap-qcode-to-atset1.c
  CC      cs.o
  GEN     ui/input-keymap-qcode-to-atset2.c
  GEN     ui/input-keymap-qcode-to-atset3.c
  GEN     ui/input-keymap-qcode-to-linux.c
  GEN     ui/input-keymap-qcode-to-qnum.c
  GEN     ui/input-keymap-qcode-to-sun.c
  GEN     ui/input-keymap-qnum-to-qcode.c
  GEN     ui/input-keymap-usb-to-qcode.c
  GEN     ui/input-keymap-win32-to-qcode.c
  CC      utils.o
  CC      SStream.o
  CC      MCInstrDesc.o
  CC      MCRegisterInfo.o
  CC      arch/ARM/ARMDisassembler.o
  CC      arch/ARM/ARMInstPrinter.o
  CC      arch/ARM/ARMMapping.o
  CC      arch/ARM/ARMModule.o
  CC      arch/AArch64/AArch64BaseInfo.o
  GEN     ui/input-keymap-x11-to-qcode.c
  GEN     ui/input-keymap-xorgevdev-to-qcode.c
  CC      arch/AArch64/AArch64Disassembler.o
  GEN     ui/input-keymap-xorgkbd-to-qcode.c
  CC      arch/AArch64/AArch64InstPrinter.o
  GEN     ui/input-keymap-xorgxquartz-to-qcode.c
  CC      arch/AArch64/AArch64Mapping.o
  CC      arch/AArch64/AArch64Module.o
  CC      arch/Mips/MipsDisassembler.o
  CC      arch/Mips/MipsInstPrinter.o
  GEN     ui/input-keymap-xorgxwin-to-qcode.c
  CC      arch/Mips/MipsMapping.o
  CC      arch/Mips/MipsModule.o
  CC      arch/PowerPC/PPCDisassembler.o
  CC      arch/PowerPC/PPCInstPrinter.o
  CC      arch/PowerPC/PPCMapping.o
  CC      arch/PowerPC/PPCModule.o
  CC      arch/Sparc/SparcDisassembler.o
  CC      arch/Sparc/SparcInstPrinter.o
  CC      arch/Sparc/SparcMapping.o
  CC      arch/Sparc/SparcModule.o
  CC      arch/SystemZ/SystemZDisassembler.o
  CC      arch/SystemZ/SystemZInstPrinter.o
  CC      arch/SystemZ/SystemZMapping.o
  CC      arch/SystemZ/SystemZModule.o
  CC      arch/SystemZ/SystemZMCTargetDesc.o
  CC      arch/X86/X86DisassemblerDecoder.o
  CC      arch/X86/X86Disassembler.o
  CC      arch/X86/X86IntelInstPrinter.o
  CC      arch/X86/X86ATTInstPrinter.o
  CC      arch/X86/X86Mapping.o
  CC      arch/X86/X86Module.o
  CC      arch/XCore/XCoreDisassembler.o
  CC      arch/XCore/XCoreInstPrinter.o
  CC      arch/XCore/XCoreMapping.o
  CC      arch/XCore/XCoreModule.o
  CC      MCInst.o
  AR      libcapstone.a
ar: creating /var/tmp/patchew-tester-tmp-0t3s9f7b/src/build/capstone/libcapstone.a
  GEN     docs/version.texi
  CC      tests/qemu-iotests/socket_scm_helper.o
  GEN     qemu-options.texi
  GEN     qemu-monitor.texi
  GEN     qemu-img-cmds.texi
  GEN     qemu-monitor-info.texi
  GEN     qemu-img.1
  GEN     qemu-nbd.8
  GEN     qemu-ga.8
  GEN     qga/qapi-generated/qapi-gen
  GEN     docs/qemu-block-drivers.7
  GEN     fsdev/virtfs-proxy-helper.1
  CC      qapi-builtin-types.o
  CC      qapi-builtin-visit.o
  CC      qapi-types.o
  CC      qapi/qapi-types-block-core.o
  CC      qapi/qapi-types-block.o
  CC      qapi/qapi-types-char.o
  CC      qapi/qapi-types-common.o
  CC      qapi/qapi-types-crypto.o
  CC      qapi/qapi-types-introspect.o
  CC      qapi/qapi-types-migration.o
  CC      qapi/qapi-types-misc.o
  CC      qapi/qapi-types-net.o
  CC      qapi/qapi-types-rocker.o
  CC      qapi/qapi-types-run-state.o
  CC      qapi/qapi-types-sockets.o
  CC      qapi/qapi-types-tpm.o
  CC      qapi/qapi-types-trace.o
  CC      qapi/qapi-types-transaction.o
  CC      qapi/qapi-types-ui.o
  CC      qmp-introspect.o
  CC      qapi-visit.o
  CC      qapi-event.o
  CC      qapi/qapi-visit-core.o
  CC      qapi/qapi-dealloc-visitor.o
  CC      qapi/qobject-input-visitor.o
  CC      qapi/qobject-output-visitor.o
  CC      qapi/qmp-registry.o
  CC      qapi/qmp-dispatch.o
  CC      qapi/string-input-visitor.o
  CC      qapi/string-output-visitor.o
  CC      qapi/opts-visitor.o
  CC      qapi/qapi-clone-visitor.o
  CC      qapi/qmp-event.o
  CC      qapi/qapi-util.o
  CC      qobject/qnull.o
  CC      qobject/qnum.o
  CC      qobject/qstring.o
  CC      qobject/qdict.o
  CC      qobject/qlist.o
  CC      qobject/qbool.o
  CC      qobject/qlit.o
  CC      qobject/qjson.o
  CC      qobject/qobject.o
  CC      qobject/json-lexer.o
  CC      qobject/json-streamer.o
  CC      qobject/json-parser.o
  CC      trace/control.o
  CC      trace/qmp.o
  CC      util/osdep.o
  CC      util/cutils.o
  CC      util/unicode.o
  CC      util/qemu-timer-common.o
  CC      util/bufferiszero.o
  CC      util/lockcnt.o
  CC      util/aiocb.o
  CC      util/async.o
  CC      util/thread-pool.o
  CC      util/qemu-timer.o
  CC      util/main-loop.o
  CC      util/iohandler.o
  CC      util/aio-posix.o
  CC      util/compatfd.o
  CC      util/event_notifier-posix.o
  CC      util/mmap-alloc.o
  CC      util/oslib-posix.o
  CC      util/qemu-openpty.o
  CC      util/qemu-thread-posix.o
  CC      util/memfd.o
  CC      util/envlist.o
  CC      util/path.o
  CC      util/module.o
  CC      util/host-utils.o
  CC      util/bitmap.o
  CC      util/bitops.o
  CC      util/hbitmap.o
  CC      util/fifo8.o
  CC      util/acl.o
  CC      util/cacheinfo.o
  CC      util/error.o
  CC      util/qemu-error.o
  CC      util/id.o
  CC      util/iov.o
  CC      util/qemu-config.o
  CC      util/qemu-sockets.o
  CC      util/uri.o
  CC      util/notify.o
  CC      util/qemu-option.o
  CC      util/qemu-progress.o
  CC      util/keyval.o
  CC      util/hexdump.o
  CC      util/crc32c.o
  CC      util/uuid.o
  CC      util/throttle.o
  CC      util/getauxval.o
  CC      util/readline.o
  CC      util/rcu.o
  CC      util/qemu-coroutine.o
  CC      util/qemu-coroutine-lock.o
  CC      util/qemu-coroutine-io.o
  CC      util/qemu-coroutine-sleep.o
  CC      util/coroutine-ucontext.o
  CC      util/buffer.o
  CC      util/timed-average.o
  CC      util/base64.o
  CC      util/log.o
  CC      util/pagesize.o
  CC      util/qdist.o
  CC      util/qht.o
  CC      util/range.o
  CC      util/stats64.o
  CC      util/systemd.o
  CC      trace-root.o
  CC      util/trace.o
  CC      crypto/trace.o
  CC      io/trace.o
  CC      migration/trace.o
  CC      block/trace.o
  CC      chardev/trace.o
  CC      hw/block/trace.o
  CC      hw/block/dataplane/trace.o
  CC      hw/char/trace.o
  CC      hw/intc/trace.o
  CC      hw/net/trace.o
  CC      hw/virtio/trace.o
  CC      hw/audio/trace.o
  CC      hw/misc/trace.o
  CC      hw/usb/trace.o
  CC      hw/scsi/trace.o
  CC      hw/nvram/trace.o
  CC      hw/display/trace.o
  CC      hw/input/trace.o
  CC      hw/timer/trace.o
  CC      hw/dma/trace.o
  CC      hw/sparc/trace.o
  CC      hw/sparc64/trace.o
  CC      hw/sd/trace.o
  CC      hw/isa/trace.o
  CC      hw/mem/trace.o
  CC      hw/i386/trace.o
  CC      hw/i386/xen/trace.o
  CC      hw/9pfs/trace.o
  CC      hw/ppc/trace.o
  CC      hw/pci/trace.o
  CC      hw/pci-host/trace.o
  CC      hw/s390x/trace.o
  CC      hw/vfio/trace.o
  CC      hw/acpi/trace.o
  CC      hw/arm/trace.o
  CC      hw/alpha/trace.o
  CC      hw/hppa/trace.o
  CC      hw/xen/trace.o
  CC      hw/ide/trace.o
  CC      ui/trace.o
  CC      audio/trace.o
  CC      net/trace.o
  CC      target/arm/trace.o
  CC      target/i386/trace.o
  CC      target/mips/trace.o
  CC      target/sparc/trace.o
  CC      target/s390x/trace.o
  CC      target/ppc/trace.o
  CC      qom/trace.o
  CC      linux-user/trace.o
  CC      qapi/trace.o
  CC      accel/tcg/trace.o
  CC      accel/kvm/trace.o
  CC      nbd/trace.o
  CC      scsi/trace.o
  CC      crypto/pbkdf-stub.o
  CC      stubs/arch-query-cpu-def.o
  CC      stubs/arch-query-cpu-model-expansion.o
  CC      stubs/arch-query-cpu-model-comparison.o
  CC      stubs/arch-query-cpu-model-baseline.o
  CC      stubs/bdrv-next-monitor-owned.o
  CC      stubs/blk-commit-all.o
  CC      stubs/blockdev-close-all-bdrv-states.o
  CC      stubs/cpu-get-clock.o
  CC      stubs/clock-warp.o
  CC      stubs/cpu-get-icount.o
  CC      stubs/dump.o
  CC      stubs/error-printf.o
  CC      stubs/fdset.o
  CC      stubs/gdbstub.o
  CC      stubs/get-vm-name.o
  CC      stubs/iothread.o
  CC      stubs/iothread-lock.o
  CC      stubs/is-daemonized.o
  CC      stubs/linux-aio.o
  CC      stubs/machine-init-done.o
  CC      stubs/migr-blocker.o
  CC      stubs/change-state-handler.o
  CC      stubs/monitor.o
  CC      stubs/notify-event.o
  CC      stubs/qtest.o
  CC      stubs/replay.o
  CC      stubs/runstate-check.o
  CC      stubs/set-fd-handler.o
  CC      stubs/slirp.o
  CC      stubs/sysbus.o
  CC      stubs/tpm.o
  CC      stubs/trace-control.o
  CC      stubs/uuid.o
  CC      stubs/vm-stop.o
  CC      stubs/vmstate.o
  CC      stubs/qmp_pc_dimm.o
  CC      stubs/target-monitor-defs.o
  CC      stubs/target-get-monitor-def.o
  CC      stubs/pc_madt_cpu_entry.o
  CC      stubs/vmgenid.o
  CC      stubs/xen-common.o
  CC      stubs/xen-hvm.o
  CC      stubs/pci-host-piix.o
  CC      qemu-keymap.o
  CC      ui/input-keymap.o
  CC      contrib/ivshmem-client/ivshmem-client.o
  CC      contrib/ivshmem-client/main.o
  CC      contrib/ivshmem-server/ivshmem-server.o
  CC      contrib/ivshmem-server/main.o
  CC      qemu-nbd.o
  CC      block.o
  CC      blockjob.o
  CC      qemu-io-cmds.o
In file included from /var/tmp/patchew-tester-tmp-0t3s9f7b/src/qemu-nbd.c:28:0:
/var/tmp/patchew-tester-tmp-0t3s9f7b/src/include/block/nbd.h:262:40: error: unknown type name ‘NbdServerRemoveMode’
 void nbd_export_remove(NBDExport *exp, NbdServerRemoveMode mode, Error **errp);
                                        ^~~~~~~~~~~~~~~~~~~
make: *** [/var/tmp/patchew-tester-tmp-0t3s9f7b/src/rules.mak:66: qemu-nbd.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from /var/tmp/patchew-tester-tmp-0t3s9f7b/src/block.c:29:0:
/var/tmp/patchew-tester-tmp-0t3s9f7b/src/include/block/nbd.h:262:40: error: unknown type name ‘NbdServerRemoveMode’
 void nbd_export_remove(NBDExport *exp, NbdServerRemoveMode mode, Error **errp);
                                        ^~~~~~~~~~~~~~~~~~~
make: *** [/var/tmp/patchew-tester-tmp-0t3s9f7b/src/rules.mak:66: block.o] Error 1
=== OUTPUT END ===

Test command exited with code: 2


---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@freelists.org

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 09/21] qapi: Don't absolutize include file name in error messages
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 09/21] qapi: Don't absolutize include file name in error messages Markus Armbruster
@ 2018-02-02 20:22   ` Eric Blake
  2018-02-03  9:08     ` Markus Armbruster
  2018-02-05 13:46   ` Marc-Andre Lureau
  1 sibling, 1 reply; 87+ messages in thread
From: Eric Blake @ 2018-02-02 20:22 UTC (permalink / raw)
  To: Markus Armbruster, qemu-devel; +Cc: marcandre.lureau, mdroth

[-- Attachment #1: Type: text/plain, Size: 1364 bytes --]

On 02/02/2018 07:03 AM, Markus Armbruster wrote:
> Error messages print absolute filenames of included files even gave a

s/even gave/even when given/

> relative one on the command line:
> 
>      PYTHONPATH=scripts python -B tests/qapi-schema/test-qapi.py tests/qapi-schema/include-cycle.json
>     In file included from tests/qapi-schema/include-cycle.json:1:
>     In file included from /work/armbru/qemu/tests/qapi-schema/include-cycle-b.json:1:
>     /work/armbru/qemu/tests/qapi-schema/include-cycle-c.json:1: Inclusion loop for include-cycle.json
> 
> Improve this to
> 
>     In file included from tests/qapi-schema/include-cycle.json:1:
>     In file included from tests/qapi-schema/include-cycle-b.json:1:
>     tests/qapi-schema/include-cycle-c.json:1: Inclusion loop for include-cycle.json

Nice, and makes developing new qapi tests a little less painful since
it's less modification to qapi-schema/*.err additions.

> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  scripts/qapi/common.py                | 12 ++++++------
>  tests/qapi-schema/include-no-file.err |  2 +-
>  2 files changed, 7 insertions(+), 7 deletions(-)
> 

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code
  2018-02-02 13:03 [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code Markus Armbruster
                   ` (25 preceding siblings ...)
  2018-02-02 20:11 ` no-reply
@ 2018-02-02 21:13 ` no-reply
  2018-02-02 22:14 ` no-reply
  2018-02-03 11:30 ` Markus Armbruster
  28 siblings, 0 replies; 87+ messages in thread
From: no-reply @ 2018-02-02 21:13 UTC (permalink / raw)
  To: armbru; +Cc: famz, qemu-devel, marcandre.lureau, mdroth

Hi,

This series failed docker-quick@centos6 build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

Type: series
Message-id: 20180202130336.24719-1-armbru@redhat.com
Subject: [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code

=== TEST SCRIPT BEGIN ===
#!/bin/bash
set -e
git submodule update --init dtc
# Let docker tests dump environment info
export SHOW_ENV=1
export J=8
time make docker-test-quick@centos6
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
Switched to a new branch 'test'
20edfbb769 qapi: Empty out qapi-schema.json
908a02511e Include less of qapi-types.h
cc0f486390 qapi/types: Generate separate .h, .c for each module
da8bb99aca qapi/common: Fix guardname() for funny filenames
c8a5aa0179 qapi/types qapi/visit: Generate built-in stuff into separate files
799da1022d qapi/types qapi/visit: Make visitors use QAPIGen more
1755f6ed36 qapi: Record 'include' directives in intermediate representation
4e1183baa6 qapi: Generate in source order
b9771d2e65 qapi: Record 'include' directives in parse tree
656629e139 qapi: Concentrate QAPISchemaParser.exprs updates in .__init__()
1bc777d460 qapi: Lift error reporting from QAPISchema.__init__() to callers
c531a76a97 qapi/common: Eliminate QAPISchema.exprs
7f7062dc58 qapi: Don't absolutize include file name in error messages
bd75734a2c qapi: Touch generated files only when they change
a4e94e3e75 qapi: Move parse_command_line() next to its only use
b9b12fa6c6 qapi-gen: New common driver for code and doc generators
3a56fc45c2 qapi: Turn generators into modules
c09593eb74 qapi: Reduce use of global variables in generators some
4e457ceed8 qapi: New classes QAPIGenC, QAPIGenH, QAPIGenDoc
d969856a53 qapi: Generate up-to-date copyright notice
a295c600fc qapi: Streamline boilerplate comment generation

=== OUTPUT BEGIN ===
Submodule 'dtc' (git://git.qemu-project.org/dtc.git) registered for path 'dtc'
Cloning into '/var/tmp/patchew-tester-tmp-ongo5ce8/src/dtc'...
Submodule path 'dtc': checked out 'e54388015af1fb4bf04d0bca99caba1074d9cc42'
  BUILD   centos6
  GEN     /var/tmp/patchew-tester-tmp-ongo5ce8/src/docker-src.2018-02-02-16.12.30.11185/qemu.tar
Cloning into '/var/tmp/patchew-tester-tmp-ongo5ce8/src/docker-src.2018-02-02-16.12.30.11185/qemu.tar.vroot'...
done.
Your branch is up-to-date with 'origin/test'.
Submodule 'dtc' (git://git.qemu-project.org/dtc.git) registered for path 'dtc'
Cloning into '/var/tmp/patchew-tester-tmp-ongo5ce8/src/docker-src.2018-02-02-16.12.30.11185/qemu.tar.vroot/dtc'...
Submodule path 'dtc': checked out 'e54388015af1fb4bf04d0bca99caba1074d9cc42'
Submodule 'ui/keycodemapdb' (git://git.qemu.org/keycodemapdb.git) registered for path 'ui/keycodemapdb'
Cloning into '/var/tmp/patchew-tester-tmp-ongo5ce8/src/docker-src.2018-02-02-16.12.30.11185/qemu.tar.vroot/ui/keycodemapdb'...
Submodule path 'ui/keycodemapdb': checked out '10739aa26051a5d49d88132604539d3ed085e72e'
  COPY    RUNNER
    RUN test-quick in qemu:centos6 
Packages installed:
SDL-devel-1.2.14-7.el6_7.1.x86_64
bison-2.4.1-5.el6.x86_64
bzip2-devel-1.0.5-7.el6_0.x86_64
ccache-3.1.6-2.el6.x86_64
csnappy-devel-0-6.20150729gitd7bc683.el6.x86_64
flex-2.5.35-9.el6.x86_64
gcc-4.4.7-18.el6.x86_64
gettext-0.17-18.el6.x86_64
git-1.7.1-9.el6_9.x86_64
glib2-devel-2.28.8-9.el6.x86_64
libepoxy-devel-1.2-3.el6.x86_64
libfdt-devel-1.4.0-1.el6.x86_64
librdmacm-devel-1.0.21-0.el6.x86_64
lzo-devel-2.03-3.1.el6_5.1.x86_64
make-3.81-23.el6.x86_64
mesa-libEGL-devel-11.0.7-4.el6.x86_64
mesa-libgbm-devel-11.0.7-4.el6.x86_64
package g++ is not installed
pixman-devel-0.32.8-1.el6.x86_64
spice-glib-devel-0.26-8.el6.x86_64
spice-server-devel-0.12.4-16.el6.x86_64
tar-1.23-15.el6_8.x86_64
vte-devel-0.25.1-9.el6.x86_64
xen-devel-4.6.6-2.el6.x86_64
zlib-devel-1.2.3-29.el6.x86_64

Environment variables:
PACKAGES=bison     bzip2-devel     ccache     csnappy-devel     flex     g++     gcc     gettext     git     glib2-devel     libepoxy-devel     libfdt-devel     librdmacm-devel     lzo-devel     make     mesa-libEGL-devel     mesa-libgbm-devel     pixman-devel     SDL-devel     spice-glib-devel     spice-server-devel     tar     vte-devel     xen-devel     zlib-devel
HOSTNAME=1c5da51c1a21
MAKEFLAGS= -j8
J=8
CCACHE_DIR=/var/tmp/ccache
EXTRA_CONFIGURE_OPTS=
V=
SHOW_ENV=1
PATH=/usr/lib/ccache:/usr/lib64/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PWD=/
TARGET_LIST=
SHLVL=1
HOME=/root
TEST_DIR=/tmp/qemu-test
FEATURES= dtc
DEBUG=
_=/usr/bin/env

Configure options:
--enable-werror --target-list=x86_64-softmmu,aarch64-softmmu --prefix=/tmp/qemu-test/install
No C++ compiler available; disabling C++ specific optional code
Install prefix    /tmp/qemu-test/install
BIOS directory    /tmp/qemu-test/install/share/qemu
firmware path     /tmp/qemu-test/install/share/qemu-firmware
binary directory  /tmp/qemu-test/install/bin
library directory /tmp/qemu-test/install/lib
module directory  /tmp/qemu-test/install/lib/qemu
libexec directory /tmp/qemu-test/install/libexec
include directory /tmp/qemu-test/install/include
config directory  /tmp/qemu-test/install/etc
local state directory   /tmp/qemu-test/install/var
Manual directory  /tmp/qemu-test/install/share/man
ELF interp prefix /usr/gnemul/qemu-%M
Source path       /tmp/qemu-test/src
GIT binary        git
GIT submodules    
C compiler        cc
Host C compiler   cc
C++ compiler      
Objective-C compiler cc
ARFLAGS           rv
CFLAGS            -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -g 
QEMU_CFLAGS       -I/usr/include/pixman-1   -I$(SRC_PATH)/dtc/libfdt -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include   -DNCURSES_WIDECHAR   -fPIE -DPIE -m64 -mcx16 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv  -Wendif-labels -Wno-missing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-declaration -Wold-style-definition -Wtype-limits -fstack-protector-all -Wno-missing-braces  -I/usr/include/libpng12   -I/usr/include/libdrm     -I/usr/include/spice-server -I/usr/include/cacard -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/nss3 -I/usr/include/nspr4 -I/usr/include/spice-1  
LDFLAGS           -Wl,--warn-common -Wl,-z,relro -Wl,-z,now -pie -m64 -g 
make              make
install           install
python            python -B
smbd              /usr/sbin/smbd
module support    no
host CPU          x86_64
host big endian   no
target list       x86_64-softmmu aarch64-softmmu
gprof enabled     no
sparse enabled    no
strip binaries    yes
profiler          no
static build      no
SDL support       yes (1.2.14)
GTK support       yes (2.24.23)
GTK GL support    no
VTE support       yes (0.25.1)
TLS priority      NORMAL
GNUTLS support    no
GNUTLS rnd        no
libgcrypt         no
libgcrypt kdf     no
nettle            no 
nettle kdf        no
libtasn1          no
curses support    yes
virgl support     no
curl support      no
mingw32 support   no
Audio drivers     oss
Block whitelist (rw) 
Block whitelist (ro) 
VirtFS support    no
Multipath support no
VNC support       yes
VNC SASL support  no
VNC JPEG support  yes
VNC PNG support   yes
xen support       yes
xen ctrl version  40600
pv dom build      no
brlapi support    no
bluez  support    no
Documentation     no
PIE               yes
vde support       no
netmap support    no
Linux AIO support no
ATTR/XATTR support yes
Install blobs     yes
KVM support       yes
HAX support       no
HVF support       no
TCG support       yes
TCG debug enabled no
TCG interpreter   no
malloc trim support yes
RDMA support      yes
fdt support       yes
preadv support    yes
fdatasync         yes
madvise           yes
posix_madvise     yes
libcap-ng support no
vhost-net support yes
vhost-scsi support yes
vhost-vsock support yes
vhost-user support yes
Trace backends    log
spice support     yes (0.12.6/0.12.4)
rbd support       no
xfsctl support    no
smartcard support yes
libusb            no
usb net redir     no
OpenGL support    yes
OpenGL dmabufs    no
libiscsi support  no
libnfs support    no
build guest agent yes
QGA VSS support   no
QGA w32 disk info no
QGA MSI support   no
seccomp support   no
coroutine backend ucontext
coroutine pool    yes
debug stack usage no
crypto afalg      no
GlusterFS support no
gcov              gcov
gcov enabled      no
TPM support       yes
libssh2 support   no
TPM passthrough   yes
TPM emulator      yes
QOM debugging     yes
Live block migration yes
lzo support       yes
snappy support    no
bzip2 support     yes
NUMA host support no
libxml2           no
tcmalloc support  no
jemalloc support  no
avx2 optimization no
replication support yes
VxHS block device no
capstone          no

WARNING: Use of GTK 2.0 is deprecated and will be removed in
WARNING: future releases. Please switch to using GTK 3.0

WARNING: Use of SDL 1.2 is deprecated and will be removed in
WARNING: future releases. Please switch to using SDL 2.0
  GEN     x86_64-softmmu/config-devices.mak.tmp
  GEN     aarch64-softmmu/config-devices.mak.tmp
  GEN     qemu-options.def
  GEN     config-host.h
  GEN     qapi-gen
  GEN     trace/generated-helpers-wrappers.h
  GEN     trace/generated-tcg-tracers.h
  GEN     trace/generated-helpers.h
  GEN     trace/generated-helpers.c
  GEN     aarch64-softmmu/config-devices.mak
  GEN     x86_64-softmmu/config-devices.mak
  GEN     module_block.h
  GEN     ui/input-keymap-linux-to-qcode.c
  GEN     ui/input-keymap-atset1-to-qcode.c
  GEN     ui/input-keymap-qcode-to-atset1.c
  GEN     ui/input-keymap-qcode-to-atset2.c
  GEN     ui/input-keymap-qcode-to-atset3.c
  GEN     ui/input-keymap-qcode-to-linux.c
  GEN     ui/input-keymap-qcode-to-qnum.c
  GEN     ui/input-keymap-qcode-to-sun.c
  GEN     ui/input-keymap-qnum-to-qcode.c
  GEN     ui/input-keymap-usb-to-qcode.c
  GEN     ui/input-keymap-win32-to-qcode.c
  GEN     ui/input-keymap-x11-to-qcode.c
  GEN     ui/input-keymap-xorgevdev-to-qcode.c
  GEN     ui/input-keymap-xorgxquartz-to-qcode.c
  GEN     ui/input-keymap-xorgkbd-to-qcode.c
  GEN     ui/input-keymap-xorgxwin-to-qcode.c
  GEN     tests/test-qapi-gen
  GEN     trace-root.h
  GEN     util/trace.h
  GEN     crypto/trace.h
  GEN     io/trace.h
  GEN     migration/trace.h
  GEN     block/trace.h
  GEN     chardev/trace.h
  GEN     hw/block/trace.h
  GEN     hw/block/dataplane/trace.h
  GEN     hw/char/trace.h
  GEN     hw/intc/trace.h
  GEN     hw/net/trace.h
  GEN     hw/virtio/trace.h
  GEN     hw/audio/trace.h
  GEN     hw/misc/trace.h
  GEN     hw/usb/trace.h
  GEN     hw/scsi/trace.h
  GEN     hw/nvram/trace.h
  GEN     hw/display/trace.h
  GEN     hw/input/trace.h
  GEN     hw/timer/trace.h
  GEN     hw/dma/trace.h
  GEN     hw/sparc/trace.h
  GEN     hw/sparc64/trace.h
  GEN     hw/sd/trace.h
  GEN     hw/isa/trace.h
  GEN     hw/mem/trace.h
  GEN     hw/i386/trace.h
  GEN     hw/i386/xen/trace.h
  GEN     hw/9pfs/trace.h
  GEN     hw/ppc/trace.h
  GEN     hw/pci/trace.h
  GEN     hw/pci-host/trace.h
  GEN     hw/s390x/trace.h
  GEN     hw/vfio/trace.h
  GEN     hw/acpi/trace.h
  GEN     hw/arm/trace.h
  GEN     hw/alpha/trace.h
  GEN     hw/hppa/trace.h
  GEN     hw/xen/trace.h
  GEN     hw/ide/trace.h
  GEN     ui/trace.h
  GEN     audio/trace.h
  GEN     net/trace.h
  GEN     target/arm/trace.h
  GEN     target/i386/trace.h
  GEN     target/mips/trace.h
  GEN     target/sparc/trace.h
  GEN     target/s390x/trace.h
  GEN     target/ppc/trace.h
  GEN     qom/trace.h
  GEN     linux-user/trace.h
  GEN     qapi/trace.h
  GEN     accel/tcg/trace.h
  GEN     accel/kvm/trace.h
  GEN     nbd/trace.h
  GEN     scsi/trace.h
  GEN     trace-root.c
  GEN     util/trace.c
  GEN     crypto/trace.c
  GEN     io/trace.c
  GEN     migration/trace.c
  GEN     block/trace.c
  GEN     chardev/trace.c
  GEN     hw/block/trace.c
  GEN     hw/block/dataplane/trace.c
  GEN     hw/char/trace.c
  GEN     hw/intc/trace.c
  GEN     hw/net/trace.c
  GEN     hw/virtio/trace.c
  GEN     hw/audio/trace.c
  GEN     hw/misc/trace.c
  GEN     hw/usb/trace.c
  GEN     hw/scsi/trace.c
  GEN     hw/nvram/trace.c
  GEN     hw/display/trace.c
  GEN     hw/input/trace.c
  GEN     hw/timer/trace.c
  GEN     hw/dma/trace.c
  GEN     hw/sparc/trace.c
  GEN     hw/sparc64/trace.c
  GEN     hw/sd/trace.c
  GEN     hw/isa/trace.c
  GEN     hw/mem/trace.c
  GEN     hw/i386/trace.c
  GEN     hw/i386/xen/trace.c
  GEN     hw/9pfs/trace.c
  GEN     hw/ppc/trace.c
  GEN     hw/pci/trace.c
  GEN     hw/pci-host/trace.c
  GEN     hw/s390x/trace.c
  GEN     hw/vfio/trace.c
  GEN     hw/acpi/trace.c
  GEN     hw/arm/trace.c
  GEN     hw/alpha/trace.c
  GEN     hw/hppa/trace.c
  GEN     hw/xen/trace.c
  GEN     hw/ide/trace.c
  GEN     ui/trace.c
  GEN     audio/trace.c
  GEN     net/trace.c
  GEN     target/arm/trace.c
  GEN     target/i386/trace.c
  GEN     target/mips/trace.c
  GEN     target/sparc/trace.c
  GEN     target/s390x/trace.c
  GEN     target/ppc/trace.c
  GEN     qom/trace.c
  GEN     linux-user/trace.c
  GEN     qapi/trace.c
  GEN     accel/tcg/trace.c
  GEN     accel/kvm/trace.c
  GEN     nbd/trace.c
  GEN     scsi/trace.c
  GEN     config-all-devices.mak
	 DEP /tmp/qemu-test/src/dtc/tests/dumptrees.c
	 DEP /tmp/qemu-test/src/dtc/tests/trees.S
	 DEP /tmp/qemu-test/src/dtc/tests/testutils.c
	 DEP /tmp/qemu-test/src/dtc/tests/value-labels.c
	 DEP /tmp/qemu-test/src/dtc/tests/asm_tree_dump.c
	 DEP /tmp/qemu-test/src/dtc/tests/truncated_property.c
	 DEP /tmp/qemu-test/src/dtc/tests/check_path.c
	 DEP /tmp/qemu-test/src/dtc/tests/overlay_bad_fixup.c
	 DEP /tmp/qemu-test/src/dtc/tests/overlay.c
	 DEP /tmp/qemu-test/src/dtc/tests/subnode_iterate.c
	 DEP /tmp/qemu-test/src/dtc/tests/property_iterate.c
	 DEP /tmp/qemu-test/src/dtc/tests/integer-expressions.c
	 DEP /tmp/qemu-test/src/dtc/tests/utilfdt_test.c
	 DEP /tmp/qemu-test/src/dtc/tests/path_offset_aliases.c
	 DEP /tmp/qemu-test/src/dtc/tests/add_subnode_with_nops.c
	 DEP /tmp/qemu-test/src/dtc/tests/dtb_reverse.c
	 DEP /tmp/qemu-test/src/dtc/tests/dtbs_equal_unordered.c
	 DEP /tmp/qemu-test/src/dtc/tests/dtbs_equal_ordered.c
	 DEP /tmp/qemu-test/src/dtc/tests/extra-terminating-null.c
	 DEP /tmp/qemu-test/src/dtc/tests/incbin.c
	 DEP /tmp/qemu-test/src/dtc/tests/boot-cpuid.c
	 DEP /tmp/qemu-test/src/dtc/tests/phandle_format.c
	 DEP /tmp/qemu-test/src/dtc/tests/path-references.c
	 DEP /tmp/qemu-test/src/dtc/tests/references.c
	 DEP /tmp/qemu-test/src/dtc/tests/string_escapes.c
	 DEP /tmp/qemu-test/src/dtc/tests/propname_escapes.c
	 DEP /tmp/qemu-test/src/dtc/tests/appendprop2.c
	 DEP /tmp/qemu-test/src/dtc/tests/appendprop1.c
	 DEP /tmp/qemu-test/src/dtc/tests/del_node.c
	 DEP /tmp/qemu-test/src/dtc/tests/del_property.c
	 DEP /tmp/qemu-test/src/dtc/tests/setprop.c
	 DEP /tmp/qemu-test/src/dtc/tests/set_name.c
	 DEP /tmp/qemu-test/src/dtc/tests/rw_tree1.c
	 DEP /tmp/qemu-test/src/dtc/tests/open_pack.c
	 DEP /tmp/qemu-test/src/dtc/tests/nopulate.c
	 DEP /tmp/qemu-test/src/dtc/tests/mangle-layout.c
	 DEP /tmp/qemu-test/src/dtc/tests/move_and_save.c
	 DEP /tmp/qemu-test/src/dtc/tests/sw_tree1.c
	 DEP /tmp/qemu-test/src/dtc/tests/nop_node.c
	 DEP /tmp/qemu-test/src/dtc/tests/nop_property.c
	 DEP /tmp/qemu-test/src/dtc/tests/setprop_inplace.c
	 DEP /tmp/qemu-test/src/dtc/tests/stringlist.c
	 DEP /tmp/qemu-test/src/dtc/tests/addr_size_cells.c
	 DEP /tmp/qemu-test/src/dtc/tests/notfound.c
	 DEP /tmp/qemu-test/src/dtc/tests/sized_cells.c
	 DEP /tmp/qemu-test/src/dtc/tests/char_literal.c
	 DEP /tmp/qemu-test/src/dtc/tests/get_alias.c
	 DEP /tmp/qemu-test/src/dtc/tests/node_offset_by_compatible.c
	 DEP /tmp/qemu-test/src/dtc/tests/node_check_compatible.c
	 DEP /tmp/qemu-test/src/dtc/tests/node_offset_by_phandle.c
	 DEP /tmp/qemu-test/src/dtc/tests/node_offset_by_prop_value.c
	 DEP /tmp/qemu-test/src/dtc/tests/parent_offset.c
	 DEP /tmp/qemu-test/src/dtc/tests/supernode_atdepth_offset.c
	 DEP /tmp/qemu-test/src/dtc/tests/get_path.c
	 DEP /tmp/qemu-test/src/dtc/tests/get_phandle.c
	 DEP /tmp/qemu-test/src/dtc/tests/get_name.c
	 DEP /tmp/qemu-test/src/dtc/tests/getprop.c
	 DEP /tmp/qemu-test/src/dtc/tests/path_offset.c
	 DEP /tmp/qemu-test/src/dtc/tests/find_property.c
	 DEP /tmp/qemu-test/src/dtc/tests/subnode_offset.c
	 DEP /tmp/qemu-test/src/dtc/tests/root_node.c
	 DEP /tmp/qemu-test/src/dtc/tests/get_mem_rsv.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt_overlay.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt_addresses.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt_empty_tree.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt_strerror.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt_rw.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt_sw.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt_wip.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt_ro.c
	 DEP /tmp/qemu-test/src/dtc/util.c
	 DEP /tmp/qemu-test/src/dtc/fdtoverlay.c
	 DEP /tmp/qemu-test/src/dtc/fdtput.c
	 DEP /tmp/qemu-test/src/dtc/fdtget.c
	 DEP /tmp/qemu-test/src/dtc/fdtdump.c
	 LEX convert-dtsv0-lexer.lex.c
	 DEP /tmp/qemu-test/src/dtc/srcpos.c
	 BISON dtc-parser.tab.c
	 DEP /tmp/qemu-test/src/dtc/treesource.c
	 LEX dtc-lexer.lex.c
	 DEP /tmp/qemu-test/src/dtc/livetree.c
	 DEP /tmp/qemu-test/src/dtc/fstree.c
	 DEP /tmp/qemu-test/src/dtc/flattree.c
	 DEP /tmp/qemu-test/src/dtc/dtc.c
	 DEP /tmp/qemu-test/src/dtc/data.c
	 DEP /tmp/qemu-test/src/dtc/checks.c
	 DEP convert-dtsv0-lexer.lex.c
	 DEP dtc-parser.tab.c
	 DEP dtc-lexer.lex.c
	CHK version_gen.h
	UPD version_gen.h
	 DEP /tmp/qemu-test/src/dtc/util.c
	 CC libfdt/fdt.o
	 CC libfdt/fdt_ro.o
	 CC libfdt/fdt_wip.o
	 CC libfdt/fdt_sw.o
	 CC libfdt/fdt_rw.o
	 CC libfdt/fdt_strerror.o
	 CC libfdt/fdt_empty_tree.o
	 CC libfdt/fdt_addresses.o
	 CC libfdt/fdt_overlay.o
	 AR libfdt/libfdt.a
ar: creating libfdt/libfdt.a
a - libfdt/fdt.o
a - libfdt/fdt_ro.o
a - libfdt/fdt_wip.o
a - libfdt/fdt_sw.o
a - libfdt/fdt_rw.o
a - libfdt/fdt_strerror.o
a - libfdt/fdt_empty_tree.o
a - libfdt/fdt_addresses.o
a - libfdt/fdt_overlay.o
  GEN     qga/qapi-generated/qapi-gen
  CC      tests/qemu-iotests/socket_scm_helper.o
  CC      qapi-builtin-types.o
  CC      qapi-builtin-visit.o
  CC      qapi-types.o
  CC      qapi/qapi-types-block-core.o
  CC      qapi/qapi-types-block.o
  CC      qapi/qapi-types-char.o
  CC      qapi/qapi-types-common.o
  CC      qapi/qapi-types-crypto.o
  CC      qapi/qapi-types-introspect.o
  CC      qapi/qapi-types-migration.o
  CC      qapi/qapi-types-misc.o
  CC      qapi/qapi-types-net.o
  CC      qapi/qapi-types-rocker.o
  CC      qapi/qapi-types-run-state.o
  CC      qapi/qapi-types-sockets.o
  CC      qapi/qapi-types-tpm.o
  CC      qapi/qapi-types-trace.o
  CC      qapi/qapi-types-transaction.o
  CC      qapi/qapi-types-ui.o
  CC      qmp-introspect.o
  CC      qapi-visit.o
  CC      qapi-event.o
  CC      qapi/qapi-visit-core.o
  CC      qapi/qapi-dealloc-visitor.o
  CC      qapi/qobject-input-visitor.o
  CC      qapi/qobject-output-visitor.o
  CC      qapi/qmp-registry.o
  CC      qapi/qmp-dispatch.o
  CC      qapi/string-input-visitor.o
  CC      qapi/string-output-visitor.o
  CC      qapi/opts-visitor.o
  CC      qapi/qapi-clone-visitor.o
  CC      qapi/qmp-event.o
  CC      qapi/qapi-util.o
  CC      qobject/qnum.o
  CC      qobject/qnull.o
  CC      qobject/qstring.o
  CC      qobject/qdict.o
  CC      qobject/qlist.o
  CC      qobject/qbool.o
  CC      qobject/qjson.o
  CC      qobject/qlit.o
  CC      qobject/qobject.o
  CC      qobject/json-lexer.o
  CC      qobject/json-streamer.o
  CC      qobject/json-parser.o
  CC      trace/control.o
  CC      trace/qmp.o
  CC      util/osdep.o
  CC      util/cutils.o
  CC      util/unicode.o
  CC      util/qemu-timer-common.o
  CC      util/bufferiszero.o
  CC      util/lockcnt.o
  CC      util/aiocb.o
  CC      util/async.o
  CC      util/thread-pool.o
  CC      util/qemu-timer.o
  CC      util/main-loop.o
  CC      util/iohandler.o
  CC      util/aio-posix.o
  CC      util/compatfd.o
  CC      util/event_notifier-posix.o
  CC      util/mmap-alloc.o
  CC      util/oslib-posix.o
  CC      util/qemu-openpty.o
  CC      util/qemu-thread-posix.o
  CC      util/memfd.o
  CC      util/envlist.o
  CC      util/path.o
  CC      util/module.o
  CC      util/host-utils.o
  CC      util/bitmap.o
  CC      util/bitops.o
  CC      util/hbitmap.o
  CC      util/fifo8.o
  CC      util/acl.o
  CC      util/cacheinfo.o
  CC      util/error.o
  CC      util/qemu-error.o
  CC      util/id.o
  CC      util/iov.o
  CC      util/qemu-config.o
  CC      util/qemu-sockets.o
  CC      util/uri.o
  CC      util/notify.o
  CC      util/qemu-option.o
  CC      util/qemu-progress.o
  CC      util/keyval.o
  CC      util/hexdump.o
  CC      util/crc32c.o
  CC      util/uuid.o
  CC      util/throttle.o
  CC      util/getauxval.o
  CC      util/readline.o
  CC      util/rcu.o
  CC      util/qemu-coroutine.o
  CC      util/qemu-coroutine-lock.o
  CC      util/qemu-coroutine-io.o
  CC      util/qemu-coroutine-sleep.o
  CC      util/coroutine-ucontext.o
  CC      util/buffer.o
  CC      util/timed-average.o
  CC      util/base64.o
  CC      util/pagesize.o
  CC      util/qdist.o
  CC      util/log.o
  CC      util/qht.o
  CC      util/range.o
  CC      util/stats64.o
  CC      util/systemd.o
  CC      trace-root.o
  CC      util/trace.o
  CC      crypto/trace.o
  CC      io/trace.o
  CC      migration/trace.o
  CC      block/trace.o
  CC      chardev/trace.o
  CC      hw/block/trace.o
  CC      hw/block/dataplane/trace.o
  CC      hw/char/trace.o
  CC      hw/intc/trace.o
  CC      hw/net/trace.o
  CC      hw/virtio/trace.o
  CC      hw/audio/trace.o
  CC      hw/misc/trace.o
  CC      hw/usb/trace.o
  CC      hw/scsi/trace.o
  CC      hw/nvram/trace.o
  CC      hw/display/trace.o
  CC      hw/input/trace.o
  CC      hw/timer/trace.o
  CC      hw/dma/trace.o
  CC      hw/sparc/trace.o
  CC      hw/sparc64/trace.o
  CC      hw/sd/trace.o
  CC      hw/isa/trace.o
  CC      hw/mem/trace.o
  CC      hw/i386/trace.o
  CC      hw/i386/xen/trace.o
  CC      hw/9pfs/trace.o
  CC      hw/ppc/trace.o
  CC      hw/pci/trace.o
  CC      hw/pci-host/trace.o
  CC      hw/s390x/trace.o
  CC      hw/vfio/trace.o
  CC      hw/acpi/trace.o
  CC      hw/arm/trace.o
  CC      hw/alpha/trace.o
  CC      hw/hppa/trace.o
  CC      hw/xen/trace.o
  CC      hw/ide/trace.o
  CC      ui/trace.o
  CC      audio/trace.o
  CC      net/trace.o
  CC      target/arm/trace.o
  CC      target/i386/trace.o
  CC      target/mips/trace.o
  CC      target/sparc/trace.o
  CC      target/s390x/trace.o
  CC      target/ppc/trace.o
  CC      qom/trace.o
  CC      qapi/trace.o
  CC      linux-user/trace.o
  CC      accel/tcg/trace.o
  CC      accel/kvm/trace.o
  CC      nbd/trace.o
  CC      scsi/trace.o
  CC      crypto/pbkdf-stub.o
  CC      stubs/arch-query-cpu-def.o
  CC      stubs/arch-query-cpu-model-expansion.o
  CC      stubs/arch-query-cpu-model-comparison.o
  CC      stubs/arch-query-cpu-model-baseline.o
  CC      stubs/bdrv-next-monitor-owned.o
  CC      stubs/blk-commit-all.o
  CC      stubs/blockdev-close-all-bdrv-states.o
  CC      stubs/clock-warp.o
  CC      stubs/cpu-get-clock.o
  CC      stubs/cpu-get-icount.o
  CC      stubs/dump.o
  CC      stubs/error-printf.o
  CC      stubs/fdset.o
  CC      stubs/gdbstub.o
  CC      stubs/get-vm-name.o
  CC      stubs/iothread.o
  CC      stubs/iothread-lock.o
  CC      stubs/is-daemonized.o
  CC      stubs/machine-init-done.o
  CC      stubs/migr-blocker.o
  CC      stubs/change-state-handler.o
  CC      stubs/monitor.o
  CC      stubs/notify-event.o
  CC      stubs/qtest.o
  CC      stubs/replay.o
  CC      stubs/runstate-check.o
  CC      stubs/set-fd-handler.o
  CC      stubs/slirp.o
  CC      stubs/sysbus.o
  CC      stubs/tpm.o
  CC      stubs/trace-control.o
  CC      stubs/uuid.o
  CC      stubs/vm-stop.o
  CC      stubs/vmstate.o
  CC      stubs/qmp_pc_dimm.o
  CC      stubs/target-monitor-defs.o
  CC      stubs/target-get-monitor-def.o
  CC      stubs/pc_madt_cpu_entry.o
  CC      stubs/vmgenid.o
  CC      stubs/xen-common.o
  CC      stubs/xen-hvm.o
  CC      stubs/pci-host-piix.o
  CC      contrib/ivshmem-client/ivshmem-client.o
  CC      contrib/ivshmem-client/main.o
  CC      contrib/ivshmem-server/ivshmem-server.o
  CC      contrib/ivshmem-server/main.o
  CC      qemu-nbd.o
  CC      block.o
  CC      blockjob.o
  CC      qemu-io-cmds.o
  CC      replication.o
  CC      block/raw-format.o
In file included from /tmp/qemu-test/src/qemu-nbd.c:29:
/tmp/qemu-test/src/include/block/nbd.h:262: error: expected declaration specifiers or '...' before 'NbdServerRemoveMode'
make: *** [qemu-nbd.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from /tmp/qemu-test/src/block.c:30:
/tmp/qemu-test/src/include/block/nbd.h:262: error: expected declaration specifiers or '...' before 'NbdServerRemoveMode'
make: *** [block.o] Error 1
Traceback (most recent call last):
  File "./tests/docker/docker.py", line 407, in <module>
    sys.exit(main())
  File "./tests/docker/docker.py", line 404, in main
    return args.cmdobj.run(args, argv)
  File "./tests/docker/docker.py", line 261, in run
    return Docker().run(argv, args.keep, quiet=args.quiet)
  File "./tests/docker/docker.py", line 229, in run
    quiet=quiet)
  File "./tests/docker/docker.py", line 147, in _do_check
    return subprocess.check_call(self._command + cmd, **kwargs)
  File "/usr/lib64/python2.7/subprocess.py", line 186, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['docker', 'run', '--label', 'com.qemu.instance.uuid=ce096f8c085d11e8bded52540069c830', '-u', '0', '--security-opt', 'seccomp=unconfined', '--rm', '--net=none', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=8', '-e', 'DEBUG=', '-e', 'SHOW_ENV=1', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/root/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-ongo5ce8/src/docker-src.2018-02-02-16.12.30.11185:/var/tmp/qemu:z,ro', 'qemu:centos6', '/var/tmp/qemu/run', 'test-quick']' returned non-zero exit status 2
make[1]: *** [tests/docker/Makefile.include:129: docker-run] Error 1
make: *** [tests/docker/Makefile.include:163: docker-run-test-quick@centos6] Error 2

real	1m10.470s
user	0m4.489s
sys	0m3.373s
=== OUTPUT END ===

Test command exited with code: 2


---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@freelists.org

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 10/21] qapi/common: Eliminate QAPISchema.exprs
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 10/21] qapi/common: Eliminate QAPISchema.exprs Markus Armbruster
@ 2018-02-02 22:02   ` Eric Blake
  2018-02-05 13:45   ` Marc-Andre Lureau
  1 sibling, 0 replies; 87+ messages in thread
From: Eric Blake @ 2018-02-02 22:02 UTC (permalink / raw)
  To: Markus Armbruster, qemu-devel; +Cc: marcandre.lureau, mdroth

[-- Attachment #1: Type: text/plain, Size: 388 bytes --]

On 02/02/2018 07:03 AM, Markus Armbruster wrote:
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  scripts/qapi/common.py | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code
  2018-02-02 13:03 [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code Markus Armbruster
                   ` (26 preceding siblings ...)
  2018-02-02 21:13 ` no-reply
@ 2018-02-02 22:14 ` no-reply
  2018-02-03 11:30 ` Markus Armbruster
  28 siblings, 0 replies; 87+ messages in thread
From: no-reply @ 2018-02-02 22:14 UTC (permalink / raw)
  To: armbru; +Cc: famz, qemu-devel, marcandre.lureau, mdroth

Hi,

This series failed docker-build@min-glib build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

Type: series
Message-id: 20180202130336.24719-1-armbru@redhat.com
Subject: [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code

=== TEST SCRIPT BEGIN ===
#!/bin/bash
set -e
git submodule update --init dtc
# Let docker tests dump environment info
export SHOW_ENV=1
export J=8
time make docker-test-build@min-glib
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
Switched to a new branch 'test'
20edfbb769 qapi: Empty out qapi-schema.json
908a02511e Include less of qapi-types.h
cc0f486390 qapi/types: Generate separate .h, .c for each module
da8bb99aca qapi/common: Fix guardname() for funny filenames
c8a5aa0179 qapi/types qapi/visit: Generate built-in stuff into separate files
799da1022d qapi/types qapi/visit: Make visitors use QAPIGen more
1755f6ed36 qapi: Record 'include' directives in intermediate representation
4e1183baa6 qapi: Generate in source order
b9771d2e65 qapi: Record 'include' directives in parse tree
656629e139 qapi: Concentrate QAPISchemaParser.exprs updates in .__init__()
1bc777d460 qapi: Lift error reporting from QAPISchema.__init__() to callers
c531a76a97 qapi/common: Eliminate QAPISchema.exprs
7f7062dc58 qapi: Don't absolutize include file name in error messages
bd75734a2c qapi: Touch generated files only when they change
a4e94e3e75 qapi: Move parse_command_line() next to its only use
b9b12fa6c6 qapi-gen: New common driver for code and doc generators
3a56fc45c2 qapi: Turn generators into modules
c09593eb74 qapi: Reduce use of global variables in generators some
4e457ceed8 qapi: New classes QAPIGenC, QAPIGenH, QAPIGenDoc
d969856a53 qapi: Generate up-to-date copyright notice
a295c600fc qapi: Streamline boilerplate comment generation

=== OUTPUT BEGIN ===
Submodule 'dtc' (git://git.qemu-project.org/dtc.git) registered for path 'dtc'
Cloning into '/var/tmp/patchew-tester-tmp-t2c_u19x/src/dtc'...
Submodule path 'dtc': checked out 'e54388015af1fb4bf04d0bca99caba1074d9cc42'
  BUILD   min-glib
  GEN     /var/tmp/patchew-tester-tmp-t2c_u19x/src/docker-src.2018-02-02-17.13.16.3631/qemu.tar
Cloning into '/var/tmp/patchew-tester-tmp-t2c_u19x/src/docker-src.2018-02-02-17.13.16.3631/qemu.tar.vroot'...
done.
Checking out files:  44% (2583/5779)   
Checking out files:  45% (2601/5779)   
Checking out files:  46% (2659/5779)   
Checking out files:  47% (2717/5779)   
Checking out files:  48% (2774/5779)   
Checking out files:  49% (2832/5779)   
Checking out files:  50% (2890/5779)   
Checking out files:  51% (2948/5779)   
Checking out files:  52% (3006/5779)   
Checking out files:  53% (3063/5779)   
Checking out files:  54% (3121/5779)   
Checking out files:  55% (3179/5779)   
Checking out files:  56% (3237/5779)   
Checking out files:  57% (3295/5779)   
Checking out files:  58% (3352/5779)   
Checking out files:  59% (3410/5779)   
Checking out files:  60% (3468/5779)   
Checking out files:  61% (3526/5779)   
Checking out files:  62% (3583/5779)   
Checking out files:  63% (3641/5779)   
Checking out files:  64% (3699/5779)   
Checking out files:  65% (3757/5779)   
Checking out files:  66% (3815/5779)   
Checking out files:  67% (3872/5779)   
Checking out files:  68% (3930/5779)   
Checking out files:  69% (3988/5779)   
Checking out files:  70% (4046/5779)   
Checking out files:  71% (4104/5779)   
Checking out files:  72% (4161/5779)   
Checking out files:  73% (4219/5779)   
Checking out files:  74% (4277/5779)   
Checking out files:  75% (4335/5779)   
Checking out files:  76% (4393/5779)   
Checking out files:  77% (4450/5779)   
Checking out files:  78% (4508/5779)   
Checking out files:  79% (4566/5779)   
Checking out files:  80% (4624/5779)   
Checking out files:  81% (4681/5779)   
Checking out files:  82% (4739/5779)   
Checking out files:  83% (4797/5779)   
Checking out files:  84% (4855/5779)   
Checking out files:  85% (4913/5779)   
Checking out files:  86% (4970/5779)   
Checking out files:  87% (5028/5779)   
Checking out files:  88% (5086/5779)   
Checking out files:  89% (5144/5779)   
Checking out files:  90% (5202/5779)   
Checking out files:  91% (5259/5779)   
Checking out files:  92% (5317/5779)   
Checking out files:  93% (5375/5779)   
Checking out files:  94% (5433/5779)   
Checking out files:  95% (5491/5779)   
Checking out files:  96% (5548/5779)   
Checking out files:  97% (5606/5779)   
Checking out files:  98% (5664/5779)   
Checking out files:  99% (5722/5779)   
Checking out files: 100% (5779/5779)   
Checking out files: 100% (5779/5779), done.
Your branch is up-to-date with 'origin/test'.
Submodule 'dtc' (git://git.qemu-project.org/dtc.git) registered for path 'dtc'
Cloning into '/var/tmp/patchew-tester-tmp-t2c_u19x/src/docker-src.2018-02-02-17.13.16.3631/qemu.tar.vroot/dtc'...
Submodule path 'dtc': checked out 'e54388015af1fb4bf04d0bca99caba1074d9cc42'
Submodule 'ui/keycodemapdb' (git://git.qemu.org/keycodemapdb.git) registered for path 'ui/keycodemapdb'
Cloning into '/var/tmp/patchew-tester-tmp-t2c_u19x/src/docker-src.2018-02-02-17.13.16.3631/qemu.tar.vroot/ui/keycodemapdb'...
Submodule path 'ui/keycodemapdb': checked out '10739aa26051a5d49d88132604539d3ed085e72e'
  COPY    RUNNER
    RUN test-build in qemu:min-glib 
Environment variables:
HOSTNAME=7ddcc95ca4e4
MAKEFLAGS= -j8
J=8
CCACHE_DIR=/var/tmp/ccache
EXTRA_CONFIGURE_OPTS=
V=
SHOW_ENV=1
PATH=/usr/lib/ccache:/usr/lib64/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PWD=/
TARGET_LIST=
SHLVL=1
HOME=/root
TEST_DIR=/tmp/qemu-test
FEATURES= dtc
DEBUG=
_=/usr/bin/env

Configure options:
--enable-werror --target-list=x86_64-softmmu,aarch64-softmmu --prefix=/tmp/qemu-test/install
No C++ compiler available; disabling C++ specific optional code
Install prefix    /tmp/qemu-test/install
BIOS directory    /tmp/qemu-test/install/share/qemu
firmware path     /tmp/qemu-test/install/share/qemu-firmware
binary directory  /tmp/qemu-test/install/bin
library directory /tmp/qemu-test/install/lib
module directory  /tmp/qemu-test/install/lib/qemu
libexec directory /tmp/qemu-test/install/libexec
include directory /tmp/qemu-test/install/include
config directory  /tmp/qemu-test/install/etc
local state directory   /tmp/qemu-test/install/var
Manual directory  /tmp/qemu-test/install/share/man
ELF interp prefix /usr/gnemul/qemu-%M
Source path       /tmp/qemu-test/src
GIT binary        git
GIT submodules    
C compiler        cc
Host C compiler   cc
C++ compiler      
Objective-C compiler cc
ARFLAGS           rv
CFLAGS            -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -g 
QEMU_CFLAGS       -I/usr/include/pixman-1   -I$(SRC_PATH)/dtc/libfdt -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include   -fPIE -DPIE -m64 -mcx16 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv  -Wendif-labels -Wno-missing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-declaration -Wold-style-definition -Wtype-limits -fstack-protector-all -Wno-missing-braces
LDFLAGS           -Wl,--warn-common -Wl,-z,relro -Wl,-z,now -pie -m64 -g 
make              make
install           install
python            python -B
smbd              /usr/sbin/smbd
module support    no
host CPU          x86_64
host big endian   no
target list       x86_64-softmmu aarch64-softmmu
gprof enabled     no
sparse enabled    no
strip binaries    yes
profiler          no
static build      no
SDL support       yes (1.2.14)
GTK support       no 
GTK GL support    no
VTE support       no 
TLS priority      NORMAL
GNUTLS support    no
GNUTLS rnd        no
libgcrypt         no
libgcrypt kdf     no
nettle            no 
nettle kdf        no
libtasn1          no
curses support    no
virgl support     no
curl support      no
mingw32 support   no
Audio drivers     oss
Block whitelist (rw) 
Block whitelist (ro) 
VirtFS support    no
Multipath support no
VNC support       yes
VNC SASL support  no
VNC JPEG support  no
VNC PNG support   no
xen support       no
brlapi support    no
bluez  support    no
Documentation     no
PIE               yes
vde support       no
netmap support    no
Linux AIO support no
ATTR/XATTR support yes
Install blobs     yes
KVM support       yes
HAX support       no
HVF support       no
TCG support       yes
TCG debug enabled no
TCG interpreter   no
malloc trim support yes
RDMA support      no
fdt support       yes
preadv support    yes
fdatasync         yes
madvise           yes
posix_madvise     yes
libcap-ng support no
vhost-net support yes
vhost-scsi support yes
vhost-vsock support yes
vhost-user support yes
Trace backends    log
spice support     no 
rbd support       no
xfsctl support    no
smartcard support no
libusb            no
usb net redir     no
OpenGL support    no
OpenGL dmabufs    no
libiscsi support  no
libnfs support    no
build guest agent yes
QGA VSS support   no
QGA w32 disk info no
QGA MSI support   no
seccomp support   no
coroutine backend ucontext
coroutine pool    yes
debug stack usage no
crypto afalg      no
GlusterFS support no
gcov              gcov
gcov enabled      no
TPM support       yes
libssh2 support   no
TPM passthrough   yes
TPM emulator      yes
QOM debugging     yes
Live block migration yes
lzo support       no
snappy support    no
bzip2 support     no
NUMA host support no
libxml2           no
tcmalloc support  no
jemalloc support  no
avx2 optimization no
replication support yes
VxHS block device no
capstone          no

WARNING: Use of SDL 1.2 is deprecated and will be removed in
WARNING: future releases. Please switch to using SDL 2.0
  GEN     x86_64-softmmu/config-devices.mak.tmp
  GEN     aarch64-softmmu/config-devices.mak.tmp
  GEN     config-host.h
  GEN     qemu-options.def
  GEN     qapi-gen
  GEN     trace/generated-helpers-wrappers.h
  GEN     trace/generated-tcg-tracers.h
  GEN     trace/generated-helpers.h
  GEN     x86_64-softmmu/config-devices.mak
  GEN     aarch64-softmmu/config-devices.mak
  GEN     trace/generated-helpers.c
  GEN     module_block.h
  GEN     ui/input-keymap-atset1-to-qcode.c
  GEN     ui/input-keymap-linux-to-qcode.c
  GEN     ui/input-keymap-qcode-to-atset1.c
  GEN     ui/input-keymap-qcode-to-atset2.c
  GEN     ui/input-keymap-qcode-to-atset3.c
  GEN     ui/input-keymap-qcode-to-linux.c
  GEN     ui/input-keymap-qcode-to-qnum.c
  GEN     ui/input-keymap-qcode-to-sun.c
  GEN     ui/input-keymap-qnum-to-qcode.c
  GEN     ui/input-keymap-usb-to-qcode.c
  GEN     ui/input-keymap-win32-to-qcode.c
  GEN     ui/input-keymap-x11-to-qcode.c
  GEN     ui/input-keymap-xorgevdev-to-qcode.c
  GEN     ui/input-keymap-xorgkbd-to-qcode.c
  GEN     ui/input-keymap-xorgxquartz-to-qcode.c
  GEN     ui/input-keymap-xorgxwin-to-qcode.c
  GEN     tests/test-qapi-gen
  GEN     trace-root.h
  GEN     util/trace.h
  GEN     crypto/trace.h
  GEN     io/trace.h
  GEN     migration/trace.h
  GEN     block/trace.h
  GEN     chardev/trace.h
  GEN     hw/block/trace.h
  GEN     hw/block/dataplane/trace.h
  GEN     hw/char/trace.h
  GEN     hw/intc/trace.h
  GEN     hw/net/trace.h
  GEN     hw/virtio/trace.h
  GEN     hw/audio/trace.h
  GEN     hw/misc/trace.h
  GEN     hw/usb/trace.h
  GEN     hw/scsi/trace.h
  GEN     hw/nvram/trace.h
  GEN     hw/display/trace.h
  GEN     hw/input/trace.h
  GEN     hw/timer/trace.h
  GEN     hw/dma/trace.h
  GEN     hw/sparc/trace.h
  GEN     hw/sparc64/trace.h
  GEN     hw/sd/trace.h
  GEN     hw/isa/trace.h
  GEN     hw/mem/trace.h
  GEN     hw/i386/trace.h
  GEN     hw/i386/xen/trace.h
  GEN     hw/9pfs/trace.h
  GEN     hw/ppc/trace.h
  GEN     hw/pci/trace.h
  GEN     hw/pci-host/trace.h
  GEN     hw/s390x/trace.h
  GEN     hw/vfio/trace.h
  GEN     hw/acpi/trace.h
  GEN     hw/arm/trace.h
  GEN     hw/alpha/trace.h
  GEN     hw/hppa/trace.h
  GEN     hw/xen/trace.h
  GEN     hw/ide/trace.h
  GEN     ui/trace.h
  GEN     audio/trace.h
  GEN     net/trace.h
  GEN     target/arm/trace.h
  GEN     target/i386/trace.h
  GEN     target/mips/trace.h
  GEN     target/sparc/trace.h
  GEN     target/s390x/trace.h
  GEN     target/ppc/trace.h
  GEN     qom/trace.h
  GEN     linux-user/trace.h
  GEN     qapi/trace.h
  GEN     accel/tcg/trace.h
  GEN     accel/kvm/trace.h
  GEN     nbd/trace.h
  GEN     scsi/trace.h
  GEN     trace-root.c
  GEN     util/trace.c
  GEN     crypto/trace.c
  GEN     io/trace.c
  GEN     migration/trace.c
  GEN     block/trace.c
  GEN     chardev/trace.c
  GEN     hw/block/trace.c
  GEN     hw/block/dataplane/trace.c
  GEN     hw/char/trace.c
  GEN     hw/intc/trace.c
  GEN     hw/net/trace.c
  GEN     hw/virtio/trace.c
  GEN     hw/audio/trace.c
  GEN     hw/misc/trace.c
  GEN     hw/usb/trace.c
  GEN     hw/scsi/trace.c
  GEN     hw/nvram/trace.c
  GEN     hw/display/trace.c
  GEN     hw/input/trace.c
  GEN     hw/timer/trace.c
  GEN     hw/dma/trace.c
  GEN     hw/sparc/trace.c
  GEN     hw/sparc64/trace.c
  GEN     hw/sd/trace.c
  GEN     hw/isa/trace.c
  GEN     hw/mem/trace.c
  GEN     hw/i386/trace.c
  GEN     hw/i386/xen/trace.c
  GEN     hw/9pfs/trace.c
  GEN     hw/ppc/trace.c
  GEN     hw/pci/trace.c
  GEN     hw/pci-host/trace.c
  GEN     hw/s390x/trace.c
  GEN     hw/vfio/trace.c
  GEN     hw/acpi/trace.c
  GEN     hw/arm/trace.c
  GEN     hw/alpha/trace.c
  GEN     hw/hppa/trace.c
  GEN     hw/xen/trace.c
  GEN     hw/ide/trace.c
  GEN     ui/trace.c
  GEN     audio/trace.c
  GEN     net/trace.c
  GEN     target/arm/trace.c
  GEN     target/i386/trace.c
  GEN     target/mips/trace.c
  GEN     target/sparc/trace.c
  GEN     target/s390x/trace.c
  GEN     target/ppc/trace.c
  GEN     qom/trace.c
  GEN     linux-user/trace.c
  GEN     qapi/trace.c
  GEN     accel/tcg/trace.c
  GEN     accel/kvm/trace.c
  GEN     nbd/trace.c
  GEN     scsi/trace.c
  GEN     config-all-devices.mak
	 DEP /tmp/qemu-test/src/dtc/tests/dumptrees.c
	 DEP /tmp/qemu-test/src/dtc/tests/trees.S
	 DEP /tmp/qemu-test/src/dtc/tests/testutils.c
	 DEP /tmp/qemu-test/src/dtc/tests/value-labels.c
	 DEP /tmp/qemu-test/src/dtc/tests/truncated_property.c
	 DEP /tmp/qemu-test/src/dtc/tests/asm_tree_dump.c
	 DEP /tmp/qemu-test/src/dtc/tests/overlay_bad_fixup.c
	 DEP /tmp/qemu-test/src/dtc/tests/check_path.c
	 DEP /tmp/qemu-test/src/dtc/tests/overlay.c
	 DEP /tmp/qemu-test/src/dtc/tests/subnode_iterate.c
	 DEP /tmp/qemu-test/src/dtc/tests/property_iterate.c
	 DEP /tmp/qemu-test/src/dtc/tests/integer-expressions.c
	 DEP /tmp/qemu-test/src/dtc/tests/utilfdt_test.c
	 DEP /tmp/qemu-test/src/dtc/tests/path_offset_aliases.c
	 DEP /tmp/qemu-test/src/dtc/tests/add_subnode_with_nops.c
	 DEP /tmp/qemu-test/src/dtc/tests/dtbs_equal_unordered.c
	 DEP /tmp/qemu-test/src/dtc/tests/dtb_reverse.c
	 DEP /tmp/qemu-test/src/dtc/tests/dtbs_equal_ordered.c
	 DEP /tmp/qemu-test/src/dtc/tests/extra-terminating-null.c
	 DEP /tmp/qemu-test/src/dtc/tests/incbin.c
	 DEP /tmp/qemu-test/src/dtc/tests/boot-cpuid.c
	 DEP /tmp/qemu-test/src/dtc/tests/phandle_format.c
	 DEP /tmp/qemu-test/src/dtc/tests/path-references.c
	 DEP /tmp/qemu-test/src/dtc/tests/references.c
	 DEP /tmp/qemu-test/src/dtc/tests/string_escapes.c
	 DEP /tmp/qemu-test/src/dtc/tests/propname_escapes.c
	 DEP /tmp/qemu-test/src/dtc/tests/appendprop2.c
	 DEP /tmp/qemu-test/src/dtc/tests/appendprop1.c
	 DEP /tmp/qemu-test/src/dtc/tests/del_node.c
	 DEP /tmp/qemu-test/src/dtc/tests/del_property.c
	 DEP /tmp/qemu-test/src/dtc/tests/setprop.c
	 DEP /tmp/qemu-test/src/dtc/tests/set_name.c
	 DEP /tmp/qemu-test/src/dtc/tests/rw_tree1.c
	 DEP /tmp/qemu-test/src/dtc/tests/open_pack.c
	 DEP /tmp/qemu-test/src/dtc/tests/nopulate.c
	 DEP /tmp/qemu-test/src/dtc/tests/mangle-layout.c
	 DEP /tmp/qemu-test/src/dtc/tests/move_and_save.c
	 DEP /tmp/qemu-test/src/dtc/tests/sw_tree1.c
	 DEP /tmp/qemu-test/src/dtc/tests/nop_node.c
	 DEP /tmp/qemu-test/src/dtc/tests/nop_property.c
	 DEP /tmp/qemu-test/src/dtc/tests/setprop_inplace.c
	 DEP /tmp/qemu-test/src/dtc/tests/stringlist.c
	 DEP /tmp/qemu-test/src/dtc/tests/addr_size_cells.c
	 DEP /tmp/qemu-test/src/dtc/tests/notfound.c
	 DEP /tmp/qemu-test/src/dtc/tests/sized_cells.c
	 DEP /tmp/qemu-test/src/dtc/tests/char_literal.c
	 DEP /tmp/qemu-test/src/dtc/tests/get_alias.c
	 DEP /tmp/qemu-test/src/dtc/tests/node_offset_by_compatible.c
	 DEP /tmp/qemu-test/src/dtc/tests/node_check_compatible.c
	 DEP /tmp/qemu-test/src/dtc/tests/node_offset_by_phandle.c
	 DEP /tmp/qemu-test/src/dtc/tests/node_offset_by_prop_value.c
	 DEP /tmp/qemu-test/src/dtc/tests/parent_offset.c
	 DEP /tmp/qemu-test/src/dtc/tests/supernode_atdepth_offset.c
	 DEP /tmp/qemu-test/src/dtc/tests/get_path.c
	 DEP /tmp/qemu-test/src/dtc/tests/get_phandle.c
	 DEP /tmp/qemu-test/src/dtc/tests/getprop.c
	 DEP /tmp/qemu-test/src/dtc/tests/get_name.c
	 DEP /tmp/qemu-test/src/dtc/tests/path_offset.c
	 DEP /tmp/qemu-test/src/dtc/tests/subnode_offset.c
	 DEP /tmp/qemu-test/src/dtc/tests/find_property.c
	 DEP /tmp/qemu-test/src/dtc/tests/root_node.c
	 DEP /tmp/qemu-test/src/dtc/tests/get_mem_rsv.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt_overlay.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt_addresses.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt_empty_tree.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt_strerror.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt_rw.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt_sw.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt_wip.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt_ro.c
	 DEP /tmp/qemu-test/src/dtc/libfdt/fdt.c
	 DEP /tmp/qemu-test/src/dtc/util.c
	 DEP /tmp/qemu-test/src/dtc/fdtoverlay.c
	 DEP /tmp/qemu-test/src/dtc/fdtput.c
	 DEP /tmp/qemu-test/src/dtc/fdtget.c
	 DEP /tmp/qemu-test/src/dtc/fdtdump.c
	 LEX convert-dtsv0-lexer.lex.c
make[1]: flex: Command not found
	 DEP /tmp/qemu-test/src/dtc/srcpos.c
	 BISON dtc-parser.tab.c
make[1]: bison: Command not found
	 LEX dtc-lexer.lex.c
make[1]: flex: Command not found
	 DEP /tmp/qemu-test/src/dtc/treesource.c
	 DEP /tmp/qemu-test/src/dtc/livetree.c
	 DEP /tmp/qemu-test/src/dtc/fstree.c
	 DEP /tmp/qemu-test/src/dtc/flattree.c
	 DEP /tmp/qemu-test/src/dtc/dtc.c
	 DEP /tmp/qemu-test/src/dtc/data.c
	 DEP /tmp/qemu-test/src/dtc/checks.c
	CHK version_gen.h
	 LEX convert-dtsv0-lexer.lex.c
make[1]: flex: Command not found
	 BISON dtc-parser.tab.c
make[1]: bison: Command not found
	 LEX dtc-lexer.lex.c
make[1]: flex: Command not found
	UPD version_gen.h
	 DEP /tmp/qemu-test/src/dtc/util.c
	 LEX convert-dtsv0-lexer.lex.c
	 BISON dtc-parser.tab.c
	 LEX dtc-lexer.lex.c
make[1]: flex: Command not found
make[1]: bison: Command not found
make[1]: flex: Command not found
	 CC libfdt/fdt.o
	 CC libfdt/fdt_ro.o
	 CC libfdt/fdt_sw.o
	 CC libfdt/fdt_wip.o
	 CC libfdt/fdt_rw.o
	 CC libfdt/fdt_strerror.o
	 CC libfdt/fdt_empty_tree.o
	 CC libfdt/fdt_addresses.o
	 CC libfdt/fdt_overlay.o
	 AR libfdt/libfdt.a
ar: creating libfdt/libfdt.a
a - libfdt/fdt.o
a - libfdt/fdt_ro.o
a - libfdt/fdt_wip.o
a - libfdt/fdt_sw.o
a - libfdt/fdt_rw.o
a - libfdt/fdt_strerror.o
a - libfdt/fdt_empty_tree.o
a - libfdt/fdt_addresses.o
a - libfdt/fdt_overlay.o
	 LEX convert-dtsv0-lexer.lex.c
make[1]: flex: Command not found
	 LEX dtc-lexer.lex.c
	 BISON dtc-parser.tab.c
make[1]: flex: Command not found
make[1]: bison: Command not found
  CC      tests/qemu-iotests/socket_scm_helper.o
  CC      qapi-builtin-visit.o
  GEN     qga/qapi-generated/qapi-gen
  CC      qapi-builtin-types.o
  CC      qapi/qapi-types-block-core.o
  CC      qapi/qapi-types-char.o
  CC      qapi/qapi-types-block.o
  CC      qapi-types.o
  CC      qapi/qapi-types-common.o
  CC      qapi/qapi-types-crypto.o
  CC      qapi/qapi-types-introspect.o
  CC      qapi/qapi-types-migration.o
  CC      qapi/qapi-types-misc.o
  CC      qapi/qapi-types-net.o
  CC      qapi/qapi-types-run-state.o
  CC      qapi/qapi-types-rocker.o
  CC      qapi/qapi-types-sockets.o
  CC      qapi/qapi-types-tpm.o
  CC      qapi/qapi-types-trace.o
  CC      qapi/qapi-types-transaction.o
  CC      qapi/qapi-types-ui.o
  CC      qmp-introspect.o
  CC      qapi-visit.o
  CC      qapi-event.o
  CC      qapi/qapi-visit-core.o
  CC      qapi/qapi-dealloc-visitor.o
  CC      qapi/qobject-input-visitor.o
  CC      qapi/qobject-output-visitor.o
  CC      qapi/qmp-registry.o
  CC      qapi/qmp-dispatch.o
  CC      qapi/string-input-visitor.o
  CC      qapi/string-output-visitor.o
  CC      qapi/opts-visitor.o
  CC      qapi/qapi-clone-visitor.o
  CC      qapi/qmp-event.o
  CC      qapi/qapi-util.o
  CC      qobject/qnull.o
  CC      qobject/qnum.o
  CC      qobject/qstring.o
  CC      qobject/qdict.o
  CC      qobject/qlist.o
  CC      qobject/qbool.o
  CC      qobject/qlit.o
  CC      qobject/qjson.o
  CC      qobject/qobject.o
  CC      qobject/json-lexer.o
  CC      qobject/json-streamer.o
  CC      qobject/json-parser.o
  CC      trace/control.o
  CC      trace/qmp.o
  CC      util/osdep.o
  CC      util/cutils.o
  CC      util/unicode.o
  CC      util/qemu-timer-common.o
  CC      util/bufferiszero.o
  CC      util/lockcnt.o
  CC      util/aiocb.o
  CC      util/async.o
  CC      util/thread-pool.o
  CC      util/qemu-timer.o
  CC      util/main-loop.o
  CC      util/iohandler.o
  CC      util/aio-posix.o
  CC      util/compatfd.o
  CC      util/event_notifier-posix.o
  CC      util/mmap-alloc.o
  CC      util/oslib-posix.o
  CC      util/qemu-openpty.o
  CC      util/qemu-thread-posix.o
  CC      util/memfd.o
  CC      util/envlist.o
  CC      util/path.o
  CC      util/module.o
  CC      util/host-utils.o
  CC      util/bitmap.o
  CC      util/bitops.o
  CC      util/hbitmap.o
  CC      util/fifo8.o
  CC      util/acl.o
  CC      util/cacheinfo.o
  CC      util/error.o
  CC      util/qemu-error.o
  CC      util/id.o
  CC      util/iov.o
  CC      util/qemu-config.o
  CC      util/qemu-sockets.o
  CC      util/uri.o
  CC      util/notify.o
  CC      util/qemu-option.o
  CC      util/qemu-progress.o
  CC      util/keyval.o
  CC      util/hexdump.o
  CC      util/crc32c.o
  CC      util/uuid.o
  CC      util/throttle.o
  CC      util/getauxval.o
  CC      util/readline.o
  CC      util/rcu.o
  CC      util/qemu-coroutine.o
  CC      util/qemu-coroutine-lock.o
  CC      util/qemu-coroutine-io.o
  CC      util/qemu-coroutine-sleep.o
  CC      util/coroutine-ucontext.o
  CC      util/timed-average.o
  CC      util/log.o
  CC      util/base64.o
  CC      util/buffer.o
  CC      util/pagesize.o
  CC      util/qdist.o
  CC      util/qht.o
  CC      util/range.o
  CC      util/stats64.o
  CC      util/systemd.o
  CC      trace-root.o
  CC      util/trace.o
  CC      crypto/trace.o
  CC      io/trace.o
  CC      migration/trace.o
  CC      block/trace.o
  CC      chardev/trace.o
  CC      hw/block/trace.o
  CC      hw/block/dataplane/trace.o
  CC      hw/char/trace.o
  CC      hw/intc/trace.o
  CC      hw/net/trace.o
  CC      hw/virtio/trace.o
  CC      hw/audio/trace.o
  CC      hw/misc/trace.o
  CC      hw/usb/trace.o
  CC      hw/scsi/trace.o
  CC      hw/nvram/trace.o
  CC      hw/display/trace.o
  CC      hw/input/trace.o
  CC      hw/timer/trace.o
  CC      hw/dma/trace.o
  CC      hw/sparc/trace.o
  CC      hw/sparc64/trace.o
  CC      hw/sd/trace.o
  CC      hw/isa/trace.o
  CC      hw/mem/trace.o
  CC      hw/i386/trace.o
  CC      hw/i386/xen/trace.o
  CC      hw/9pfs/trace.o
  CC      hw/ppc/trace.o
  CC      hw/pci/trace.o
  CC      hw/pci-host/trace.o
  CC      hw/s390x/trace.o
  CC      hw/vfio/trace.o
  CC      hw/acpi/trace.o
  CC      hw/arm/trace.o
  CC      hw/alpha/trace.o
  CC      hw/hppa/trace.o
  CC      hw/xen/trace.o
  CC      hw/ide/trace.o
  CC      ui/trace.o
  CC      audio/trace.o
  CC      net/trace.o
  CC      target/arm/trace.o
  CC      target/i386/trace.o
  CC      target/mips/trace.o
  CC      target/sparc/trace.o
  CC      target/s390x/trace.o
  CC      target/ppc/trace.o
  CC      qom/trace.o
  CC      linux-user/trace.o
  CC      qapi/trace.o
  CC      accel/tcg/trace.o
  CC      accel/kvm/trace.o
  CC      nbd/trace.o
  CC      scsi/trace.o
  CC      crypto/pbkdf-stub.o
  CC      stubs/arch-query-cpu-def.o
  CC      stubs/arch-query-cpu-model-expansion.o
  CC      stubs/arch-query-cpu-model-comparison.o
  CC      stubs/arch-query-cpu-model-baseline.o
  CC      stubs/bdrv-next-monitor-owned.o
  CC      stubs/blk-commit-all.o
  CC      stubs/blockdev-close-all-bdrv-states.o
  CC      stubs/clock-warp.o
  CC      stubs/cpu-get-clock.o
  CC      stubs/cpu-get-icount.o
  CC      stubs/dump.o
  CC      stubs/error-printf.o
  CC      stubs/fdset.o
  CC      stubs/gdbstub.o
  CC      stubs/get-vm-name.o
  CC      stubs/iothread.o
  CC      stubs/iothread-lock.o
  CC      stubs/is-daemonized.o
  CC      stubs/machine-init-done.o
  CC      stubs/migr-blocker.o
  CC      stubs/change-state-handler.o
  CC      stubs/monitor.o
  CC      stubs/notify-event.o
  CC      stubs/qtest.o
  CC      stubs/replay.o
  CC      stubs/runstate-check.o
  CC      stubs/set-fd-handler.o
  CC      stubs/slirp.o
  CC      stubs/sysbus.o
  CC      stubs/tpm.o
  CC      stubs/trace-control.o
  CC      stubs/uuid.o
  CC      stubs/vm-stop.o
  CC      stubs/vmstate.o
  CC      stubs/qmp_pc_dimm.o
  CC      stubs/target-monitor-defs.o
  CC      stubs/target-get-monitor-def.o
  CC      stubs/pc_madt_cpu_entry.o
  CC      stubs/vmgenid.o
  CC      stubs/xen-common.o
  CC      stubs/xen-hvm.o
  CC      stubs/pci-host-piix.o
  CC      contrib/ivshmem-client/ivshmem-client.o
  CC      contrib/ivshmem-client/main.o
  CC      contrib/ivshmem-server/ivshmem-server.o
  CC      contrib/ivshmem-server/main.o
  CC      qemu-nbd.o
  CC      block.o
  CC      blockjob.o
  CC      qemu-io-cmds.o
In file included from /tmp/qemu-test/src/qemu-nbd.c:29:
/tmp/qemu-test/src/include/block/nbd.h:262: error: expected declaration specifiers or '...' before 'NbdServerRemoveMode'
make: *** [qemu-nbd.o] Error 1
make: *** Waiting for unfinished jobs....
  CC      replication.o
In file included from /tmp/qemu-test/src/block.c:30:
/tmp/qemu-test/src/include/block/nbd.h:262: error: expected declaration specifiers or '...' before 'NbdServerRemoveMode'
make: *** [block.o] Error 1
Traceback (most recent call last):
  File "./tests/docker/docker.py", line 407, in <module>
    sys.exit(main())
  File "./tests/docker/docker.py", line 404, in main
    return args.cmdobj.run(args, argv)
  File "./tests/docker/docker.py", line 261, in run
    return Docker().run(argv, args.keep, quiet=args.quiet)
  File "./tests/docker/docker.py", line 229, in run
    quiet=quiet)
  File "./tests/docker/docker.py", line 147, in _do_check
    return subprocess.check_call(self._command + cmd, **kwargs)
  File "/usr/lib64/python2.7/subprocess.py", line 186, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['docker', 'run', '--label', 'com.qemu.instance.uuid=4b9a899c086611e8890352540069c830', '-u', '0', '--security-opt', 'seccomp=unconfined', '--rm', '--net=none', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=8', '-e', 'DEBUG=', '-e', 'SHOW_ENV=1', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/root/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-t2c_u19x/src/docker-src.2018-02-02-17.13.16.3631:/var/tmp/qemu:z,ro', 'qemu:min-glib', '/var/tmp/qemu/run', 'test-build']' returned non-zero exit status 2
make[1]: *** [tests/docker/Makefile.include:129: docker-run] Error 1
make: *** [tests/docker/Makefile.include:163: docker-run-test-build@min-glib] Error 2

real	1m5.880s
user	0m4.954s
sys	0m3.554s
=== OUTPUT END ===

Test command exited with code: 2


---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@freelists.org

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 01/21] qapi: Streamline boilerplate comment generation
  2018-02-02 15:08   ` Eric Blake
@ 2018-02-03  8:45     ` Markus Armbruster
  0 siblings, 0 replies; 87+ messages in thread
From: Markus Armbruster @ 2018-02-03  8:45 UTC (permalink / raw)
  To: Eric Blake; +Cc: qemu-devel, marcandre.lureau, mdroth

Eric Blake <eblake@redhat.com> writes:

> On 02/02/2018 07:03 AM, Markus Armbruster wrote:
>> Every generator has separate boilerplate for .h and .c, and their
>> differences are boring.  All of them repeat the license note.
>> 
>> Reduce the repetition as follows.  Move common text like the license
>> note to common open_output(), next to the existintg common text there.
>
> s/existintg/existing/

Fixing...

>> For each generator, replace the two separate descriptions by a single
>> one.
>> 
>> While there, emit an "automatically generated" note into generated
>> documentation, too.
>> 
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>> ---
>
>> +++ b/scripts/qapi2texi.py
>> @@ -282,7 +282,8 @@ def main(argv):
>>          print >>sys.stderr, ("%s: need pragma 'doc-required' "
>>                               "to generate documentation" % argv[0])
>>          sys.exit(1)
>> -    print texi_schema(schema)
>> +    print '@c AUTOMATICALLY GENERATED, DO NOT MODIFY\n'
>> +    print texi_schema(schema),
>
> Spurious addition of trailing comma. Otherwise,

This is Python's (rather unobvious) way to print without adding a
newline.

> Reviewed-by: Eric Blake <eblake@redhat.com>

Thanks!

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 02/21] qapi: Generate up-to-date copyright notice
  2018-02-02 15:47   ` Eric Blake
@ 2018-02-03  8:48     ` Markus Armbruster
  0 siblings, 0 replies; 87+ messages in thread
From: Markus Armbruster @ 2018-02-03  8:48 UTC (permalink / raw)
  To: Eric Blake; +Cc: qemu-devel, marcandre.lureau, mdroth

Eric Blake <eblake@redhat.com> writes:

> On 02/02/2018 07:03 AM, Markus Armbruster wrote:
>> Each generator carries a copyright notice for the generator itself,
>> and another one for the files it generates.  Only the former have been
>> updated along the way, the latter have not, and are all out of date.
>> 
>> Fix by copying the generator's copyright notice to the generated files
>> instead.
>> 
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>> ---
>
>> +++ b/scripts/qapi-commands.py
>> @@ -1,16 +1,17 @@
>> -#
>> -# QAPI command marshaller generator
>> -#
>> -# Copyright IBM, Corp. 2011
>> -# Copyright (C) 2014-2016 Red Hat, Inc.
>> -#
>> -# Authors:
>> -#  Anthony Liguori <aliguori@us.ibm.com>
>> -#  Michael Roth    <mdroth@linux.vnet.ibm.com>
>> -#  Markus Armbruster <armbru@redhat.com>
>> -#
>> -# This work is licensed under the terms of the GNU GPL, version 2.
>> -# See the COPYING file in the top-level directory.
>> +"""
>> +QAPI command marshaller generator
>> +
>> +Copyright IBM, Corp. 2011
>> +Copyright (C) 2014-2018 Red Hat, Inc.
>> +
>> +Authors:
>> + Anthony Liguori <aliguori@us.ibm.com>
>> + Michael Roth <mdroth@linux.vnet.ibm.com>
>> + Markus Armbruster <armbru@redhat.com>
>> +
>> +This work is licensed under the terms of the GNU GPL, version 2.
>> +See the COPYING file in the top-level directory.
>> +"""
>
> So python lets you start a file with a string constant that is not
> associated with any variable name?

It's the module's doc string, done the same way as function doc strings.

https://www.python.org/dev/peps/pep-0257/#what-is-a-docstring

>>  (fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix,
>>                              'qmp-marshal.c', 'qmp-commands.h',
>> -                            blurb)
>> +                            blurb, __doc__)
>
> Ah, and there's what I was missing - python auto-assigns such an initial
> string to a magic automatic variable.  Cool language feature I hadn't
> seen before!
>
> Reviewed-by: Eric Blake <eblake@redhat.com>

Thanks!

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 03/21] qapi: New classes QAPIGenC, QAPIGenH, QAPIGenDoc
  2018-02-02 15:59   ` Eric Blake
@ 2018-02-03  8:49     ` Markus Armbruster
  2018-02-05 15:46       ` Eric Blake
  0 siblings, 1 reply; 87+ messages in thread
From: Markus Armbruster @ 2018-02-03  8:49 UTC (permalink / raw)
  To: Eric Blake; +Cc: qemu-devel, marcandre.lureau, mdroth

Eric Blake <eblake@redhat.com> writes:

> On 02/02/2018 07:03 AM, Markus Armbruster wrote:
>> These classes encapsulate accumulating and writing output.
>> 
>> Convert C code generation to QAPIGenC and QAPIGenH.  The conversion is
>> rather shallow: most of the output accumulation is not converted.
>> Left for later.
>> 
>> The indentation machinery uses a single global variable indent_level,
>> even though we generally interleave creation of a .c and its .h.  It
>> should become instance variable of QAPIGenC.  Also left for later.
>> 
>> Documentation generation isn't converted, and QAPIGenDoc isn't used.
>> This will change shortly.
>> 
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>> ---
>>  scripts/qapi-commands.py   | 27 ++++++-------
>>  scripts/qapi-event.py      | 26 +++++++------
>>  scripts/qapi-introspect.py | 22 ++++++-----
>>  scripts/qapi-types.py      | 26 +++++++------
>>  scripts/qapi-visit.py      | 26 +++++++------
>>  scripts/qapi.py            | 96 ++++++++++++++++++++++++++--------------------
>>  6 files changed, 122 insertions(+), 101 deletions(-)
>> 
>
> A little bit longer due to more structure, but reasonable diffstat in
> that it shows the conversion is fairly straightforward and opens the
> doors for later patches to use the new structures more effectively.
>
>>  
>>  schema = QAPISchema(input_file)
>> -gen = QAPISchemaGenEventVisitor()
>> -schema.visit(gen)
>> -fdef.write(gen.defn)
>> -fdecl.write(gen.decl)
>> +vis = QAPISchemaGenEventVisitor()
>> +schema.visit(vis)
>> +genc.body(vis.defn)
>> +genh.body(vis.decl)
>
> I don't know if it is worth a sentence in the commit message that the
> visitor variable is renamed from 'gen' to 'vis' for less confusion with
> the new class instances 'genc' and 'genh'.

Did the rename give you pause when reviewing?

>> +++ b/scripts/qapi-types.py
>> @@ -180,7 +180,7 @@ class QAPISchemaGenTypeVisitor(QAPISchemaVisitor):
>>          self.decl = ''
>>          self.defn = ''
>>          self._fwdecl = ''
>> -        self._btin = guardstart('QAPI_TYPES_BUILTIN')
>> +        self._btin = '\n' + guardstart('QAPI_TYPES_BUILTIN')
>
> Tweaks like this means you were paying attention to still producing
> identical generated files; always a good sign.
>
> Reviewed-by: Eric Blake <eblake@redhat.com>

Thanks!

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 06/21] qapi-gen: New common driver for code and doc generators
  2018-02-02 19:27   ` Eric Blake
@ 2018-02-03  9:03     ` Markus Armbruster
  2018-02-05 15:52       ` Eric Blake
  0 siblings, 1 reply; 87+ messages in thread
From: Markus Armbruster @ 2018-02-03  9:03 UTC (permalink / raw)
  To: Eric Blake; +Cc: qemu-devel, marcandre.lureau, mdroth

Eric Blake <eblake@redhat.com> writes:

> On 02/02/2018 07:03 AM, Markus Armbruster wrote:
>> Whenever qapi-schema.json changes, we run six programs eleven times to
>> update eleven files.  This is silly.  Replace the six programs by a
>> single program that spits out all eleven files.
>
> Yay, about time!
>
> One program, but still invoked multiple times:
>
>> 
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>> ---
>>  Makefile                                           | 86 ++++++++++------------
>>  scripts/qapi-gen.py                                | 41 +++++++++++
>>  scripts/qapi/__init__.py                           |  0
>>  scripts/{qapi-commands.py => qapi/commands.py}     | 23 ++----
>>  scripts/{qapi.py => qapi/common.py}                |  0
>>  scripts/{qapi2texi.py => qapi/doc.py}              | 29 ++------
>>  scripts/{qapi-event.py => qapi/events.py}          | 23 ++----
>>  scripts/{qapi-introspect.py => qapi/introspect.py} | 32 ++------
>>  scripts/{qapi-types.py => qapi/types.py}           | 34 ++-------
>>  scripts/{qapi-visit.py => qapi/visit.py}           | 34 ++-------
>
> Maybe the commit message should mention:
>
> This requires moving some files around for proper use in python.

Yes, I should mention that I wrap the QAPI modules in a Python package.

>>  tests/Makefile.include                             | 56 +++++++-------
>>  tests/qapi-schema/test-qapi.py                     |  2 +-
>>  12 files changed, 140 insertions(+), 220 deletions(-)
>>  create mode 100755 scripts/qapi-gen.py
>>  create mode 100644 scripts/qapi/__init__.py
>>  rename scripts/{qapi-commands.py => qapi/commands.py} (94%)
>>  rename scripts/{qapi.py => qapi/common.py} (100%)
>>  rename scripts/{qapi2texi.py => qapi/doc.py} (92%)
>>  mode change 100755 => 100644
>
> Unintinentional?  We're inconsistent on which of our *.py files are
> executable in git.  Does it matter whether a file that is designed for
> use as a module is marked executable (if so, perhaps 5/21 should be
> adding the x attribute on other files, rather than this patch removing
> it on the doc generator).

qapi2texi.py is no longer runnable as a standalone program after this
patch.

So are qapi-{commands,events,introspect,types,visit}.py, but they never
had the executable bit set.

>> +++ b/Makefile
>
>> +qga/qapi-generated/qga-qapi-types.c qga/qapi-generated/qga-qapi-types.h \
>> +qga/qapi-generated/qga-qapi-visit.c qga/qapi-generated/qga-qapi-visit.h \
>> +qga/qapi-generated/qga-qmp-commands.h qga/qapi-generated/qga-qmp-marshal.c \
>> +qga/qapi-generated/qga-qapi.texi: \
>> +qga/qapi-generated/qapi-gen-timestamp ;
>> +qga/qapi-generated/qapi-gen-timestamp: $(SRC_PATH)/qga/qapi-schema.json $(qapi-py)
>> +	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-gen.py \
>> +		-o qga/qapi-generated -p "qga-" $<, \
>> +		"GEN","$(@:%-timestamp=%)")
>> +	@>$@
>
> once for qga,

That's the QAPI/QGA schema.  The commit message talks about the QAPI/QMP
schema.  I wish the two weren't named the same.

Modularization might make fusing them possible.  Whether that's a good
idea I don't know.

>> +qapi-types.c qapi-types.h \
>> +qapi-visit.c qapi-visit.h \
>> +qmp-commands.h qmp-marshal.c \
>> +qapi-event.c qapi-event.h \
>> +qmp-introspect.h qmp-introspect.c \
>> +qapi.texi: \
>> +qapi-gen-timestamp ;
>> +qapi-gen-timestamp: $(qapi-modules) $(qapi-py)
>> +	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-gen.py \
>> +		-o "." -b $<, \
>> +		"GEN","$(@:%-timestamp=%)")
>> +	@>$@
>
> and again for the main level.  Still, a definite improvement!

Perhaps I can find a way to clarify the commit message.

>> +++ b/scripts/qapi-gen.py
>
>> +def main(argv):
>> +    (input_file, output_dir, do_c, do_h, prefix, opts) = \
>> +        parse_command_line('bu', ['builtins', 'unmask-non-abi-names'])
>> +
>> +    opt_builtins = False
>> +    opt_unmask = False
>> +
>> +    for o, a in opts:
>> +        if o in ('-b', '--builtins'):
>> +            opt_builtins = True
>> +        if o in ('-u', '--unmask-non-abi-names'):
>> +            opt_unmask = True
>> +
>> +    schema = QAPISchema(input_file)
>> +
>> +    gen_types(schema, output_dir, prefix, opt_builtins)
>> +    gen_visit(schema, output_dir, prefix, opt_builtins)
>> +    gen_commands(schema, output_dir, prefix)
>> +    gen_events(schema, output_dir, prefix)
>> +    gen_introspect(schema, output_dir, prefix, opt_unmask)
>> +    gen_doc(schema, output_dir, prefix)
>
> Rather simple, but definitely nicer all in one python file than as a
> series of make rules.
>
>> @@ -255,13 +255,8 @@ class QAPISchemaGenCommandVisitor(QAPISchemaVisitor):
>>          self._regy += gen_register_command(name, success_response)
>>  
>>  
>> -def main(argv):
>> -    (input_file, output_dir, do_c, do_h, prefix, opts) = parse_command_line()
>> -
>> -    blurb = '''
>> - * Schema-defined QAPI/QMP commands
>> -'''
>> -
>> +def gen_commands(schema, output_dir, prefix):
>> +    blurb = ' * Schema-defined QAPI/QMP commands'
>
> Some churn on the definition of blurb; worth tidying this in the
> introduction earlier in the series?

Doesn't seem worth a separate patch, but I can try to reshuffle things
to reduce churn.

>> rename to scripts/qapi/introspect.py
>> index 09e7d1f140..2153060f2c 100644
>> --- a/scripts/qapi-introspect.py
>> +++ b/scripts/qapi/introspect.py
>> @@ -10,7 +10,7 @@ This work is licensed under the terms of the GNU GPL, version 2.
>>  See the COPYING file in the top-level directory.
>>  """
>>  
>> -from qapi import *
>> +from qapi.common import *
>>  
>>  
>>  # Caveman's json.dumps() replacement (we're stuck at Python 2.4)
>> @@ -168,22 +168,8 @@ const char %(c_name)s[] = %(c_string)s;
>>          self._gen_json(name, 'event', {'arg-type': self._use_type(arg_type)})
>>  
>>  
>> -def main(argv):
>> -    # Debugging aid: unmask QAPI schema's type names
>> -    # We normally mask them, because they're not QMP wire ABI
>> -    opt_unmask = False
>> -
>> -    (input_file, output_dir, do_c, do_h, prefix, opts) = \
>> -        parse_command_line('u', ['unmask-non-abi-names'])
>
> Hmm - we didn't have any docs about this hidden command line option; I
> see you still preserved it, but it may be worth mentioning in your
> pending doc updates for the series respin.

Maybe.

Providing --help would probably be more useful.  We should convert
qapi-gen.py to argparse.

>> --- a/tests/Makefile.include
>> +++ b/tests/Makefile.include
>> @@ -23,7 +23,16 @@ check-help:
>>  ifneq ($(wildcard config-host.mak),)
>>  export SRC_PATH
>>  
>> -qapi-py = $(SRC_PATH)/scripts/qapi.py $(SRC_PATH)/scripts/ordereddict.py
>> +# TODO don't duplicate $(SRC_PATH)/Makefile's qapi-py here
>> +qapi-py = $(SRC_PATH)/scripts/qapi/commands.py \
>> +$(SRC_PATH)/scripts/qapi/events.py \
>> +$(SRC_PATH)/scripts/qapi/introspect.py \
>> +$(SRC_PATH)/scripts/qapi/types.py \
>> +$(SRC_PATH)/scripts/qapi/visit.py \
>> +$(SRC_PATH)/scripts/qapi/common.py \
>> +$(SRC_PATH)/scripts/qapi/doc.py \
>> +$(SRC_PATH)/scripts/ordereddict.py \
>> +$(SRC_PATH)/scripts/qapi-gen.py
>
> So, were you counting these in the 11 generated files mentioned in the
> commit message? :)

I'm not sure I understand what you mean here...

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 08/21] qapi: Touch generated files only when they change
  2018-02-02 19:42   ` Eric Blake
@ 2018-02-03  9:05     ` Markus Armbruster
  0 siblings, 0 replies; 87+ messages in thread
From: Markus Armbruster @ 2018-02-03  9:05 UTC (permalink / raw)
  To: Eric Blake; +Cc: qemu-devel, marcandre.lureau, mdroth

Eric Blake <eblake@redhat.com> writes:

> On 02/02/2018 07:03 AM, Markus Armbruster wrote:
>> A massive number of objects depends on QAPI-generated headers.  In my
>> "build everything" tree, it's roughly 4500 out of 4800.  This is
>> particularly annoying when only some of the generated files change,
>> say for a doc fix.
>> 
>> Improve qapi-gen.py to touch its output files only if they actually
>> change.  Rebuild time for a QAPI doc fix drops from many minutes to a
>> few seconds.  Rebuilds get faster for certain code changes, too.  For
>> instance, adding a simple QMP event now recompiles less than 200
>> instead of 4500 objects.  But adding a QAPI type is as bad as ever; we
>> clearly got more work to do.
>
> The last phrase sounds quite colloquial.  It may have been intentional;
> but if not, s/we/we've/

I'll change it.

>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>> ---
>>  scripts/qapi/common.py | 11 +++++++++--
>>  1 file changed, 9 insertions(+), 2 deletions(-)
>> 
>> diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py
>> index cfa2671ca3..be0fcc548a 100644
>> --- a/scripts/qapi/common.py
>> +++ b/scripts/qapi/common.py
>> @@ -1944,9 +1944,16 @@ class QAPIGen(object):
>>              except os.error as e:
>>                  if e.errno != errno.EEXIST:
>>                      raise
>> -        f = open(os.path.join(output_dir, fname), 'w')
>> -        f.write(self.top(fname) + self._preamble + self._body
>> +        fd = os.open(os.path.join(output_dir, fname),
>> +                     os.O_RDWR | os.O_CREAT, 0666)
>> +        f = os.fdopen(fd, 'r+')
>> +        text = (self.top(fname) + self._preamble + self._body
>>                  + self.bottom(fname))
>> +        oldtext = f.read(len(text) + 1)
>> +        if text != oldtext:
>> +            f.seek(0)
>> +            f.truncate(0)
>> +            f.write(text)
>
> In-memory rewrite rather than playing games with a secondary file
> combined with the rename(2) syscall.  It means you're not atomic (an
> external reader has a window of time where they can see an incomplete
> version of the file).

Same as before.

>                        But I think make dependency rules mean we don't
> care - even in a parallel rule, as long as all clients depend on the
> timestamp file, and the timestamp file isn't updated until all our
> rewrites (if any) have settled, then we don't create any of those
> external readers that can find the window of incomplete contents.
>
> Reviewed-by: Eric Blake <eblake@redhat.com>

Thanks!

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 09/21] qapi: Don't absolutize include file name in error messages
  2018-02-02 20:22   ` Eric Blake
@ 2018-02-03  9:08     ` Markus Armbruster
  2018-02-05 15:55       ` Eric Blake
  0 siblings, 1 reply; 87+ messages in thread
From: Markus Armbruster @ 2018-02-03  9:08 UTC (permalink / raw)
  To: Eric Blake; +Cc: qemu-devel, marcandre.lureau, mdroth

Eric Blake <eblake@redhat.com> writes:

> On 02/02/2018 07:03 AM, Markus Armbruster wrote:
>> Error messages print absolute filenames of included files even gave a
>
> s/even gave/even when given/

I meant to write "even if the user gave".  Is that okay?

>> relative one on the command line:
>> 
>>      PYTHONPATH=scripts python -B tests/qapi-schema/test-qapi.py tests/qapi-schema/include-cycle.json
>>     In file included from tests/qapi-schema/include-cycle.json:1:
>>     In file included from /work/armbru/qemu/tests/qapi-schema/include-cycle-b.json:1:
>>     /work/armbru/qemu/tests/qapi-schema/include-cycle-c.json:1: Inclusion loop for include-cycle.json
>> 
>> Improve this to
>> 
>>     In file included from tests/qapi-schema/include-cycle.json:1:
>>     In file included from tests/qapi-schema/include-cycle-b.json:1:
>>     tests/qapi-schema/include-cycle-c.json:1: Inclusion loop for include-cycle.json
>
> Nice, and makes developing new qapi tests a little less painful since
> it's less modification to qapi-schema/*.err additions.

Probably not, as our make rule strips off $(SRC_PATH):

	@perl -p -e 's|\Q$(SRC_PATH)\E/||g' $*.test.err | diff -q $(SRC_PATH)/$*.err -

I've kept that, because it might also occur in stack backtraces.  I
think.

>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>> ---
>>  scripts/qapi/common.py                | 12 ++++++------
>>  tests/qapi-schema/include-no-file.err |  2 +-
>>  2 files changed, 7 insertions(+), 7 deletions(-)
>> 
>
> Reviewed-by: Eric Blake <eblake@redhat.com>

Thanks!

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code
  2018-02-02 16:44 ` Daniel P. Berrangé
@ 2018-02-03  9:18   ` Markus Armbruster
  0 siblings, 0 replies; 87+ messages in thread
From: Markus Armbruster @ 2018-02-03  9:18 UTC (permalink / raw)
  To: Daniel P. Berrangé; +Cc: marcandre.lureau, qemu-devel, mdroth

Daniel P. Berrangé <berrange@redhat.com> writes:

> On Fri, Feb 02, 2018 at 02:03:15PM +0100, Markus Armbruster wrote:
>> Our qapi-schema.json is composed of modules connected by include
>> directives, but the generated code is monolithic all the same: one
>> qapi-types.h with all the types, one qapi-visit.h with all the
>> visitors, and so forth.  These monolithic headers get included all
>> over the place.  In my "build everyhing" tree, adding a QAPI type
>> recompiles about 4500 out of 4800 objects.
>> 
>> Nobody would write such monolithic headers by hand.  It stands to
>> reason that one shouldn't generate them, either.
>> 
>> This series' basic idea is to split up generated headers to mirror the
>> schema's modular structure: one header per module.  That way, you can
>> include just what you need.
>> 
>> The series is RFC for a number of reasons:
>> 
>> * The split is implemented only for qapi-types.h.  That one should
>>   provide the biggest benefits, though.
>> 
>> * There's a bit of code duplication.
>> 
>> * I haven't re-read my patches, yet.
>> 
>> Even in this incomplete state, the compile-time improvements can be
>> massive.  Before this series, any QAPI schema change recompiles some
>> 4500 out of 4800 objects in my "build everything" tree.  Afterwards,
>> adding a type to qapi/migration.json recompiles less than 400, adding
>> a QMP event recompiles less than 200, and a documentation change no
>> longer recompiles anything.
>
> Having gone through the same exercise for trace.h, I very much welcome
> this effort for QAPI too !

Thanks!

> If I consider the crypto stuff I maintain, the QAPI definitions are
> in qapi/crypto.json.
>
> From my POV, I feel it would be natural to have them move to instead
> be at  crypto/qapi.json, and have the generated headers/source files be
> crypto/qapi-types.h, crypto/qapi-visit.h, etc.
>
> This would mirror what we did with tracing, crypto/trace-events, and
> generating crypto/trace*.{c,h}

Make sense from a QAPI-using subsystem's point of view.

However, from the QAPI/QMP external interface point of view, keeping the
interface in one place also makes sense.  Not least for ease of grep
(I'm admittedly biased there).

If we decide we want to move the QAPI schema sub-modules anyway, we can
do that on top.

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code
  2018-02-02 13:03 [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code Markus Armbruster
                   ` (27 preceding siblings ...)
  2018-02-02 22:14 ` no-reply
@ 2018-02-03 11:30 ` Markus Armbruster
  28 siblings, 0 replies; 87+ messages in thread
From: Markus Armbruster @ 2018-02-03 11:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: marcandre.lureau, eblake, mdroth

Conflicts with commit a3b0dc7582 "qapi: add nbd-server-remove".  I
pushed the exact version I posted to my public repository:
http://repo.or.cz/qemu/armbru.git/shortlog/refs/heads/qapi-monolith

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 01/21] qapi: Streamline boilerplate comment generation
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 01/21] qapi: Streamline boilerplate comment generation Markus Armbruster
  2018-02-02 15:08   ` Eric Blake
@ 2018-02-05 13:44   ` Marc-Andre Lureau
  1 sibling, 0 replies; 87+ messages in thread
From: Marc-Andre Lureau @ 2018-02-05 13:44 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: qemu-devel, marcandre, Blake, Eric, mdroth

On Fri, Feb 2, 2018 at 2:03 PM, Markus Armbruster <armbru@redhat.com> wrote:
> Every generator has separate boilerplate for .h and .c, and their
> differences are boring.  All of them repeat the license note.
>
> Reduce the repetition as follows.  Move common text like the license
> note to common open_output(), next to the existintg common text there.
> For each generator, replace the two separate descriptions by a single
> one.
>
> While there, emit an "automatically generated" note into generated
> documentation, too.
>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

Looks good,
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>


> ---
>  scripts/qapi-commands.py        | 26 +++-----------------------
>  scripts/qapi-event.py           | 26 +++-----------------------
>  scripts/qapi-introspect.py      | 21 ++-------------------
>  scripts/qapi-types.py           | 26 +++-----------------------
>  scripts/qapi-visit.py           | 26 +++-----------------------
>  scripts/qapi.py                 | 31 ++++++++++++++++++-------------
>  scripts/qapi2texi.py            |  3 ++-
>  tests/qapi-schema/doc-good.texi |  3 ++-
>  8 files changed, 36 insertions(+), 126 deletions(-)
>
> diff --git a/scripts/qapi-commands.py b/scripts/qapi-commands.py
> index 26c56c5062..25ac52503a 100644
> --- a/scripts/qapi-commands.py
> +++ b/scripts/qapi-commands.py
> @@ -255,38 +255,18 @@ class QAPISchemaGenCommandVisitor(QAPISchemaVisitor):
>
>  (input_file, output_dir, do_c, do_h, prefix, opts) = parse_command_line()
>
> -c_comment = '''
> -/*
> - * schema-defined QMP->QAPI command dispatch
> +blurb = '''
> + * Schema-defined QAPI/QMP commands
>   *
>   * Copyright IBM, Corp. 2011
>   *
>   * Authors:
>   *  Anthony Liguori   <aliguori@us.ibm.com>
> - *
> - * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
> - * See the COPYING.LIB file in the top-level directory.
> - *
> - */
> -'''
> -h_comment = '''
> -/*
> - * schema-defined QAPI function prototypes
> - *
> - * Copyright IBM, Corp. 2011
> - *
> - * Authors:
> - *  Anthony Liguori   <aliguori@us.ibm.com>
> - *
> - * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
> - * See the COPYING.LIB file in the top-level directory.
> - *
> - */
>  '''
>
>  (fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix,
>                              'qmp-marshal.c', 'qmp-commands.h',
> -                            c_comment, h_comment)
> +                            blurb)
>
>  fdef.write(mcgen('''
>
> diff --git a/scripts/qapi-event.py b/scripts/qapi-event.py
> index 9d7134658d..31faedc689 100644
> --- a/scripts/qapi-event.py
> +++ b/scripts/qapi-event.py
> @@ -171,38 +171,18 @@ class QAPISchemaGenEventVisitor(QAPISchemaVisitor):
>
>  (input_file, output_dir, do_c, do_h, prefix, dummy) = parse_command_line()
>
> -c_comment = '''
> -/*
> - * schema-defined QAPI event functions
> +blurb = '''
> + * Schema-defined QAPI/QMP events
>   *
>   * Copyright (c) 2014 Wenchao Xia
>   *
>   * Authors:
>   *  Wenchao Xia   <wenchaoqemu@gmail.com>
> - *
> - * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
> - * See the COPYING.LIB file in the top-level directory.
> - *
> - */
> -'''
> -h_comment = '''
> -/*
> - * schema-defined QAPI event functions
> - *
> - * Copyright (c) 2014 Wenchao Xia
> - *
> - * Authors:
> - *  Wenchao Xia  <wenchaoqemu@gmail.com>
> - *
> - * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
> - * See the COPYING.LIB file in the top-level directory.
> - *
> - */
>  '''
>
>  (fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix,
>                              'qapi-event.c', 'qapi-event.h',
> -                            c_comment, h_comment)
> +                            blurb)
>
>  fdef.write(mcgen('''
>  #include "qemu/osdep.h"
> diff --git a/scripts/qapi-introspect.py b/scripts/qapi-introspect.py
> index 032bcea491..83da2bdb94 100644
> --- a/scripts/qapi-introspect.py
> +++ b/scripts/qapi-introspect.py
> @@ -176,32 +176,15 @@ for o, a in opts:
>      if o in ('-u', '--unmask-non-abi-names'):
>          opt_unmask = True
>
> -c_comment = '''
> -/*
> +blurb = '''
>   * QAPI/QMP schema introspection
>   *
>   * Copyright (C) 2015 Red Hat, Inc.
> - *
> - * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
> - * See the COPYING.LIB file in the top-level directory.
> - *
> - */
> -'''
> -h_comment = '''
> -/*
> - * QAPI/QMP schema introspection
> - *
> - * Copyright (C) 2015 Red Hat, Inc.
> - *
> - * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
> - * See the COPYING.LIB file in the top-level directory.
> - *
> - */
>  '''
>
>  (fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix,
>                              'qmp-introspect.c', 'qmp-introspect.h',
> -                            c_comment, h_comment)
> +                            blurb)
>
>  fdef.write(mcgen('''
>  #include "qemu/osdep.h"
> diff --git a/scripts/qapi-types.py b/scripts/qapi-types.py
> index 7e3051dbb9..86afc57f92 100644
> --- a/scripts/qapi-types.py
> +++ b/scripts/qapi-types.py
> @@ -250,39 +250,19 @@ for o, a in opts:
>      if o in ('-b', '--builtins'):
>          do_builtins = True
>
> -c_comment = '''
> -/*
> - * deallocation functions for schema-defined QAPI types
> +blurb = '''
> + * Schema-defined QAPI types
>   *
>   * Copyright IBM, Corp. 2011
>   *
>   * Authors:
>   *  Anthony Liguori   <aliguori@us.ibm.com>
>   *  Michael Roth      <mdroth@linux.vnet.ibm.com>
> - *
> - * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
> - * See the COPYING.LIB file in the top-level directory.
> - *
> - */
> -'''
> -h_comment = '''
> -/*
> - * schema-defined QAPI types
> - *
> - * Copyright IBM, Corp. 2011
> - *
> - * Authors:
> - *  Anthony Liguori   <aliguori@us.ibm.com>
> - *
> - * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
> - * See the COPYING.LIB file in the top-level directory.
> - *
> - */
>  '''
>
>  (fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix,
>                              'qapi-types.c', 'qapi-types.h',
> -                            c_comment, h_comment)
> +                            blurb)
>
>  fdef.write(mcgen('''
>  #include "qemu/osdep.h"
> diff --git a/scripts/qapi-visit.py b/scripts/qapi-visit.py
> index 7e1cfc13f0..9f7127e548 100644
> --- a/scripts/qapi-visit.py
> +++ b/scripts/qapi-visit.py
> @@ -334,38 +334,18 @@ for o, a in opts:
>      if o in ('-b', '--builtins'):
>          do_builtins = True
>
> -c_comment = '''
> -/*
> - * schema-defined QAPI visitor functions
> +blurb = '''
> + * Schema-defined QAPI visitors
>   *
>   * Copyright IBM, Corp. 2011
>   *
>   * Authors:
>   *  Anthony Liguori   <aliguori@us.ibm.com>
> - *
> - * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
> - * See the COPYING.LIB file in the top-level directory.
> - *
> - */
> -'''
> -h_comment = '''
> -/*
> - * schema-defined QAPI visitor functions
> - *
> - * Copyright IBM, Corp. 2011
> - *
> - * Authors:
> - *  Anthony Liguori   <aliguori@us.ibm.com>
> - *
> - * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
> - * See the COPYING.LIB file in the top-level directory.
> - *
> - */
>  '''
>
>  (fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix,
>                              'qapi-visit.c', 'qapi-visit.h',
> -                            c_comment, h_comment)
> +                            blurb)
>
>  fdef.write(mcgen('''
>  #include "qemu/osdep.h"
> diff --git a/scripts/qapi.py b/scripts/qapi.py
> index 43a54bf40f..2e4b2bc9eb 100644
> --- a/scripts/qapi.py
> +++ b/scripts/qapi.py
> @@ -1975,11 +1975,21 @@ def parse_command_line(extra_options='', extra_long_options=[]):
>  #
>
>
> -def open_output(output_dir, do_c, do_h, prefix, c_file, h_file,
> -                c_comment, h_comment):
> +def open_output(output_dir, do_c, do_h, prefix, c_file, h_file, blurb):
>      guard = guardname(prefix + h_file)
>      c_file = output_dir + prefix + c_file
>      h_file = output_dir + prefix + h_file
> +    comment = mcgen('''/* AUTOMATICALLY GENERATED, DO NOT MODIFY */
> +
> +/*
> +%(blurb)s
> + *
> + * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
> + * See the COPYING.LIB file in the top-level directory.
> + */
> +
> +''',
> +                    blurb=blurb.strip('\n'))
>
>      if output_dir:
>          try:
> @@ -1998,27 +2008,22 @@ def open_output(output_dir, do_c, do_h, prefix, c_file, h_file,
>      fdef = maybe_open(do_c, c_file, 'w')
>      fdecl = maybe_open(do_h, h_file, 'w')
>
> -    fdef.write(mcgen('''
> -/* AUTOMATICALLY GENERATED, DO NOT MODIFY */
> -%(comment)s
> -''',
> -                     comment=c_comment))
> -
> +    fdef.write(comment)
> +    fdecl.write(comment)
>      fdecl.write(mcgen('''
> -/* AUTOMATICALLY GENERATED, DO NOT MODIFY */
> -%(comment)s
>  #ifndef %(guard)s
>  #define %(guard)s
>
>  ''',
> -                      comment=h_comment, guard=guard))
> +                      guard=guard))
>
>      return (fdef, fdecl)
>
>
>  def close_output(fdef, fdecl):
> -    fdecl.write('''
> +    fdecl.write(mcgen('''
> +
>  #endif
> -''')
> +'''))
>      fdecl.close()
>      fdef.close()
> diff --git a/scripts/qapi2texi.py b/scripts/qapi2texi.py
> index 92e2af2cd6..924b374cd3 100755
> --- a/scripts/qapi2texi.py
> +++ b/scripts/qapi2texi.py
> @@ -282,7 +282,8 @@ def main(argv):
>          print >>sys.stderr, ("%s: need pragma 'doc-required' "
>                               "to generate documentation" % argv[0])
>          sys.exit(1)
> -    print texi_schema(schema)
> +    print '@c AUTOMATICALLY GENERATED, DO NOT MODIFY\n'
> +    print texi_schema(schema),
>
>
>  if __name__ == '__main__':
> diff --git a/tests/qapi-schema/doc-good.texi b/tests/qapi-schema/doc-good.texi
> index 1778312581..0aed2300a5 100644
> --- a/tests/qapi-schema/doc-good.texi
> +++ b/tests/qapi-schema/doc-good.texi
> @@ -1,3 +1,5 @@
> +@c AUTOMATICALLY GENERATED, DO NOT MODIFY
> +
>  @section Section
>
>  @subsection Subsection
> @@ -231,4 +233,3 @@ If you're bored enough to read this, go see a video of boxed cats
>
>  @end deftypefn
>
> -
> --
> 2.13.6
>

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 02/21] qapi: Generate up-to-date copyright notice
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 02/21] qapi: Generate up-to-date copyright notice Markus Armbruster
  2018-02-02 15:47   ` Eric Blake
@ 2018-02-05 13:44   ` Marc-Andre Lureau
  2018-02-05 15:28     ` Markus Armbruster
  2018-02-05 15:45     ` Eric Blake
  1 sibling, 2 replies; 87+ messages in thread
From: Marc-Andre Lureau @ 2018-02-05 13:44 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: qemu-devel, marcandre, Blake, Eric, mdroth

Hi

On Fri, Feb 2, 2018 at 2:03 PM, Markus Armbruster <armbru@redhat.com> wrote:
> Each generator carries a copyright notice for the generator itself,
> and another one for the files it generates.  Only the former have been
> updated along the way, the latter have not, and are all out of date.
>
> Fix by copying the generator's copyright notice to the generated files
> instead.

That makes sense, but we loose the Author lines in the generated
files. Not a big deal I guess, but worth to point out, no?

>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

Other than that,
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>


> ---
>  scripts/qapi-commands.py   | 34 +++++++++++++++-------------------
>  scripts/qapi-event.py      | 32 ++++++++++++++------------------
>  scripts/qapi-introspect.py | 25 ++++++++++++-------------
>  scripts/qapi-types.py      | 32 ++++++++++++++------------------
>  scripts/qapi-visit.py      | 34 +++++++++++++++-------------------
>  scripts/qapi.py            |  7 +++++--
>  6 files changed, 75 insertions(+), 89 deletions(-)
>
> diff --git a/scripts/qapi-commands.py b/scripts/qapi-commands.py
> index 25ac52503a..a861ac52e7 100644
> --- a/scripts/qapi-commands.py
> +++ b/scripts/qapi-commands.py
> @@ -1,16 +1,17 @@
> -#
> -# QAPI command marshaller generator
> -#
> -# Copyright IBM, Corp. 2011
> -# Copyright (C) 2014-2016 Red Hat, Inc.
> -#
> -# Authors:
> -#  Anthony Liguori <aliguori@us.ibm.com>
> -#  Michael Roth    <mdroth@linux.vnet.ibm.com>
> -#  Markus Armbruster <armbru@redhat.com>
> -#
> -# This work is licensed under the terms of the GNU GPL, version 2.
> -# See the COPYING file in the top-level directory.
> +"""
> +QAPI command marshaller generator
> +
> +Copyright IBM, Corp. 2011
> +Copyright (C) 2014-2018 Red Hat, Inc.
> +
> +Authors:
> + Anthony Liguori <aliguori@us.ibm.com>
> + Michael Roth <mdroth@linux.vnet.ibm.com>
> + Markus Armbruster <armbru@redhat.com>
> +
> +This work is licensed under the terms of the GNU GPL, version 2.
> +See the COPYING file in the top-level directory.
> +"""
>
>  from qapi import *
>
> @@ -257,16 +258,11 @@ class QAPISchemaGenCommandVisitor(QAPISchemaVisitor):
>
>  blurb = '''
>   * Schema-defined QAPI/QMP commands
> - *
> - * Copyright IBM, Corp. 2011
> - *
> - * Authors:
> - *  Anthony Liguori   <aliguori@us.ibm.com>
>  '''
>
>  (fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix,
>                              'qmp-marshal.c', 'qmp-commands.h',
> -                            blurb)
> +                            blurb, __doc__)
>
>  fdef.write(mcgen('''
>
> diff --git a/scripts/qapi-event.py b/scripts/qapi-event.py
> index 31faedc689..b1d611c5ea 100644
> --- a/scripts/qapi-event.py
> +++ b/scripts/qapi-event.py
> @@ -1,15 +1,16 @@
> -#
> -# QAPI event generator
> -#
> -# Copyright (c) 2014 Wenchao Xia
> -# Copyright (c) 2015-2016 Red Hat Inc.
> -#
> -# Authors:
> -#  Wenchao Xia <wenchaoqemu@gmail.com>
> -#  Markus Armbruster <armbru@redhat.com>
> -#
> -# This work is licensed under the terms of the GNU GPL, version 2.
> -# See the COPYING file in the top-level directory.
> +"""
> +QAPI event generator
> +
> +Copyright (c) 2014 Wenchao Xia
> +Copyright (c) 2015-2018 Red Hat Inc.
> +
> +Authors:
> + Wenchao Xia <wenchaoqemu@gmail.com>
> + Markus Armbruster <armbru@redhat.com>
> +
> +This work is licensed under the terms of the GNU GPL, version 2.
> +See the COPYING file in the top-level directory.
> +"""
>
>  from qapi import *
>
> @@ -173,16 +174,11 @@ class QAPISchemaGenEventVisitor(QAPISchemaVisitor):
>
>  blurb = '''
>   * Schema-defined QAPI/QMP events
> - *
> - * Copyright (c) 2014 Wenchao Xia
> - *
> - * Authors:
> - *  Wenchao Xia   <wenchaoqemu@gmail.com>
>  '''
>
>  (fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix,
>                              'qapi-event.c', 'qapi-event.h',
> -                            blurb)
> +                            blurb, __doc__)
>
>  fdef.write(mcgen('''
>  #include "qemu/osdep.h"
> diff --git a/scripts/qapi-introspect.py b/scripts/qapi-introspect.py
> index 83da2bdb94..bd9253a172 100644
> --- a/scripts/qapi-introspect.py
> +++ b/scripts/qapi-introspect.py
> @@ -1,13 +1,14 @@
> -#
> -# QAPI introspection generator
> -#
> -# Copyright (C) 2015-2016 Red Hat, Inc.
> -#
> -# Authors:
> -#  Markus Armbruster <armbru@redhat.com>
> -#
> -# This work is licensed under the terms of the GNU GPL, version 2.
> -# See the COPYING file in the top-level directory.
> +"""
> +QAPI introspection generator
> +
> +Copyright (C) 2015-2018 Red Hat, Inc.
> +
> +Authors:
> + Markus Armbruster <armbru@redhat.com>
> +
> +This work is licensed under the terms of the GNU GPL, version 2.
> +See the COPYING file in the top-level directory.
> +"""
>
>  from qapi import *
>
> @@ -178,13 +179,11 @@ for o, a in opts:
>
>  blurb = '''
>   * QAPI/QMP schema introspection
> - *
> - * Copyright (C) 2015 Red Hat, Inc.
>  '''
>
>  (fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix,
>                              'qmp-introspect.c', 'qmp-introspect.h',
> -                            blurb)
> +                            blurb, __doc__)
>
>  fdef.write(mcgen('''
>  #include "qemu/osdep.h"
> diff --git a/scripts/qapi-types.py b/scripts/qapi-types.py
> index 86afc57f92..1103dbda2d 100644
> --- a/scripts/qapi-types.py
> +++ b/scripts/qapi-types.py
> @@ -1,15 +1,17 @@
> -#
> -# QAPI types generator
> -#
> -# Copyright IBM, Corp. 2011
> -# Copyright (c) 2013-2016 Red Hat Inc.
> -#
> -# Authors:
> -#  Anthony Liguori <aliguori@us.ibm.com>
> -#  Markus Armbruster <armbru@redhat.com>
> -#
> -# This work is licensed under the terms of the GNU GPL, version 2.
> +"""
> +QAPI types generator
> +
> +Copyright IBM, Corp. 2011
> +Copyright (c) 2013-2018 Red Hat Inc.
> +
> +Authors:
> + Anthony Liguori <aliguori@us.ibm.com>
> + Michael Roth <mdroth@linux.vnet.ibm.com>
> + Markus Armbruster <armbru@redhat.com>
> +
> +This work is licensed under the terms of the GNU GPL, version 2.
>  # See the COPYING file in the top-level directory.
> +"""
>
>  from qapi import *
>
> @@ -252,17 +254,11 @@ for o, a in opts:
>
>  blurb = '''
>   * Schema-defined QAPI types
> - *
> - * Copyright IBM, Corp. 2011
> - *
> - * Authors:
> - *  Anthony Liguori   <aliguori@us.ibm.com>
> - *  Michael Roth      <mdroth@linux.vnet.ibm.com>
>  '''
>
>  (fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix,
>                              'qapi-types.c', 'qapi-types.h',
> -                            blurb)
> +                            blurb, __doc__)
>
>  fdef.write(mcgen('''
>  #include "qemu/osdep.h"
> diff --git a/scripts/qapi-visit.py b/scripts/qapi-visit.py
> index 9f7127e548..5231f89c36 100644
> --- a/scripts/qapi-visit.py
> +++ b/scripts/qapi-visit.py
> @@ -1,16 +1,17 @@
> -#
> -# QAPI visitor generator
> -#
> -# Copyright IBM, Corp. 2011
> -# Copyright (C) 2014-2016 Red Hat, Inc.
> -#
> -# Authors:
> -#  Anthony Liguori <aliguori@us.ibm.com>
> -#  Michael Roth    <mdroth@linux.vnet.ibm.com>
> -#  Markus Armbruster <armbru@redhat.com>
> -#
> -# This work is licensed under the terms of the GNU GPL, version 2.
> -# See the COPYING file in the top-level directory.
> +"""
> +QAPI visitor generator
> +
> +Copyright IBM, Corp. 2011
> +Copyright (C) 2014-2018 Red Hat, Inc.
> +
> +Authors:
> + Anthony Liguori <aliguori@us.ibm.com>
> + Michael Roth    <mdroth@linux.vnet.ibm.com>
> + Markus Armbruster <armbru@redhat.com>
> +
> +This work is licensed under the terms of the GNU GPL, version 2.
> +See the COPYING file in the top-level directory.
> +"""
>
>  from qapi import *
>
> @@ -336,16 +337,11 @@ for o, a in opts:
>
>  blurb = '''
>   * Schema-defined QAPI visitors
> - *
> - * Copyright IBM, Corp. 2011
> - *
> - * Authors:
> - *  Anthony Liguori   <aliguori@us.ibm.com>
>  '''
>
>  (fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix,
>                              'qapi-visit.c', 'qapi-visit.h',
> -                            blurb)
> +                            blurb, __doc__)
>
>  fdef.write(mcgen('''
>  #include "qemu/osdep.h"
> diff --git a/scripts/qapi.py b/scripts/qapi.py
> index 2e4b2bc9eb..d0816f7479 100644
> --- a/scripts/qapi.py
> +++ b/scripts/qapi.py
> @@ -1975,21 +1975,24 @@ def parse_command_line(extra_options='', extra_long_options=[]):
>  #
>
>
> -def open_output(output_dir, do_c, do_h, prefix, c_file, h_file, blurb):
> +def open_output(output_dir, do_c, do_h, prefix, c_file, h_file, blurb, doc):
>      guard = guardname(prefix + h_file)
>      c_file = output_dir + prefix + c_file
>      h_file = output_dir + prefix + h_file
> +    copyright = '\n * '.join(re.findall(r'^Copyright .*', doc, re.MULTILINE))
>      comment = mcgen('''/* AUTOMATICALLY GENERATED, DO NOT MODIFY */
>
>  /*
>  %(blurb)s
>   *
> + * %(copyright)s
> + *
>   * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
>   * See the COPYING.LIB file in the top-level directory.
>   */
>
>  ''',
> -                    blurb=blurb.strip('\n'))
> +                    blurb=blurb.strip('\n'), copyright=copyright)
>
>      if output_dir:
>          try:
> --
> 2.13.6
>

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 03/21] qapi: New classes QAPIGenC, QAPIGenH, QAPIGenDoc
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 03/21] qapi: New classes QAPIGenC, QAPIGenH, QAPIGenDoc Markus Armbruster
  2018-02-02 15:59   ` Eric Blake
@ 2018-02-05 13:44   ` Marc-Andre Lureau
  2018-02-05 15:34     ` Markus Armbruster
  1 sibling, 1 reply; 87+ messages in thread
From: Marc-Andre Lureau @ 2018-02-05 13:44 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: qemu-devel, marcandre, Blake, Eric, mdroth

Hi

On Fri, Feb 2, 2018 at 2:03 PM, Markus Armbruster <armbru@redhat.com> wrote:
> These classes encapsulate accumulating and writing output.
>
> Convert C code generation to QAPIGenC and QAPIGenH.  The conversion is
> rather shallow: most of the output accumulation is not converted.
> Left for later.
>
> The indentation machinery uses a single global variable indent_level,
> even though we generally interleave creation of a .c and its .h.  It
> should become instance variable of QAPIGenC.  Also left for later.
>
> Documentation generation isn't converted, and QAPIGenDoc isn't used.
> This will change shortly.
>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  scripts/qapi-commands.py   | 27 ++++++-------
>  scripts/qapi-event.py      | 26 +++++++------
>  scripts/qapi-introspect.py | 22 ++++++-----
>  scripts/qapi-types.py      | 26 +++++++------
>  scripts/qapi-visit.py      | 26 +++++++------
>  scripts/qapi.py            | 96 ++++++++++++++++++++++++++--------------------
>  6 files changed, 122 insertions(+), 101 deletions(-)
>
> diff --git a/scripts/qapi-commands.py b/scripts/qapi-commands.py
> index a861ac52e7..4be7dbc482 100644
> --- a/scripts/qapi-commands.py
> +++ b/scripts/qapi-commands.py
> @@ -260,12 +260,10 @@ blurb = '''
>   * Schema-defined QAPI/QMP commands
>  '''
>
> -(fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix,
> -                            'qmp-marshal.c', 'qmp-commands.h',
> -                            blurb, __doc__)
> -
> -fdef.write(mcgen('''
> +genc = QAPIGenC(blurb, __doc__)
> +genh = QAPIGenH(blurb, __doc__)
>
> +genc.body(mcgen('''
>  #include "qemu/osdep.h"
>  #include "qemu-common.h"
>  #include "qemu/module.h"
> @@ -279,21 +277,24 @@ fdef.write(mcgen('''
>  #include "%(prefix)sqmp-commands.h"
>
>  ''',
> -                 prefix=prefix))
> +                prefix=prefix))
>
> -fdecl.write(mcgen('''
> +genh.body(mcgen('''
>  #include "%(prefix)sqapi-types.h"
>  #include "qapi/qmp/qdict.h"
>  #include "qapi/qmp/dispatch.h"
>
>  void %(c_prefix)sqmp_init_marshal(QmpCommandList *cmds);
>  ''',
> -                  prefix=prefix, c_prefix=c_name(prefix, protect=False)))
> +                prefix=prefix, c_prefix=c_name(prefix, protect=False)))
>
>  schema = QAPISchema(input_file)
> -gen = QAPISchemaGenCommandVisitor()
> -schema.visit(gen)
> -fdef.write(gen.defn)
> -fdecl.write(gen.decl)
> +vis = QAPISchemaGenCommandVisitor()
> +schema.visit(vis)
> +genc.body(vis.defn)
> +genh.body(vis.decl)
>
> -close_output(fdef, fdecl)
> +if do_c:
> +    genc.write(output_dir, prefix + 'qmp-marshal.c')
> +if do_h:
> +    genh.write(output_dir, prefix + 'qmp-commands.h')
> diff --git a/scripts/qapi-event.py b/scripts/qapi-event.py
> index b1d611c5ea..da3de17c76 100644
> --- a/scripts/qapi-event.py
> +++ b/scripts/qapi-event.py
> @@ -176,11 +176,10 @@ blurb = '''
>   * Schema-defined QAPI/QMP events
>  '''
>
> -(fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix,
> -                            'qapi-event.c', 'qapi-event.h',
> -                            blurb, __doc__)
> +genc = QAPIGenC(blurb, __doc__)
> +genh = QAPIGenH(blurb, __doc__)
>
> -fdef.write(mcgen('''
> +genc.body(mcgen('''
>  #include "qemu/osdep.h"
>  #include "qemu-common.h"
>  #include "%(prefix)sqapi-event.h"
> @@ -190,22 +189,25 @@ fdef.write(mcgen('''
>  #include "qapi/qmp-event.h"
>
>  ''',
> -                 prefix=prefix))
> +                prefix=prefix))
>
> -fdecl.write(mcgen('''
> +genh.body(mcgen('''
>  #include "qapi/util.h"
>  #include "qapi/qmp/qdict.h"
>  #include "%(prefix)sqapi-types.h"
>
>  ''',
> -                  prefix=prefix))
> +                prefix=prefix))
>
>  event_enum_name = c_name(prefix + 'QAPIEvent', protect=False)
>
>  schema = QAPISchema(input_file)
> -gen = QAPISchemaGenEventVisitor()
> -schema.visit(gen)
> -fdef.write(gen.defn)
> -fdecl.write(gen.decl)
> +vis = QAPISchemaGenEventVisitor()
> +schema.visit(vis)
> +genc.body(vis.defn)
> +genh.body(vis.decl)
>
> -close_output(fdef, fdecl)
> +if do_c:
> +    genc.write(output_dir, prefix + 'qapi-event.c')
> +if do_h:
> +    genh.write(output_dir, prefix + 'qapi-event.h')
> diff --git a/scripts/qapi-introspect.py b/scripts/qapi-introspect.py
> index bd9253a172..c654f8fa94 100644
> --- a/scripts/qapi-introspect.py
> +++ b/scripts/qapi-introspect.py
> @@ -181,21 +181,23 @@ blurb = '''
>   * QAPI/QMP schema introspection
>  '''
>
> -(fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix,
> -                            'qmp-introspect.c', 'qmp-introspect.h',
> -                            blurb, __doc__)
> +genc = QAPIGenC(blurb, __doc__)
> +genh = QAPIGenH(blurb, __doc__)
>
> -fdef.write(mcgen('''
> +genc.body(mcgen('''
>  #include "qemu/osdep.h"
>  #include "%(prefix)sqmp-introspect.h"
>
>  ''',
> -                 prefix=prefix))
> +                prefix=prefix))
>
>  schema = QAPISchema(input_file)
> -gen = QAPISchemaGenIntrospectVisitor(opt_unmask)
> -schema.visit(gen)
> -fdef.write(gen.defn)
> -fdecl.write(gen.decl)
> +vis = QAPISchemaGenIntrospectVisitor(opt_unmask)
> +schema.visit(vis)
> +genc.body(vis.defn)
> +genh.body(vis.decl)
>
> -close_output(fdef, fdecl)
> +if do_c:
> +    genc.write(output_dir, prefix + 'qmp-introspect.c')
> +if do_h:
> +    genh.write(output_dir, prefix + 'qmp-introspect.h')
> diff --git a/scripts/qapi-types.py b/scripts/qapi-types.py
> index 1103dbda2d..97406b3368 100644
> --- a/scripts/qapi-types.py
> +++ b/scripts/qapi-types.py
> @@ -180,7 +180,7 @@ class QAPISchemaGenTypeVisitor(QAPISchemaVisitor):
>          self.decl = ''
>          self.defn = ''
>          self._fwdecl = ''
> -        self._btin = guardstart('QAPI_TYPES_BUILTIN')
> +        self._btin = '\n' + guardstart('QAPI_TYPES_BUILTIN')
>
>      def visit_end(self):
>          self.decl = self._fwdecl + self.decl
> @@ -256,26 +256,28 @@ blurb = '''
>   * Schema-defined QAPI types
>  '''
>
> -(fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix,
> -                            'qapi-types.c', 'qapi-types.h',
> -                            blurb, __doc__)
> +genc = QAPIGenC(blurb, __doc__)
> +genh = QAPIGenH(blurb, __doc__)
>
> -fdef.write(mcgen('''
> +genc.body(mcgen('''
>  #include "qemu/osdep.h"
>  #include "qapi/dealloc-visitor.h"
>  #include "%(prefix)sqapi-types.h"
>  #include "%(prefix)sqapi-visit.h"
>  ''',
> -                 prefix=prefix))
> +                prefix=prefix))
>
> -fdecl.write(mcgen('''
> +genh.body(mcgen('''
>  #include "qapi/util.h"
>  '''))
>
>  schema = QAPISchema(input_file)
> -gen = QAPISchemaGenTypeVisitor()
> -schema.visit(gen)
> -fdef.write(gen.defn)
> -fdecl.write(gen.decl)
> +vis = QAPISchemaGenTypeVisitor()
> +schema.visit(vis)
> +genc.body(vis.defn)
> +genh.body(vis.decl)
>
> -close_output(fdef, fdecl)
> +if do_c:
> +    genc.write(output_dir, prefix + 'qapi-types.c')
> +if do_h:
> +    genh.write(output_dir, prefix + 'qapi-types.h')
> diff --git a/scripts/qapi-visit.py b/scripts/qapi-visit.py
> index 5231f89c36..d1b25daf0d 100644
> --- a/scripts/qapi-visit.py
> +++ b/scripts/qapi-visit.py
> @@ -339,30 +339,32 @@ blurb = '''
>   * Schema-defined QAPI visitors
>  '''
>
> -(fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix,
> -                            'qapi-visit.c', 'qapi-visit.h',
> -                            blurb, __doc__)
> +genc = QAPIGenC(blurb, __doc__)
> +genh = QAPIGenH(blurb, __doc__)
>
> -fdef.write(mcgen('''
> +genc.body(mcgen('''
>  #include "qemu/osdep.h"
>  #include "qemu-common.h"
>  #include "qapi/error.h"
>  #include "%(prefix)sqapi-visit.h"
>  ''',
> -                 prefix=prefix))
> +                prefix=prefix))
>
> -fdecl.write(mcgen('''
> +genh.body(mcgen('''
>  #include "qapi/visitor.h"
>  #include "qapi/qmp/qerror.h"
>  #include "%(prefix)sqapi-types.h"
>
>  ''',
> -                  prefix=prefix))
> +                prefix=prefix))
>
>  schema = QAPISchema(input_file)
> -gen = QAPISchemaGenVisitVisitor()
> -schema.visit(gen)
> -fdef.write(gen.defn)
> -fdecl.write(gen.decl)
> +vis = QAPISchemaGenVisitVisitor()
> +schema.visit(vis)
> +genc.body(vis.defn)
> +genh.body(vis.decl)
>
> -close_output(fdef, fdecl)
> +if do_c:
> +    genc.write(output_dir, prefix + 'qapi-visit.c')
> +if do_h:
> +    genh.write(output_dir, prefix + 'qapi-visit.h')
> diff --git a/scripts/qapi.py b/scripts/qapi.py
> index d0816f7479..d73ef618e2 100644
> --- a/scripts/qapi.py
> +++ b/scripts/qapi.py
> @@ -2,7 +2,7 @@
>  # QAPI helper library
>  #
>  # Copyright IBM, Corp. 2011
> -# Copyright (c) 2013-2016 Red Hat Inc.
> +# Copyright (c) 2013-2018 Red Hat Inc.
>  #
>  # Authors:
>  #  Anthony Liguori <aliguori@us.ibm.com>
> @@ -1820,7 +1820,6 @@ def guardname(filename):
>
>  def guardstart(name):
>      return mcgen('''
> -
>  #ifndef %(name)s
>  #define %(name)s
>
> @@ -1832,7 +1831,6 @@ def guardend(name):
>      return mcgen('''
>
>  #endif /* %(name)s */
> -
>  ''',
>                   name=guardname(name))
>
> @@ -1970,17 +1968,53 @@ def parse_command_line(extra_options='', extra_long_options=[]):
>
>      return (fname, output_dir, do_c, do_h, prefix, extra_opts)
>
> +
>  #
> -# Generate output files with boilerplate
> +# Accumulate and write output
>  #
>
> +class QAPIGen(object):
> +
> +    def __init__(self):
> +        self._preamble = ''
> +        self._body = ''
> +
> +    def preamble(self, text):
> +        self._preamble += text
> +
> +    def body(self, text):
> +        self._body += text
> +
> +    def top(self, fname):
> +        return ''
> +
> +    def bottom(self, fname):
> +        return ''
> +

Some methods appends, other return. That's a bit confusing. Why not
name them accordingly? add_preamble, add_body, get_top...?

> +    def write(self, output_dir, fname):
> +        if output_dir:
> +            try:
> +                os.makedirs(output_dir)
> +            except os.error as e:
> +                if e.errno != errno.EEXIST:
> +                    raise
> +        f = open(os.path.join(output_dir, fname), 'w')
> +        f.write(self.top(fname) + self._preamble + self._body
> +                + self.bottom(fname))
> +        f.close()
> +
> +
> +class QAPIGenC(QAPIGen):
> +
> +    def __init__(self, blurb, pydoc):
> +        QAPIGen.__init__(self)
> +        self._blurb = blurb.strip('\n')
> +        self._copyright = '\n * '.join(re.findall(r'^Copyright .*', pydoc,
> +                                                  re.MULTILINE))
>
> -def open_output(output_dir, do_c, do_h, prefix, c_file, h_file, blurb, doc):
> -    guard = guardname(prefix + h_file)
> -    c_file = output_dir + prefix + c_file
> -    h_file = output_dir + prefix + h_file
> -    copyright = '\n * '.join(re.findall(r'^Copyright .*', doc, re.MULTILINE))
> -    comment = mcgen('''/* AUTOMATICALLY GENERATED, DO NOT MODIFY */
> +    def top(self, fname):
> +        return mcgen('''
> +/* AUTOMATICALLY GENERATED, DO NOT MODIFY */
>
>  /*
>  %(blurb)s
> @@ -1992,41 +2026,19 @@ def open_output(output_dir, do_c, do_h, prefix, c_file, h_file, blurb, doc):
>   */
>
>  ''',
> -                    blurb=blurb.strip('\n'), copyright=copyright)
> +                     blurb=self._blurb, copyright=self._copyright)
>
> -    if output_dir:
> -        try:
> -            os.makedirs(output_dir)
> -        except os.error as e:
> -            if e.errno != errno.EEXIST:
> -                raise
>
> -    def maybe_open(really, name, opt):
> -        if really:
> -            return open(name, opt)
> -        else:
> -            import StringIO
> -            return StringIO.StringIO()
> +class QAPIGenH(QAPIGenC):
>
> -    fdef = maybe_open(do_c, c_file, 'w')
> -    fdecl = maybe_open(do_h, h_file, 'w')
> +    def top(self, fname):
> +        return QAPIGenC.top(self, fname) + guardstart(fname)
>
> -    fdef.write(comment)
> -    fdecl.write(comment)
> -    fdecl.write(mcgen('''
> -#ifndef %(guard)s
> -#define %(guard)s
> +    def bottom(self, fname):
> +        return guardend(fname)
>
> -''',
> -                      guard=guard))
>
> -    return (fdef, fdecl)
> -
> -
> -def close_output(fdef, fdecl):
> -    fdecl.write(mcgen('''
> -
> -#endif
> -'''))
> -    fdecl.close()
> -    fdef.close()
> +class QAPIGenDoc(QAPIGen):
> +    def top(self, fname):
> +        return (QAPIGen.top(self, fname)
> +                + '@c AUTOMATICALLY GENERATED, DO NOT MODIFY\n\n')
> --
> 2.13.6
>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 04/21] qapi: Reduce use of global variables in generators some
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 04/21] qapi: Reduce use of global variables in generators some Markus Armbruster
  2018-02-02 16:03   ` Eric Blake
@ 2018-02-05 13:44   ` Marc-Andre Lureau
  1 sibling, 0 replies; 87+ messages in thread
From: Marc-Andre Lureau @ 2018-02-05 13:44 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: qemu-devel, marcandre, Blake, Eric, mdroth

On Fri, Feb 2, 2018 at 2:03 PM, Markus Armbruster <armbru@redhat.com> wrote:
> In preparation of the next commit, which will turn the generators into
> modules.  These global variables will become local to main() then.
>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>


> ---
>  scripts/qapi-commands.py   |  9 +++++----
>  scripts/qapi-event.py      | 15 +++++++--------
>  scripts/qapi-introspect.py |  7 ++++---
>  scripts/qapi-types.py      | 17 +++++++++--------
>  scripts/qapi-visit.py      | 17 +++++++++--------
>  5 files changed, 34 insertions(+), 31 deletions(-)
>
> diff --git a/scripts/qapi-commands.py b/scripts/qapi-commands.py
> index 4be7dbc482..d229537659 100644
> --- a/scripts/qapi-commands.py
> +++ b/scripts/qapi-commands.py
> @@ -207,7 +207,7 @@ def gen_register_command(name, success_response):
>      return ret
>
>
> -def gen_registry(registry):
> +def gen_registry(registry, prefix):
>      ret = mcgen('''
>
>  void %(c_prefix)sqmp_init_marshal(QmpCommandList *cmds)
> @@ -224,7 +224,8 @@ void %(c_prefix)sqmp_init_marshal(QmpCommandList *cmds)
>
>
>  class QAPISchemaGenCommandVisitor(QAPISchemaVisitor):
> -    def __init__(self):
> +    def __init__(self, prefix):
> +        self._prefix = prefix
>          self.decl = None
>          self.defn = None
>          self._regy = None
> @@ -237,7 +238,7 @@ class QAPISchemaGenCommandVisitor(QAPISchemaVisitor):
>          self._visited_ret_types = set()
>
>      def visit_end(self):
> -        self.defn += gen_registry(self._regy)
> +        self.defn += gen_registry(self._regy, self._prefix)
>          self._regy = None
>          self._visited_ret_types = None
>
> @@ -289,7 +290,7 @@ void %(c_prefix)sqmp_init_marshal(QmpCommandList *cmds);
>                  prefix=prefix, c_prefix=c_name(prefix, protect=False)))
>
>  schema = QAPISchema(input_file)
> -vis = QAPISchemaGenCommandVisitor()
> +vis = QAPISchemaGenCommandVisitor(prefix)
>  schema.visit(vis)
>  genc.body(vis.defn)
>  genh.body(vis.decl)
> diff --git a/scripts/qapi-event.py b/scripts/qapi-event.py
> index da3de17c76..1af21b580a 100644
> --- a/scripts/qapi-event.py
> +++ b/scripts/qapi-event.py
> @@ -58,7 +58,7 @@ def gen_param_var(typ):
>      return ret
>
>
> -def gen_event_send(name, arg_type, boxed):
> +def gen_event_send(name, arg_type, boxed, event_enum_name):
>      # FIXME: Our declaration of local variables (and of 'errp' in the
>      # parameter list) can collide with exploded members of the event's
>      # data type passed in as parameters.  If this collision ever hits in
> @@ -149,7 +149,8 @@ out:
>
>
>  class QAPISchemaGenEventVisitor(QAPISchemaVisitor):
> -    def __init__(self):
> +    def __init__(self, prefix):
> +        self._enum_name = c_name(prefix + 'QAPIEvent', protect=False)
>          self.decl = None
>          self.defn = None
>          self._event_names = None
> @@ -160,13 +161,13 @@ class QAPISchemaGenEventVisitor(QAPISchemaVisitor):
>          self._event_names = []
>
>      def visit_end(self):
> -        self.decl += gen_enum(event_enum_name, self._event_names)
> -        self.defn += gen_enum_lookup(event_enum_name, self._event_names)
> +        self.decl += gen_enum(self._enum_name, self._event_names)
> +        self.defn += gen_enum_lookup(self._enum_name, self._event_names)
>          self._event_names = None
>
>      def visit_event(self, name, info, arg_type, boxed):
>          self.decl += gen_event_send_decl(name, arg_type, boxed)
> -        self.defn += gen_event_send(name, arg_type, boxed)
> +        self.defn += gen_event_send(name, arg_type, boxed, self._enum_name)
>          self._event_names.append(name)
>
>
> @@ -199,10 +200,8 @@ genh.body(mcgen('''
>  ''',
>                  prefix=prefix))
>
> -event_enum_name = c_name(prefix + 'QAPIEvent', protect=False)
> -
>  schema = QAPISchema(input_file)
> -vis = QAPISchemaGenEventVisitor()
> +vis = QAPISchemaGenEventVisitor(prefix)
>  schema.visit(vis)
>  genc.body(vis.defn)
>  genh.body(vis.decl)
> diff --git a/scripts/qapi-introspect.py b/scripts/qapi-introspect.py
> index c654f8fa94..8d4e3c1c3a 100644
> --- a/scripts/qapi-introspect.py
> +++ b/scripts/qapi-introspect.py
> @@ -41,7 +41,8 @@ def to_c_string(string):
>
>
>  class QAPISchemaGenIntrospectVisitor(QAPISchemaVisitor):
> -    def __init__(self, unmask):
> +    def __init__(self, prefix, unmask):
> +        self._prefix = prefix
>          self._unmask = unmask
>          self.defn = None
>          self.decl = None
> @@ -65,7 +66,7 @@ class QAPISchemaGenIntrospectVisitor(QAPISchemaVisitor):
>          # generate C
>          # TODO can generate awfully long lines
>          jsons.extend(self._jsons)
> -        name = c_name(prefix, protect=False) + 'qmp_schema_json'
> +        name = c_name(self._prefix, protect=False) + 'qmp_schema_json'
>          self.decl = mcgen('''
>  extern const char %(c_name)s[];
>  ''',
> @@ -192,7 +193,7 @@ genc.body(mcgen('''
>                  prefix=prefix))
>
>  schema = QAPISchema(input_file)
> -vis = QAPISchemaGenIntrospectVisitor(opt_unmask)
> +vis = QAPISchemaGenIntrospectVisitor(prefix, opt_unmask)
>  schema.visit(vis)
>  genc.body(vis.defn)
>  genh.body(vis.decl)
> diff --git a/scripts/qapi-types.py b/scripts/qapi-types.py
> index 97406b3368..2d711b137b 100644
> --- a/scripts/qapi-types.py
> +++ b/scripts/qapi-types.py
> @@ -168,7 +168,8 @@ void qapi_free_%(c_name)s(%(c_name)s *obj)
>
>
>  class QAPISchemaGenTypeVisitor(QAPISchemaVisitor):
> -    def __init__(self):
> +    def __init__(self, opt_builtins):
> +        self._opt_builtins = opt_builtins
>          self.decl = None
>          self.defn = None
>          self._fwdecl = None
> @@ -187,7 +188,7 @@ class QAPISchemaGenTypeVisitor(QAPISchemaVisitor):
>          self._fwdecl = None
>          # To avoid header dependency hell, we always generate
>          # declarations for built-in types in our header files and
> -        # simply guard them.  See also do_builtins (command line
> +        # simply guard them.  See also opt_builtins (command line
>          # option -b).
>          self._btin += guardend('QAPI_TYPES_BUILTIN')
>          self.decl = self._btin + self.decl
> @@ -202,7 +203,7 @@ class QAPISchemaGenTypeVisitor(QAPISchemaVisitor):
>          # TODO use something cleaner than existence of info
>          if not info:
>              self._btin += gen_enum(name, values, prefix)
> -            if do_builtins:
> +            if self._opt_builtins:
>                  self.defn += gen_enum_lookup(name, values, prefix)
>          else:
>              self._fwdecl += gen_enum(name, values, prefix)
> @@ -213,7 +214,7 @@ class QAPISchemaGenTypeVisitor(QAPISchemaVisitor):
>              self._btin += gen_fwd_object_or_array(name)
>              self._btin += gen_array(name, element_type)
>              self._btin += gen_type_cleanup_decl(name)
> -            if do_builtins:
> +            if self._opt_builtins:
>                  self.defn += gen_type_cleanup(name)
>          else:
>              self._fwdecl += gen_fwd_object_or_array(name)
> @@ -241,16 +242,16 @@ class QAPISchemaGenTypeVisitor(QAPISchemaVisitor):
>
>  # If you link code generated from multiple schemata, you want only one
>  # instance of the code for built-in types.  Generate it only when
> -# do_builtins, enabled by command line option -b.  See also
> +# opt_builtins, enabled by command line option -b.  See also
>  # QAPISchemaGenTypeVisitor.visit_end().
> -do_builtins = False
> +opt_builtins = False
>
>  (input_file, output_dir, do_c, do_h, prefix, opts) = \
>      parse_command_line('b', ['builtins'])
>
>  for o, a in opts:
>      if o in ('-b', '--builtins'):
> -        do_builtins = True
> +        opt_builtins = True
>
>  blurb = '''
>   * Schema-defined QAPI types
> @@ -272,7 +273,7 @@ genh.body(mcgen('''
>  '''))
>
>  schema = QAPISchema(input_file)
> -vis = QAPISchemaGenTypeVisitor()
> +vis = QAPISchemaGenTypeVisitor(opt_builtins)
>  schema.visit(vis)
>  genc.body(vis.defn)
>  genh.body(vis.decl)
> diff --git a/scripts/qapi-visit.py b/scripts/qapi-visit.py
> index d1b25daf0d..79dc6cae48 100644
> --- a/scripts/qapi-visit.py
> +++ b/scripts/qapi-visit.py
> @@ -264,7 +264,8 @@ out:
>
>
>  class QAPISchemaGenVisitVisitor(QAPISchemaVisitor):
> -    def __init__(self):
> +    def __init__(self, opt_builtins):
> +        self._opt_builtins = opt_builtins
>          self.decl = None
>          self.defn = None
>          self._btin = None
> @@ -277,7 +278,7 @@ class QAPISchemaGenVisitVisitor(QAPISchemaVisitor):
>      def visit_end(self):
>          # To avoid header dependency hell, we always generate
>          # declarations for built-in types in our header files and
> -        # simply guard them.  See also do_builtins (command line
> +        # simply guard them.  See also opt_builtins (command line
>          # option -b).
>          self._btin += guardend('QAPI_VISIT_BUILTIN')
>          self.decl = self._btin + self.decl
> @@ -288,7 +289,7 @@ class QAPISchemaGenVisitVisitor(QAPISchemaVisitor):
>          # TODO use something cleaner than existence of info
>          if not info:
>              self._btin += gen_visit_decl(name, scalar=True)
> -            if do_builtins:
> +            if self._opt_builtins:
>                  self.defn += gen_visit_enum(name)
>          else:
>              self.decl += gen_visit_decl(name, scalar=True)
> @@ -299,7 +300,7 @@ class QAPISchemaGenVisitVisitor(QAPISchemaVisitor):
>          defn = gen_visit_list(name, element_type)
>          if isinstance(element_type, QAPISchemaBuiltinType):
>              self._btin += decl
> -            if do_builtins:
> +            if self._opt_builtins:
>                  self.defn += defn
>          else:
>              self.decl += decl
> @@ -324,16 +325,16 @@ class QAPISchemaGenVisitVisitor(QAPISchemaVisitor):
>
>  # If you link code generated from multiple schemata, you want only one
>  # instance of the code for built-in types.  Generate it only when
> -# do_builtins, enabled by command line option -b.  See also
> +# opt_builtins, enabled by command line option -b.  See also
>  # QAPISchemaGenVisitVisitor.visit_end().
> -do_builtins = False
> +opt_builtins = False
>
>  (input_file, output_dir, do_c, do_h, prefix, opts) = \
>      parse_command_line('b', ['builtins'])
>
>  for o, a in opts:
>      if o in ('-b', '--builtins'):
> -        do_builtins = True
> +        opt_builtins = True
>
>  blurb = '''
>   * Schema-defined QAPI visitors
> @@ -359,7 +360,7 @@ genh.body(mcgen('''
>                  prefix=prefix))
>
>  schema = QAPISchema(input_file)
> -vis = QAPISchemaGenVisitVisitor()
> +vis = QAPISchemaGenVisitVisitor(opt_builtins)
>  schema.visit(vis)
>  genc.body(vis.defn)
>  genh.body(vis.decl)
> --
> 2.13.6
>

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 05/21] qapi: Turn generators into modules
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 05/21] qapi: Turn generators into modules Markus Armbruster
  2018-02-02 16:47   ` Eric Blake
@ 2018-02-05 13:44   ` Marc-Andre Lureau
  1 sibling, 0 replies; 87+ messages in thread
From: Marc-Andre Lureau @ 2018-02-05 13:44 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: qemu-devel, marcandre, Blake, Eric, mdroth

On Fri, Feb 2, 2018 at 2:03 PM, Markus Armbruster <armbru@redhat.com> wrote:
> The next commit will introduce a common driver program for all
> generators.  The generators need to be modules for that.  qapi2texi.py
> already is.  Make the other generators follow suit.
>
> The changes are actually trivial.  Obvious in the diffs once you view
> them with whitespace changes ignored.
>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>


> ---
>  scripts/qapi-commands.py   | 43 ++++++++++++++++++--------------
>  scripts/qapi-event.py      | 43 ++++++++++++++++++--------------
>  scripts/qapi-introspect.py | 54 ++++++++++++++++++++++------------------
>  scripts/qapi-types.py      | 56 ++++++++++++++++++++++-------------------
>  scripts/qapi-visit.py      | 62 +++++++++++++++++++++++++---------------------
>  5 files changed, 143 insertions(+), 115 deletions(-)
>
> diff --git a/scripts/qapi-commands.py b/scripts/qapi-commands.py
> index d229537659..331b58670e 100644
> --- a/scripts/qapi-commands.py
> +++ b/scripts/qapi-commands.py
> @@ -255,16 +255,17 @@ class QAPISchemaGenCommandVisitor(QAPISchemaVisitor):
>          self._regy += gen_register_command(name, success_response)
>
>
> -(input_file, output_dir, do_c, do_h, prefix, opts) = parse_command_line()
> +def main(argv):
> +    (input_file, output_dir, do_c, do_h, prefix, opts) = parse_command_line()
>
> -blurb = '''
> +    blurb = '''
>   * Schema-defined QAPI/QMP commands
>  '''
>
> -genc = QAPIGenC(blurb, __doc__)
> -genh = QAPIGenH(blurb, __doc__)
> +    genc = QAPIGenC(blurb, __doc__)
> +    genh = QAPIGenH(blurb, __doc__)
>
> -genc.body(mcgen('''
> +    genc.body(mcgen('''
>  #include "qemu/osdep.h"
>  #include "qemu-common.h"
>  #include "qemu/module.h"
> @@ -278,24 +279,28 @@ genc.body(mcgen('''
>  #include "%(prefix)sqmp-commands.h"
>
>  ''',
> -                prefix=prefix))
> +                    prefix=prefix))
>
> -genh.body(mcgen('''
> +    genh.body(mcgen('''
>  #include "%(prefix)sqapi-types.h"
>  #include "qapi/qmp/qdict.h"
>  #include "qapi/qmp/dispatch.h"
>
>  void %(c_prefix)sqmp_init_marshal(QmpCommandList *cmds);
>  ''',
> -                prefix=prefix, c_prefix=c_name(prefix, protect=False)))
> -
> -schema = QAPISchema(input_file)
> -vis = QAPISchemaGenCommandVisitor(prefix)
> -schema.visit(vis)
> -genc.body(vis.defn)
> -genh.body(vis.decl)
> -
> -if do_c:
> -    genc.write(output_dir, prefix + 'qmp-marshal.c')
> -if do_h:
> -    genh.write(output_dir, prefix + 'qmp-commands.h')
> +                    prefix=prefix, c_prefix=c_name(prefix, protect=False)))
> +
> +    schema = QAPISchema(input_file)
> +    vis = QAPISchemaGenCommandVisitor(prefix)
> +    schema.visit(vis)
> +    genc.body(vis.defn)
> +    genh.body(vis.decl)
> +
> +    if do_c:
> +        genc.write(output_dir, prefix + 'qmp-marshal.c')
> +    if do_h:
> +        genh.write(output_dir, prefix + 'qmp-commands.h')
> +
> +
> +if __name__ == '__main__':
> +    main(sys.argv)
> diff --git a/scripts/qapi-event.py b/scripts/qapi-event.py
> index 1af21b580a..5b33c694d4 100644
> --- a/scripts/qapi-event.py
> +++ b/scripts/qapi-event.py
> @@ -171,16 +171,17 @@ class QAPISchemaGenEventVisitor(QAPISchemaVisitor):
>          self._event_names.append(name)
>
>
> -(input_file, output_dir, do_c, do_h, prefix, dummy) = parse_command_line()
> +def main(argv):
> +    (input_file, output_dir, do_c, do_h, prefix, dummy) = parse_command_line()
>
> -blurb = '''
> +    blurb = '''
>   * Schema-defined QAPI/QMP events
>  '''
>
> -genc = QAPIGenC(blurb, __doc__)
> -genh = QAPIGenH(blurb, __doc__)
> +    genc = QAPIGenC(blurb, __doc__)
> +    genh = QAPIGenH(blurb, __doc__)
>
> -genc.body(mcgen('''
> +    genc.body(mcgen('''
>  #include "qemu/osdep.h"
>  #include "qemu-common.h"
>  #include "%(prefix)sqapi-event.h"
> @@ -190,23 +191,27 @@ genc.body(mcgen('''
>  #include "qapi/qmp-event.h"
>
>  ''',
> -                prefix=prefix))
> +                    prefix=prefix))
>
> -genh.body(mcgen('''
> +    genh.body(mcgen('''
>  #include "qapi/util.h"
>  #include "qapi/qmp/qdict.h"
>  #include "%(prefix)sqapi-types.h"
>
>  ''',
> -                prefix=prefix))
> -
> -schema = QAPISchema(input_file)
> -vis = QAPISchemaGenEventVisitor(prefix)
> -schema.visit(vis)
> -genc.body(vis.defn)
> -genh.body(vis.decl)
> -
> -if do_c:
> -    genc.write(output_dir, prefix + 'qapi-event.c')
> -if do_h:
> -    genh.write(output_dir, prefix + 'qapi-event.h')
> +                    prefix=prefix))
> +
> +    schema = QAPISchema(input_file)
> +    vis = QAPISchemaGenEventVisitor(prefix)
> +    schema.visit(vis)
> +    genc.body(vis.defn)
> +    genh.body(vis.decl)
> +
> +    if do_c:
> +        genc.write(output_dir, prefix + 'qapi-event.c')
> +    if do_h:
> +        genh.write(output_dir, prefix + 'qapi-event.h')
> +
> +
> +if __name__ == '__main__':
> +    main(sys.argv)
> diff --git a/scripts/qapi-introspect.py b/scripts/qapi-introspect.py
> index 8d4e3c1c3a..09e7d1f140 100644
> --- a/scripts/qapi-introspect.py
> +++ b/scripts/qapi-introspect.py
> @@ -167,38 +167,44 @@ const char %(c_name)s[] = %(c_string)s;
>          arg_type = arg_type or self._schema.the_empty_object_type
>          self._gen_json(name, 'event', {'arg-type': self._use_type(arg_type)})
>
> -# Debugging aid: unmask QAPI schema's type names
> -# We normally mask them, because they're not QMP wire ABI
> -opt_unmask = False
>
> -(input_file, output_dir, do_c, do_h, prefix, opts) = \
> -    parse_command_line('u', ['unmask-non-abi-names'])
> +def main(argv):
> +    # Debugging aid: unmask QAPI schema's type names
> +    # We normally mask them, because they're not QMP wire ABI
> +    opt_unmask = False
>
> -for o, a in opts:
> -    if o in ('-u', '--unmask-non-abi-names'):
> -        opt_unmask = True
> +    (input_file, output_dir, do_c, do_h, prefix, opts) = \
> +        parse_command_line('u', ['unmask-non-abi-names'])
>
> -blurb = '''
> +    for o, a in opts:
> +        if o in ('-u', '--unmask-non-abi-names'):
> +            opt_unmask = True
> +
> +    blurb = '''
>   * QAPI/QMP schema introspection
>  '''
>
> -genc = QAPIGenC(blurb, __doc__)
> -genh = QAPIGenH(blurb, __doc__)
> +    genc = QAPIGenC(blurb, __doc__)
> +    genh = QAPIGenH(blurb, __doc__)
>
> -genc.body(mcgen('''
> +    genc.body(mcgen('''
>  #include "qemu/osdep.h"
>  #include "%(prefix)sqmp-introspect.h"
>
>  ''',
> -                prefix=prefix))
> -
> -schema = QAPISchema(input_file)
> -vis = QAPISchemaGenIntrospectVisitor(prefix, opt_unmask)
> -schema.visit(vis)
> -genc.body(vis.defn)
> -genh.body(vis.decl)
> -
> -if do_c:
> -    genc.write(output_dir, prefix + 'qmp-introspect.c')
> -if do_h:
> -    genh.write(output_dir, prefix + 'qmp-introspect.h')
> +                    prefix=prefix))
> +
> +    schema = QAPISchema(input_file)
> +    vis = QAPISchemaGenIntrospectVisitor(prefix, opt_unmask)
> +    schema.visit(vis)
> +    genc.body(vis.defn)
> +    genh.body(vis.decl)
> +
> +    if do_c:
> +        genc.write(output_dir, prefix + 'qmp-introspect.c')
> +    if do_h:
> +        genh.write(output_dir, prefix + 'qmp-introspect.h')
> +
> +
> +if __name__ == '__main__':
> +    main(sys.argv)
> diff --git a/scripts/qapi-types.py b/scripts/qapi-types.py
> index 2d711b137b..f2ddde94b1 100644
> --- a/scripts/qapi-types.py
> +++ b/scripts/qapi-types.py
> @@ -240,45 +240,51 @@ class QAPISchemaGenTypeVisitor(QAPISchemaVisitor):
>          self.decl += gen_object(name, None, [variants.tag_member], variants)
>          self._gen_type_cleanup(name)
>
> -# If you link code generated from multiple schemata, you want only one
> -# instance of the code for built-in types.  Generate it only when
> -# opt_builtins, enabled by command line option -b.  See also
> -# QAPISchemaGenTypeVisitor.visit_end().
> -opt_builtins = False
>
> -(input_file, output_dir, do_c, do_h, prefix, opts) = \
> -    parse_command_line('b', ['builtins'])
> +def main(argv):
> +    # If you link code generated from multiple schemata, you want only one
> +    # instance of the code for built-in types.  Generate it only when
> +    # opt_builtins, enabled by command line option -b.  See also
> +    # QAPISchemaGenTypeVisitor.visit_end().
> +    opt_builtins = False
>
> -for o, a in opts:
> -    if o in ('-b', '--builtins'):
> -        opt_builtins = True
> +    (input_file, output_dir, do_c, do_h, prefix, opts) = \
> +        parse_command_line('b', ['builtins'])
>
> -blurb = '''
> +    for o, a in opts:
> +        if o in ('-b', '--builtins'):
> +            opt_builtins = True
> +
> +    blurb = '''
>   * Schema-defined QAPI types
>  '''
>
> -genc = QAPIGenC(blurb, __doc__)
> -genh = QAPIGenH(blurb, __doc__)
> +    genc = QAPIGenC(blurb, __doc__)
> +    genh = QAPIGenH(blurb, __doc__)
>
> -genc.body(mcgen('''
> +    genc.body(mcgen('''
>  #include "qemu/osdep.h"
>  #include "qapi/dealloc-visitor.h"
>  #include "%(prefix)sqapi-types.h"
>  #include "%(prefix)sqapi-visit.h"
>  ''',
> -                prefix=prefix))
> +                    prefix=prefix))
>
> -genh.body(mcgen('''
> +    genh.body(mcgen('''
>  #include "qapi/util.h"
>  '''))
>
> -schema = QAPISchema(input_file)
> -vis = QAPISchemaGenTypeVisitor(opt_builtins)
> -schema.visit(vis)
> -genc.body(vis.defn)
> -genh.body(vis.decl)
> +    schema = QAPISchema(input_file)
> +    vis = QAPISchemaGenTypeVisitor(opt_builtins)
> +    schema.visit(vis)
> +    genc.body(vis.defn)
> +    genh.body(vis.decl)
>
> -if do_c:
> -    genc.write(output_dir, prefix + 'qapi-types.c')
> -if do_h:
> -    genh.write(output_dir, prefix + 'qapi-types.h')
> +    if do_c:
> +        genc.write(output_dir, prefix + 'qapi-types.c')
> +    if do_h:
> +        genh.write(output_dir, prefix + 'qapi-types.h')
> +
> +
> +if __name__ == '__main__':
> +    main(sys.argv)
> diff --git a/scripts/qapi-visit.py b/scripts/qapi-visit.py
> index 79dc6cae48..473fa72574 100644
> --- a/scripts/qapi-visit.py
> +++ b/scripts/qapi-visit.py
> @@ -323,49 +323,55 @@ class QAPISchemaGenVisitVisitor(QAPISchemaVisitor):
>          self.decl += gen_visit_decl(name)
>          self.defn += gen_visit_alternate(name, variants)
>
> -# If you link code generated from multiple schemata, you want only one
> -# instance of the code for built-in types.  Generate it only when
> -# opt_builtins, enabled by command line option -b.  See also
> -# QAPISchemaGenVisitVisitor.visit_end().
> -opt_builtins = False
>
> -(input_file, output_dir, do_c, do_h, prefix, opts) = \
> -    parse_command_line('b', ['builtins'])
> +def main(argv):
> +    # If you link code generated from multiple schemata, you want only one
> +    # instance of the code for built-in types.  Generate it only when
> +    # opt_builtins, enabled by command line option -b.  See also
> +    # QAPISchemaGenVisitVisitor.visit_end().
> +    opt_builtins = False
>
> -for o, a in opts:
> -    if o in ('-b', '--builtins'):
> -        opt_builtins = True
> +    (input_file, output_dir, do_c, do_h, prefix, opts) = \
> +        parse_command_line('b', ['builtins'])
>
> -blurb = '''
> +    for o, a in opts:
> +        if o in ('-b', '--builtins'):
> +            opt_builtins = True
> +
> +    blurb = '''
>   * Schema-defined QAPI visitors
>  '''
>
> -genc = QAPIGenC(blurb, __doc__)
> -genh = QAPIGenH(blurb, __doc__)
> +    genc = QAPIGenC(blurb, __doc__)
> +    genh = QAPIGenH(blurb, __doc__)
>
> -genc.body(mcgen('''
> +    genc.body(mcgen('''
>  #include "qemu/osdep.h"
>  #include "qemu-common.h"
>  #include "qapi/error.h"
>  #include "%(prefix)sqapi-visit.h"
>  ''',
> -                prefix=prefix))
> +                    prefix=prefix))
>
> -genh.body(mcgen('''
> +    genh.body(mcgen('''
>  #include "qapi/visitor.h"
>  #include "qapi/qmp/qerror.h"
>  #include "%(prefix)sqapi-types.h"
>
>  ''',
> -                prefix=prefix))
> -
> -schema = QAPISchema(input_file)
> -vis = QAPISchemaGenVisitVisitor(opt_builtins)
> -schema.visit(vis)
> -genc.body(vis.defn)
> -genh.body(vis.decl)
> -
> -if do_c:
> -    genc.write(output_dir, prefix + 'qapi-visit.c')
> -if do_h:
> -    genh.write(output_dir, prefix + 'qapi-visit.h')
> +                    prefix=prefix))
> +
> +    schema = QAPISchema(input_file)
> +    vis = QAPISchemaGenVisitVisitor(opt_builtins)
> +    schema.visit(vis)
> +    genc.body(vis.defn)
> +    genh.body(vis.decl)
> +
> +    if do_c:
> +        genc.write(output_dir, prefix + 'qapi-visit.c')
> +    if do_h:
> +        genh.write(output_dir, prefix + 'qapi-visit.h')
> +
> +
> +if __name__ == '__main__':
> +    main(sys.argv)
> --
> 2.13.6
>

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 06/21] qapi-gen: New common driver for code and doc generators
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 06/21] qapi-gen: New common driver for code and doc generators Markus Armbruster
  2018-02-02 19:27   ` Eric Blake
@ 2018-02-05 13:44   ` Marc-Andre Lureau
  2018-02-05 15:36     ` Markus Armbruster
  1 sibling, 1 reply; 87+ messages in thread
From: Marc-Andre Lureau @ 2018-02-05 13:44 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: qemu-devel, marcandre, Blake, Eric, mdroth

On Fri, Feb 2, 2018 at 2:03 PM, Markus Armbruster <armbru@redhat.com> wrote:
> Whenever qapi-schema.json changes, we run six programs eleven times to
> update eleven files.  This is silly.  Replace the six programs by a
> single program that spits out all eleven files.
>

Now we will need documentation update.

Also greping for the renamed files:

git grep -E 'qapi-commands|qapi2texi|qapi-event.py|qapi-intros|qapi-types.py|qapi-visit.py'
docs/devel/qapi-code-gen.txt:=== scripts/qapi-types.py ===
docs/devel/qapi-code-gen.txt:    $ python scripts/qapi-types.py
--output-dir="qapi-generated" \
docs/devel/qapi-code-gen.txt:=== scripts/qapi-visit.py ===
docs/devel/qapi-code-gen.txt:    $ python scripts/qapi-visit.py
--output-dir="qapi-generated"
docs/devel/qapi-code-gen.txt:=== scripts/qapi-commands.py ===
docs/devel/qapi-code-gen.txt:                        generated by
qapi-visit.py are used to
docs/devel/qapi-code-gen.txt:    $ python scripts/qapi-commands.py
--output-dir="qapi-generated"
docs/devel/qapi-code-gen.txt:=== scripts/qapi-event.py ===
docs/devel/qapi-code-gen.txt:    $ python scripts/qapi-event.py
--output-dir="qapi-generated"
docs/devel/qapi-code-gen.txt:=== scripts/qapi-introspect.py ===
docs/devel/qapi-code-gen.txt:    $ python scripts/qapi-introspect.py
--output-dir="qapi-generated"
monitor.c: * qapi-introspect.py's output actually conforms to the schema.
qapi-schema.json:# Documentation generated with qapi2texi.py is in
source order, with

> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  Makefile                                           | 86 ++++++++++------------
>  scripts/qapi-gen.py                                | 41 +++++++++++
>  scripts/qapi/__init__.py                           |  0
>  scripts/{qapi-commands.py => qapi/commands.py}     | 23 ++----
>  scripts/{qapi.py => qapi/common.py}                |  0
>  scripts/{qapi2texi.py => qapi/doc.py}              | 29 ++------
>  scripts/{qapi-event.py => qapi/events.py}          | 23 ++----
>  scripts/{qapi-introspect.py => qapi/introspect.py} | 32 ++------
>  scripts/{qapi-types.py => qapi/types.py}           | 34 ++-------
>  scripts/{qapi-visit.py => qapi/visit.py}           | 34 ++-------
>  tests/Makefile.include                             | 56 +++++++-------
>  tests/qapi-schema/test-qapi.py                     |  2 +-
>  12 files changed, 140 insertions(+), 220 deletions(-)
>  create mode 100755 scripts/qapi-gen.py
>  create mode 100644 scripts/qapi/__init__.py
>  rename scripts/{qapi-commands.py => qapi/commands.py} (94%)
>  rename scripts/{qapi.py => qapi/common.py} (100%)
>  rename scripts/{qapi2texi.py => qapi/doc.py} (92%)
>  mode change 100755 => 100644
>  rename scripts/{qapi-event.py => qapi/events.py} (92%)
>  rename scripts/{qapi-introspect.py => qapi/introspect.py} (90%)
>  rename scripts/{qapi-types.py => qapi/types.py} (90%)
>  rename scripts/{qapi-visit.py => qapi/visit.py} (92%)
>
> diff --git a/Makefile b/Makefile
> index af31e8981f..e02f0c13ef 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -92,6 +92,7 @@ GENERATED_FILES += qmp-commands.h qapi-types.h qapi-visit.h qapi-event.h
>  GENERATED_FILES += qmp-marshal.c qapi-types.c qapi-visit.c qapi-event.c
>  GENERATED_FILES += qmp-introspect.h
>  GENERATED_FILES += qmp-introspect.c
> +GENERATED_FILES += qapi.texi
>
>  GENERATED_FILES += trace/generated-tcg-tracers.h
>
> @@ -477,25 +478,26 @@ qemu-ga$(EXESUF): QEMU_CFLAGS += -I qga/qapi-generated
>  qemu-keymap$(EXESUF): LIBS += $(XKBCOMMON_LIBS)
>  qemu-keymap$(EXESUF): QEMU_CFLAGS += $(XKBCOMMON_CFLAGS)
>
> -gen-out-type = $(subst .,-,$(suffix $@))
> +qapi-py = $(SRC_PATH)/scripts/qapi/commands.py \
> +$(SRC_PATH)/scripts/qapi/events.py \
> +$(SRC_PATH)/scripts/qapi/introspect.py \
> +$(SRC_PATH)/scripts/qapi/types.py \
> +$(SRC_PATH)/scripts/qapi/visit.py \
> +$(SRC_PATH)/scripts/qapi/common.py \
> +$(SRC_PATH)/scripts/qapi/doc.py \
> +$(SRC_PATH)/scripts/ordereddict.py \
> +$(SRC_PATH)/scripts/qapi-gen.py
>
> -qapi-py = $(SRC_PATH)/scripts/qapi.py $(SRC_PATH)/scripts/ordereddict.py
> -
> -qga/qapi-generated/qga-qapi-types.c qga/qapi-generated/qga-qapi-types.h :\
> -$(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-types.py $(qapi-py)
> -       $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py \
> -               $(gen-out-type) -o qga/qapi-generated -p "qga-" $<, \
> -               "GEN","$@")
> -qga/qapi-generated/qga-qapi-visit.c qga/qapi-generated/qga-qapi-visit.h :\
> -$(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py)
> -       $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py \
> -               $(gen-out-type) -o qga/qapi-generated -p "qga-" $<, \
> -               "GEN","$@")
> -qga/qapi-generated/qga-qmp-commands.h qga/qapi-generated/qga-qmp-marshal.c :\
> -$(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py)
> -       $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py \
> -               $(gen-out-type) -o qga/qapi-generated -p "qga-" $<, \
> -               "GEN","$@")
> +qga/qapi-generated/qga-qapi-types.c qga/qapi-generated/qga-qapi-types.h \
> +qga/qapi-generated/qga-qapi-visit.c qga/qapi-generated/qga-qapi-visit.h \
> +qga/qapi-generated/qga-qmp-commands.h qga/qapi-generated/qga-qmp-marshal.c \
> +qga/qapi-generated/qga-qapi.texi: \
> +qga/qapi-generated/qapi-gen-timestamp ;
> +qga/qapi-generated/qapi-gen-timestamp: $(SRC_PATH)/qga/qapi-schema.json $(qapi-py)
> +       $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-gen.py \
> +               -o qga/qapi-generated -p "qga-" $<, \
> +               "GEN","$(@:%-timestamp=%)")
> +       @>$@
>
>  qapi-modules = $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/qapi/common.json \
>                 $(SRC_PATH)/qapi/block.json $(SRC_PATH)/qapi/block-core.json \
> @@ -512,31 +514,18 @@ qapi-modules = $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/qapi/common.json \
>                 $(SRC_PATH)/qapi/transaction.json \
>                 $(SRC_PATH)/qapi/ui.json
>
> -qapi-types.c qapi-types.h :\
> -$(qapi-modules) $(SRC_PATH)/scripts/qapi-types.py $(qapi-py)
> -       $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py \
> -               $(gen-out-type) -o "." -b $<, \
> -               "GEN","$@")
> -qapi-visit.c qapi-visit.h :\
> -$(qapi-modules) $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py)
> -       $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py \
> -               $(gen-out-type) -o "." -b $<, \
> -               "GEN","$@")
> -qapi-event.c qapi-event.h :\
> -$(qapi-modules) $(SRC_PATH)/scripts/qapi-event.py $(qapi-py)
> -       $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-event.py \
> -               $(gen-out-type) -o "." $<, \
> -               "GEN","$@")
> -qmp-commands.h qmp-marshal.c :\
> -$(qapi-modules) $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py)
> -       $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py \
> -               $(gen-out-type) -o "." $<, \
> -               "GEN","$@")
> -qmp-introspect.h qmp-introspect.c :\
> -$(qapi-modules) $(SRC_PATH)/scripts/qapi-introspect.py $(qapi-py)
> -       $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-introspect.py \
> -               $(gen-out-type) -o "." $<, \
> -               "GEN","$@")
> +qapi-types.c qapi-types.h \
> +qapi-visit.c qapi-visit.h \
> +qmp-commands.h qmp-marshal.c \
> +qapi-event.c qapi-event.h \
> +qmp-introspect.h qmp-introspect.c \
> +qapi.texi: \
> +qapi-gen-timestamp ;
> +qapi-gen-timestamp: $(qapi-modules) $(qapi-py)
> +       $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-gen.py \
> +               -o "." -b $<, \
> +               "GEN","$(@:%-timestamp=%)")
> +       @>$@
>
>  QGALIB_GEN=$(addprefix qga/qapi-generated/, qga-qapi-types.h qga-qapi-visit.h qga-qmp-commands.h)
>  $(qga-obj-y): $(QGALIB_GEN)
> @@ -596,6 +585,7 @@ clean:
>         rm -f trace/generated-tracers-dtrace.dtrace*
>         rm -f trace/generated-tracers-dtrace.h*
>         rm -f $(foreach f,$(GENERATED_FILES),$(f) $(f)-timestamp)
> +       rm -f qapi-gen-timestamp
>         rm -rf qapi-generated
>         rm -rf qga/qapi-generated
>         for d in $(ALL_SUBDIRS); do \
> @@ -803,13 +793,11 @@ qemu-monitor-info.texi: $(SRC_PATH)/hmp-commands-info.hx $(SRC_PATH)/scripts/hxt
>  qemu-img-cmds.texi: $(SRC_PATH)/qemu-img-cmds.hx $(SRC_PATH)/scripts/hxtool
>         $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"GEN","$@")
>
> -docs/interop/qemu-qmp-qapi.texi docs/interop/qemu-ga-qapi.texi: $(SRC_PATH)/scripts/qapi2texi.py $(qapi-py)
> +docs/interop/qemu-qmp-qapi.texi: qapi.texi
> +       @cp -p $< $@
>
> -docs/interop/qemu-qmp-qapi.texi: $(qapi-modules)
> -       $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi2texi.py $< > $@,"GEN","$@")
> -
> -docs/interop/qemu-ga-qapi.texi: $(SRC_PATH)/qga/qapi-schema.json
> -       $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi2texi.py $< > $@,"GEN","$@")
> +docs/interop/qemu-ga-qapi.texi: qga/qapi-generated/qga-qapi.texi
> +       @cp -p $< $@
>
>  qemu.1: qemu-doc.texi qemu-options.texi qemu-monitor.texi qemu-monitor-info.texi
>  qemu.1: qemu-option-trace.texi
> diff --git a/scripts/qapi-gen.py b/scripts/qapi-gen.py
> new file mode 100755
> index 0000000000..575c938a1b
> --- /dev/null
> +++ b/scripts/qapi-gen.py
> @@ -0,0 +1,41 @@
> +#!/usr/bin/env python
> +# QAPI generator
> +#
> +# This work is licensed under the terms of the GNU GPL, version 2 or later.
> +# See the COPYING file in the top-level directory.
> +
> +import sys
> +from qapi.common import parse_command_line, QAPISchema
> +from qapi.types import gen_types
> +from qapi.visit import gen_visit
> +from qapi.commands import gen_commands
> +from qapi.events import gen_events
> +from qapi.introspect import gen_introspect
> +from qapi.doc import gen_doc
> +
> +
> +def main(argv):
> +    (input_file, output_dir, do_c, do_h, prefix, opts) = \
> +        parse_command_line('bu', ['builtins', 'unmask-non-abi-names'])
> +
> +    opt_builtins = False
> +    opt_unmask = False
> +
> +    for o, a in opts:
> +        if o in ('-b', '--builtins'):
> +            opt_builtins = True
> +        if o in ('-u', '--unmask-non-abi-names'):
> +            opt_unmask = True
> +
> +    schema = QAPISchema(input_file)
> +
> +    gen_types(schema, output_dir, prefix, opt_builtins)
> +    gen_visit(schema, output_dir, prefix, opt_builtins)
> +    gen_commands(schema, output_dir, prefix)
> +    gen_events(schema, output_dir, prefix)
> +    gen_introspect(schema, output_dir, prefix, opt_unmask)
> +    gen_doc(schema, output_dir, prefix)
> +
> +
> +if __name__ == '__main__':
> +    main(sys.argv)
> diff --git a/scripts/qapi/__init__.py b/scripts/qapi/__init__.py
> new file mode 100644
> index 0000000000..e69de29bb2
> diff --git a/scripts/qapi-commands.py b/scripts/qapi/commands.py
> similarity index 94%
> rename from scripts/qapi-commands.py
> rename to scripts/qapi/commands.py
> index 331b58670e..383a4dd426 100644
> --- a/scripts/qapi-commands.py
> +++ b/scripts/qapi/commands.py
> @@ -13,7 +13,7 @@ This work is licensed under the terms of the GNU GPL, version 2.
>  See the COPYING file in the top-level directory.
>  """
>
> -from qapi import *
> +from qapi.common import *
>
>
>  def gen_command_decl(name, arg_type, boxed, ret_type):
> @@ -255,13 +255,8 @@ class QAPISchemaGenCommandVisitor(QAPISchemaVisitor):
>          self._regy += gen_register_command(name, success_response)
>
>
> -def main(argv):
> -    (input_file, output_dir, do_c, do_h, prefix, opts) = parse_command_line()
> -
> -    blurb = '''
> - * Schema-defined QAPI/QMP commands
> -'''
> -
> +def gen_commands(schema, output_dir, prefix):
> +    blurb = ' * Schema-defined QAPI/QMP commands'
>      genc = QAPIGenC(blurb, __doc__)
>      genh = QAPIGenH(blurb, __doc__)
>
> @@ -290,17 +285,9 @@ void %(c_prefix)sqmp_init_marshal(QmpCommandList *cmds);
>  ''',
>                      prefix=prefix, c_prefix=c_name(prefix, protect=False)))
>
> -    schema = QAPISchema(input_file)
>      vis = QAPISchemaGenCommandVisitor(prefix)
>      schema.visit(vis)
>      genc.body(vis.defn)
>      genh.body(vis.decl)
> -
> -    if do_c:
> -        genc.write(output_dir, prefix + 'qmp-marshal.c')
> -    if do_h:
> -        genh.write(output_dir, prefix + 'qmp-commands.h')
> -
> -
> -if __name__ == '__main__':
> -    main(sys.argv)
> +    genc.write(output_dir, prefix + 'qmp-marshal.c')
> +    genh.write(output_dir, prefix + 'qmp-commands.h')
> diff --git a/scripts/qapi.py b/scripts/qapi/common.py
> similarity index 100%
> rename from scripts/qapi.py
> rename to scripts/qapi/common.py
> diff --git a/scripts/qapi2texi.py b/scripts/qapi/doc.py
> old mode 100755
> new mode 100644
> similarity index 92%
> rename from scripts/qapi2texi.py
> rename to scripts/qapi/doc.py
> index 924b374cd3..1f57f6e1c2
> --- a/scripts/qapi2texi.py
> +++ b/scripts/qapi/doc.py
> @@ -4,10 +4,9 @@
>  # This work is licensed under the terms of the GNU LGPL, version 2+.
>  # See the COPYING file in the top-level directory.
>  """This script produces the documentation of a qapi schema in texinfo format"""
> +
>  import re
> -import sys
> -
> -import qapi
> +import qapi.common
>
>  MSG_FMT = """
>  @deftypefn {type} {{}} {name}
> @@ -196,7 +195,7 @@ def texi_entity(doc, what, base=None, variants=None,
>              + texi_sections(doc))
>
>
> -class QAPISchemaGenDocVisitor(qapi.QAPISchemaVisitor):
> +class QAPISchemaGenDocVisitor(qapi.common.QAPISchemaVisitor):

Would be a bit easier to read and more consitent with a top-level
"from qapi.common import QAPISchemaVisitor"

>      def __init__(self):
>          self.out = None
>          self.cur_doc = None
> @@ -271,20 +270,8 @@ def texi_schema(schema):
>      return gen.out
>
>
> -def main(argv):
> -    """Takes schema argument, prints result to stdout"""
> -    if len(argv) != 2:
> -        print >>sys.stderr, "%s: need exactly 1 argument: SCHEMA" % argv[0]
> -        sys.exit(1)
> -
> -    schema = qapi.QAPISchema(argv[1])
> -    if not qapi.doc_required:
> -        print >>sys.stderr, ("%s: need pragma 'doc-required' "
> -                             "to generate documentation" % argv[0])
> -        sys.exit(1)
> -    print '@c AUTOMATICALLY GENERATED, DO NOT MODIFY\n'
> -    print texi_schema(schema),
> -
> -
> -if __name__ == '__main__':
> -    main(sys.argv)
> +def gen_doc(schema, output_dir, prefix):
> +    if qapi.common.doc_required:
> +        gen = qapi.common.QAPIGenDoc()
> +        gen.body(texi_schema(schema))
> +        gen.write(output_dir, prefix + 'qapi.texi')
> diff --git a/scripts/qapi-event.py b/scripts/qapi/events.py
> similarity index 92%
> rename from scripts/qapi-event.py
> rename to scripts/qapi/events.py
> index 5b33c694d4..1f267686db 100644
> --- a/scripts/qapi-event.py
> +++ b/scripts/qapi/events.py
> @@ -12,7 +12,7 @@ This work is licensed under the terms of the GNU GPL, version 2.
>  See the COPYING file in the top-level directory.
>  """
>
> -from qapi import *
> +from qapi.common import *
>
>
>  def build_event_send_proto(name, arg_type, boxed):
> @@ -171,13 +171,8 @@ class QAPISchemaGenEventVisitor(QAPISchemaVisitor):
>          self._event_names.append(name)
>
>
> -def main(argv):
> -    (input_file, output_dir, do_c, do_h, prefix, dummy) = parse_command_line()
> -
> -    blurb = '''
> - * Schema-defined QAPI/QMP events
> -'''
> -
> +def gen_events(schema, output_dir, prefix):
> +    blurb = ' * Schema-defined QAPI/QMP events'
>      genc = QAPIGenC(blurb, __doc__)
>      genh = QAPIGenH(blurb, __doc__)
>
> @@ -201,17 +196,9 @@ def main(argv):
>  ''',
>                      prefix=prefix))
>
> -    schema = QAPISchema(input_file)
>      vis = QAPISchemaGenEventVisitor(prefix)
>      schema.visit(vis)
>      genc.body(vis.defn)
>      genh.body(vis.decl)
> -
> -    if do_c:
> -        genc.write(output_dir, prefix + 'qapi-event.c')
> -    if do_h:
> -        genh.write(output_dir, prefix + 'qapi-event.h')
> -
> -
> -if __name__ == '__main__':
> -    main(sys.argv)
> +    genc.write(output_dir, prefix + 'qapi-event.c')
> +    genh.write(output_dir, prefix + 'qapi-event.h')
> diff --git a/scripts/qapi-introspect.py b/scripts/qapi/introspect.py
> similarity index 90%
> rename from scripts/qapi-introspect.py
> rename to scripts/qapi/introspect.py
> index 09e7d1f140..2153060f2c 100644
> --- a/scripts/qapi-introspect.py
> +++ b/scripts/qapi/introspect.py
> @@ -10,7 +10,7 @@ This work is licensed under the terms of the GNU GPL, version 2.
>  See the COPYING file in the top-level directory.
>  """
>
> -from qapi import *
> +from qapi.common import *
>
>
>  # Caveman's json.dumps() replacement (we're stuck at Python 2.4)
> @@ -168,22 +168,8 @@ const char %(c_name)s[] = %(c_string)s;
>          self._gen_json(name, 'event', {'arg-type': self._use_type(arg_type)})
>
>
> -def main(argv):
> -    # Debugging aid: unmask QAPI schema's type names
> -    # We normally mask them, because they're not QMP wire ABI
> -    opt_unmask = False
> -
> -    (input_file, output_dir, do_c, do_h, prefix, opts) = \
> -        parse_command_line('u', ['unmask-non-abi-names'])
> -
> -    for o, a in opts:
> -        if o in ('-u', '--unmask-non-abi-names'):
> -            opt_unmask = True
> -
> -    blurb = '''
> - * QAPI/QMP schema introspection
> -'''
> -
> +def gen_introspect(schema, output_dir, prefix, opt_unmask):
> +    blurb = ' * QAPI/QMP schema introspection'
>      genc = QAPIGenC(blurb, __doc__)
>      genh = QAPIGenH(blurb, __doc__)
>
> @@ -194,17 +180,9 @@ def main(argv):
>  ''',
>                      prefix=prefix))
>
> -    schema = QAPISchema(input_file)
>      vis = QAPISchemaGenIntrospectVisitor(prefix, opt_unmask)
>      schema.visit(vis)
>      genc.body(vis.defn)
>      genh.body(vis.decl)
> -
> -    if do_c:
> -        genc.write(output_dir, prefix + 'qmp-introspect.c')
> -    if do_h:
> -        genh.write(output_dir, prefix + 'qmp-introspect.h')
> -
> -
> -if __name__ == '__main__':
> -    main(sys.argv)
> +    genc.write(output_dir, prefix + 'qmp-introspect.c')
> +    genh.write(output_dir, prefix + 'qmp-introspect.h')
> diff --git a/scripts/qapi-types.py b/scripts/qapi/types.py
> similarity index 90%
> rename from scripts/qapi-types.py
> rename to scripts/qapi/types.py
> index f2ddde94b1..b2095120e0 100644
> --- a/scripts/qapi-types.py
> +++ b/scripts/qapi/types.py
> @@ -13,7 +13,7 @@ This work is licensed under the terms of the GNU GPL, version 2.
>  # See the COPYING file in the top-level directory.
>  """
>
> -from qapi import *
> +from qapi.common import *
>
>
>  # variants must be emitted before their container; track what has already
> @@ -241,24 +241,8 @@ class QAPISchemaGenTypeVisitor(QAPISchemaVisitor):
>          self._gen_type_cleanup(name)
>
>
> -def main(argv):
> -    # If you link code generated from multiple schemata, you want only one
> -    # instance of the code for built-in types.  Generate it only when
> -    # opt_builtins, enabled by command line option -b.  See also
> -    # QAPISchemaGenTypeVisitor.visit_end().
> -    opt_builtins = False
> -
> -    (input_file, output_dir, do_c, do_h, prefix, opts) = \
> -        parse_command_line('b', ['builtins'])
> -
> -    for o, a in opts:
> -        if o in ('-b', '--builtins'):
> -            opt_builtins = True
> -
> -    blurb = '''
> - * Schema-defined QAPI types
> -'''
> -
> +def gen_types(schema, output_dir, prefix, opt_builtins):
> +    blurb = ' * Schema-defined QAPI types'
>      genc = QAPIGenC(blurb, __doc__)
>      genh = QAPIGenH(blurb, __doc__)
>
> @@ -274,17 +258,9 @@ def main(argv):
>  #include "qapi/util.h"
>  '''))
>
> -    schema = QAPISchema(input_file)
>      vis = QAPISchemaGenTypeVisitor(opt_builtins)
>      schema.visit(vis)
>      genc.body(vis.defn)
>      genh.body(vis.decl)
> -
> -    if do_c:
> -        genc.write(output_dir, prefix + 'qapi-types.c')
> -    if do_h:
> -        genh.write(output_dir, prefix + 'qapi-types.h')
> -
> -
> -if __name__ == '__main__':
> -    main(sys.argv)
> +    genc.write(output_dir, prefix + 'qapi-types.c')
> +    genh.write(output_dir, prefix + 'qapi-types.h')
> diff --git a/scripts/qapi-visit.py b/scripts/qapi/visit.py
> similarity index 92%
> rename from scripts/qapi-visit.py
> rename to scripts/qapi/visit.py
> index 473fa72574..80c0b85f8c 100644
> --- a/scripts/qapi-visit.py
> +++ b/scripts/qapi/visit.py
> @@ -13,7 +13,7 @@ This work is licensed under the terms of the GNU GPL, version 2.
>  See the COPYING file in the top-level directory.
>  """
>
> -from qapi import *
> +from qapi.common import *
>
>
>  def gen_visit_decl(name, scalar=False):
> @@ -324,24 +324,8 @@ class QAPISchemaGenVisitVisitor(QAPISchemaVisitor):
>          self.defn += gen_visit_alternate(name, variants)
>
>
> -def main(argv):
> -    # If you link code generated from multiple schemata, you want only one
> -    # instance of the code for built-in types.  Generate it only when
> -    # opt_builtins, enabled by command line option -b.  See also
> -    # QAPISchemaGenVisitVisitor.visit_end().
> -    opt_builtins = False
> -
> -    (input_file, output_dir, do_c, do_h, prefix, opts) = \
> -        parse_command_line('b', ['builtins'])
> -
> -    for o, a in opts:
> -        if o in ('-b', '--builtins'):
> -            opt_builtins = True
> -
> -    blurb = '''
> - * Schema-defined QAPI visitors
> -'''
> -
> +def gen_visit(schema, output_dir, prefix, opt_builtins):
> +    blurb = ' * Schema-defined QAPI visitors'
>      genc = QAPIGenC(blurb, __doc__)
>      genh = QAPIGenH(blurb, __doc__)
>
> @@ -361,17 +345,9 @@ def main(argv):
>  ''',
>                      prefix=prefix))
>
> -    schema = QAPISchema(input_file)
>      vis = QAPISchemaGenVisitVisitor(opt_builtins)
>      schema.visit(vis)
>      genc.body(vis.defn)
>      genh.body(vis.decl)
> -
> -    if do_c:
> -        genc.write(output_dir, prefix + 'qapi-visit.c')
> -    if do_h:
> -        genh.write(output_dir, prefix + 'qapi-visit.h')
> -
> -
> -if __name__ == '__main__':
> -    main(sys.argv)
> +    genc.write(output_dir, prefix + 'qapi-visit.c')
> +    genh.write(output_dir, prefix + 'qapi-visit.h')
> diff --git a/tests/Makefile.include b/tests/Makefile.include
> index 851aafe9d1..768655a810 100644
> --- a/tests/Makefile.include
> +++ b/tests/Makefile.include
> @@ -23,7 +23,16 @@ check-help:
>  ifneq ($(wildcard config-host.mak),)
>  export SRC_PATH
>
> -qapi-py = $(SRC_PATH)/scripts/qapi.py $(SRC_PATH)/scripts/ordereddict.py
> +# TODO don't duplicate $(SRC_PATH)/Makefile's qapi-py here

hmm, it doesn't look necessary, since the makefile is included from
there. Right?

> +qapi-py = $(SRC_PATH)/scripts/qapi/commands.py \
> +$(SRC_PATH)/scripts/qapi/events.py \
> +$(SRC_PATH)/scripts/qapi/introspect.py \
> +$(SRC_PATH)/scripts/qapi/types.py \
> +$(SRC_PATH)/scripts/qapi/visit.py \
> +$(SRC_PATH)/scripts/qapi/common.py \
> +$(SRC_PATH)/scripts/qapi/doc.py \
> +$(SRC_PATH)/scripts/ordereddict.py \
> +$(SRC_PATH)/scripts/qapi-gen.py
>
>  # Get the list of all supported sysemu targets
>  SYSEMU_TARGET_LIST := $(subst -softmmu.mak,,$(notdir \
> @@ -642,34 +651,24 @@ tests/test-logging$(EXESUF): tests/test-logging.o $(test-util-obj-y)
>  tests/test-replication$(EXESUF): tests/test-replication.o $(test-util-obj-y) \
>         $(test-block-obj-y)
>
> -tests/test-qapi-types.c tests/test-qapi-types.h :\
> -$(SRC_PATH)/tests/qapi-schema/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-types.py $(qapi-py)
> -       $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py \
> -               $(gen-out-type) -o tests -p "test-" $<, \
> -               "GEN","$@")
> -tests/test-qapi-visit.c tests/test-qapi-visit.h :\
> -$(SRC_PATH)/tests/qapi-schema/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py)
> -       $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py \
> -               $(gen-out-type) -o tests -p "test-" $<, \
> -               "GEN","$@")
> -tests/test-qmp-commands.h tests/test-qmp-marshal.c :\
> -$(SRC_PATH)/tests/qapi-schema/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py)
> -       $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py \
> -               $(gen-out-type) -o tests -p "test-" $<, \
> -               "GEN","$@")
> -tests/test-qapi-event.c tests/test-qapi-event.h :\
> -$(SRC_PATH)/tests/qapi-schema/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-event.py $(qapi-py)
> -       $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-event.py \
> -               $(gen-out-type) -o tests -p "test-" $<, \
> -               "GEN","$@")
> -tests/test-qmp-introspect.c tests/test-qmp-introspect.h :\
> -$(SRC_PATH)/tests/qapi-schema/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-introspect.py $(qapi-py)
> -       $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-introspect.py \
> -               $(gen-out-type) -o tests -p "test-" $<, \
> -               "GEN","$@")
> +tests/test-qapi-types.c tests/test-qapi-types.h \
> +tests/test-qapi-visit.c tests/test-qapi-visit.h \
> +tests/test-qmp-commands.h tests/test-qmp-marshal.c \
> +tests/test-qapi-event.c tests/test-qapi-event.h \
> +tests/test-qmp-introspect.c tests/test-qmp-introspect.h: \
> +tests/test-qapi-gen-timestamp ;
> +tests/test-qapi-gen-timestamp: $(SRC_PATH)/tests/qapi-schema/qapi-schema-test.json $(qapi-py)
> +       $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-gen.py \
> +               -o tests -p "test-" $<, \
> +               "GEN","$(@:%-timestamp=%)")
> +       @>$@
>
> -tests/qapi-schema/doc-good.test.texi: $(SRC_PATH)/tests/qapi-schema/doc-good.json $(SRC_PATH)/scripts/qapi2texi.py $(qapi-py)
> -       $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi2texi.py $< > $@,"GEN","$@")
> +tests/qapi-schema/doc-good.test.texi: $(SRC_PATH)/tests/qapi-schema/doc-good.json $(qapi-py)
> +       $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-gen.py \
> +               -o tests/qapi-schema -p "doc-good-" $<, \
> +               "GEN","$@")
> +       @mv tests/qapi-schema/doc-good-qapi.texi $@
> +       @rm -f tests/qapi-schema/doc-good-qapi-*.[ch] tests/qapi-schema/doc-good-qmp-*.[ch]
>
>  tests/test-string-output-visitor$(EXESUF): tests/test-string-output-visitor.o $(test-qapi-obj-y)
>  tests/test-string-input-visitor$(EXESUF): tests/test-string-input-visitor.o $(test-qapi-obj-y)
> @@ -937,6 +936,7 @@ check-clean:
>         $(MAKE) -C tests/tcg clean
>         rm -rf $(check-unit-y) tests/*.o $(QEMU_IOTESTS_HELPERS-y)
>         rm -rf $(sort $(foreach target,$(SYSEMU_TARGET_LIST), $(check-qtest-$(target)-y)) $(check-qtest-generic-y))
> +       rm -f tests/test-qapi-gen-timestamp
>
>  clean: check-clean
>
> diff --git a/tests/qapi-schema/test-qapi.py b/tests/qapi-schema/test-qapi.py
> index fe0ca08d78..7772d09919 100644
> --- a/tests/qapi-schema/test-qapi.py
> +++ b/tests/qapi-schema/test-qapi.py
> @@ -10,7 +10,7 @@
>  # See the COPYING file in the top-level directory.
>  #
>
> -from qapi import *
> +from qapi.common import *
>  from pprint import pprint
>  import os
>  import sys
> --
> 2.13.6
>

good to me otherwise,
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 07/21] qapi: Move parse_command_line() next to its only use
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 07/21] qapi: Move parse_command_line() next to its only use Markus Armbruster
  2018-02-02 19:29   ` Eric Blake
@ 2018-02-05 13:45   ` Marc-Andre Lureau
  1 sibling, 0 replies; 87+ messages in thread
From: Marc-Andre Lureau @ 2018-02-05 13:45 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: qemu-devel, marcandre, Blake, Eric, mdroth

On Fri, Feb 2, 2018 at 2:03 PM, Markus Armbruster <armbru@redhat.com> wrote:
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>


> ---
>  scripts/qapi-gen.py    | 52 +++++++++++++++++++++++++++++++++++++++++++++++-
>  scripts/qapi/common.py | 54 --------------------------------------------------
>  2 files changed, 51 insertions(+), 55 deletions(-)
>
> diff --git a/scripts/qapi-gen.py b/scripts/qapi-gen.py
> index 575c938a1b..6302fd0d55 100755
> --- a/scripts/qapi-gen.py
> +++ b/scripts/qapi-gen.py
> @@ -4,8 +4,10 @@
>  # This work is licensed under the terms of the GNU GPL, version 2 or later.
>  # See the COPYING file in the top-level directory.
>
> +import getopt
> +import re
>  import sys
> -from qapi.common import parse_command_line, QAPISchema
> +from qapi.common import QAPISchema
>  from qapi.types import gen_types
>  from qapi.visit import gen_visit
>  from qapi.commands import gen_commands
> @@ -14,6 +16,54 @@ from qapi.introspect import gen_introspect
>  from qapi.doc import gen_doc
>
>
> +def parse_command_line(extra_options='', extra_long_options=[]):
> +
> +    try:
> +        opts, args = getopt.gnu_getopt(sys.argv[1:],
> +                                       'chp:o:' + extra_options,
> +                                       ['source', 'header', 'prefix=',
> +                                        'output-dir='] + extra_long_options)
> +    except getopt.GetoptError as err:
> +        print >>sys.stderr, "%s: %s" % (sys.argv[0], str(err))
> +        sys.exit(1)
> +
> +    output_dir = ''
> +    prefix = ''
> +    do_c = False
> +    do_h = False
> +    extra_opts = []
> +
> +    for oa in opts:
> +        o, a = oa
> +        if o in ('-p', '--prefix'):
> +            match = re.match(r'([A-Za-z_.-][A-Za-z0-9_.-]*)?', a)
> +            if match.end() != len(a):
> +                print >>sys.stderr, \
> +                    "%s: 'funny character '%s' in argument of --prefix" \
> +                    % (sys.argv[0], a[match.end()])
> +                sys.exit(1)
> +            prefix = a
> +        elif o in ('-o', '--output-dir'):
> +            output_dir = a + '/'
> +        elif o in ('-c', '--source'):
> +            do_c = True
> +        elif o in ('-h', '--header'):
> +            do_h = True
> +        else:
> +            extra_opts.append(oa)
> +
> +    if not do_c and not do_h:
> +        do_c = True
> +        do_h = True
> +
> +    if len(args) != 1:
> +        print >>sys.stderr, "%s: need exactly one argument" % sys.argv[0]
> +        sys.exit(1)
> +    fname = args[0]
> +
> +    return (fname, output_dir, do_c, do_h, prefix, extra_opts)
> +
> +
>  def main(argv):
>      (input_file, output_dir, do_c, do_h, prefix, opts) = \
>          parse_command_line('bu', ['builtins', 'unmask-non-abi-names'])
> diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py
> index d73ef618e2..cfa2671ca3 100644
> --- a/scripts/qapi/common.py
> +++ b/scripts/qapi/common.py
> @@ -12,7 +12,6 @@
>  # See the COPYING file in the top-level directory.
>
>  import errno
> -import getopt
>  import os
>  import re
>  import string
> @@ -1917,59 +1916,6 @@ def build_params(arg_type, boxed, extra):
>
>
>  #
> -# Common command line parsing
> -#
> -
> -
> -def parse_command_line(extra_options='', extra_long_options=[]):
> -
> -    try:
> -        opts, args = getopt.gnu_getopt(sys.argv[1:],
> -                                       'chp:o:' + extra_options,
> -                                       ['source', 'header', 'prefix=',
> -                                        'output-dir='] + extra_long_options)
> -    except getopt.GetoptError as err:
> -        print >>sys.stderr, "%s: %s" % (sys.argv[0], str(err))
> -        sys.exit(1)
> -
> -    output_dir = ''
> -    prefix = ''
> -    do_c = False
> -    do_h = False
> -    extra_opts = []
> -
> -    for oa in opts:
> -        o, a = oa
> -        if o in ('-p', '--prefix'):
> -            match = re.match(r'([A-Za-z_.-][A-Za-z0-9_.-]*)?', a)
> -            if match.end() != len(a):
> -                print >>sys.stderr, \
> -                    "%s: 'funny character '%s' in argument of --prefix" \
> -                    % (sys.argv[0], a[match.end()])
> -                sys.exit(1)
> -            prefix = a
> -        elif o in ('-o', '--output-dir'):
> -            output_dir = a + '/'
> -        elif o in ('-c', '--source'):
> -            do_c = True
> -        elif o in ('-h', '--header'):
> -            do_h = True
> -        else:
> -            extra_opts.append(oa)
> -
> -    if not do_c and not do_h:
> -        do_c = True
> -        do_h = True
> -
> -    if len(args) != 1:
> -        print >>sys.stderr, "%s: need exactly one argument" % sys.argv[0]
> -        sys.exit(1)
> -    fname = args[0]
> -
> -    return (fname, output_dir, do_c, do_h, prefix, extra_opts)
> -
> -
> -#
>  # Accumulate and write output
>  #
>
> --
> 2.13.6
>

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 10/21] qapi/common: Eliminate QAPISchema.exprs
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 10/21] qapi/common: Eliminate QAPISchema.exprs Markus Armbruster
  2018-02-02 22:02   ` Eric Blake
@ 2018-02-05 13:45   ` Marc-Andre Lureau
  1 sibling, 0 replies; 87+ messages in thread
From: Marc-Andre Lureau @ 2018-02-05 13:45 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: qemu-devel, marcandre, Blake, Eric, mdroth

On Fri, Feb 2, 2018 at 2:03 PM, Markus Armbruster <armbru@redhat.com> wrote:
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>


> ---
>  scripts/qapi/common.py | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py
> index 6c6962a364..78e960d07c 100644
> --- a/scripts/qapi/common.py
> +++ b/scripts/qapi/common.py
> @@ -1457,13 +1457,13 @@ class QAPISchema(object):
>      def __init__(self, fname):
>          try:
>              parser = QAPISchemaParser(open(fname, 'r'))
> -            self.exprs = check_exprs(parser.exprs)
> +            exprs = check_exprs(parser.exprs)
>              self.docs = parser.docs
>              self._entity_dict = {}
>              self._predefining = True
>              self._def_predefineds()
>              self._predefining = False
> -            self._def_exprs()
> +            self._def_exprs(exprs)
>              self.check()
>          except QAPIError as err:
>              print >>sys.stderr, err
> @@ -1648,8 +1648,8 @@ class QAPISchema(object):
>                  name, info, doc, 'arg', self._make_members(data, info))
>          self._def_entity(QAPISchemaEvent(name, info, doc, data, boxed))
>
> -    def _def_exprs(self):
> -        for expr_elem in self.exprs:
> +    def _def_exprs(self, exprs):
> +        for expr_elem in exprs:
>              expr = expr_elem['expr']
>              info = expr_elem['info']
>              doc = expr_elem.get('doc')
> --
> 2.13.6
>

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 11/21] qapi: Lift error reporting from QAPISchema.__init__() to callers
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 11/21] qapi: Lift error reporting from QAPISchema.__init__() to callers Markus Armbruster
@ 2018-02-05 13:45   ` Marc-Andre Lureau
  0 siblings, 0 replies; 87+ messages in thread
From: Marc-Andre Lureau @ 2018-02-05 13:45 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: qemu-devel, marcandre, Blake, Eric, mdroth

On Fri, Feb 2, 2018 at 2:03 PM, Markus Armbruster <armbru@redhat.com> wrote:
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>


> ---
>  scripts/qapi-gen.py            |  8 ++++++--
>  scripts/qapi/common.py         | 23 +++++++++--------------
>  tests/qapi-schema/test-qapi.py |  8 +++++++-
>  3 files changed, 22 insertions(+), 17 deletions(-)
>
> diff --git a/scripts/qapi-gen.py b/scripts/qapi-gen.py
> index 6302fd0d55..ba82ca92cc 100755
> --- a/scripts/qapi-gen.py
> +++ b/scripts/qapi-gen.py
> @@ -7,7 +7,7 @@
>  import getopt
>  import re
>  import sys
> -from qapi.common import QAPISchema
> +from qapi.common import QAPIError, QAPISchema
>  from qapi.types import gen_types
>  from qapi.visit import gen_visit
>  from qapi.commands import gen_commands
> @@ -77,7 +77,11 @@ def main(argv):
>          if o in ('-u', '--unmask-non-abi-names'):
>              opt_unmask = True
>
> -    schema = QAPISchema(input_file)
> +    try:
> +        schema = QAPISchema(input_file)
> +    except QAPIError as err:
> +        print >>sys.stderr, err
> +        exit(1)
>
>      gen_types(schema, output_dir, prefix, opt_builtins)
>      gen_visit(schema, output_dir, prefix, opt_builtins)
> diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py
> index 78e960d07c..d334e1db5a 100644
> --- a/scripts/qapi/common.py
> +++ b/scripts/qapi/common.py
> @@ -15,7 +15,6 @@ import errno
>  import os
>  import re
>  import string
> -import sys
>  from ordereddict import OrderedDict
>
>  builtin_types = {
> @@ -1455,19 +1454,15 @@ class QAPISchemaEvent(QAPISchemaEntity):
>
>  class QAPISchema(object):
>      def __init__(self, fname):
> -        try:
> -            parser = QAPISchemaParser(open(fname, 'r'))
> -            exprs = check_exprs(parser.exprs)
> -            self.docs = parser.docs
> -            self._entity_dict = {}
> -            self._predefining = True
> -            self._def_predefineds()
> -            self._predefining = False
> -            self._def_exprs(exprs)
> -            self.check()
> -        except QAPIError as err:
> -            print >>sys.stderr, err
> -            exit(1)
> +        parser = QAPISchemaParser(open(fname, 'r'))
> +        exprs = check_exprs(parser.exprs)
> +        self.docs = parser.docs
> +        self._entity_dict = {}
> +        self._predefining = True
> +        self._def_predefineds()
> +        self._predefining = False
> +        self._def_exprs(exprs)
> +        self.check()
>
>      def _def_entity(self, ent):
>          # Only the predefined types are allowed to not have info
> diff --git a/tests/qapi-schema/test-qapi.py b/tests/qapi-schema/test-qapi.py
> index 7772d09919..d6bb8ec6a4 100644
> --- a/tests/qapi-schema/test-qapi.py
> +++ b/tests/qapi-schema/test-qapi.py
> @@ -53,7 +53,13 @@ class QAPISchemaTestVisitor(QAPISchemaVisitor):
>              for v in variants.variants:
>                  print '    case %s: %s' % (v.name, v.type.name)
>
> -schema = QAPISchema(sys.argv[1])
> +
> +try:
> +    schema = QAPISchema(sys.argv[1])
> +except QAPIError as err:
> +    print >>sys.stderr, err
> +    exit(1)
> +
>  schema.visit(QAPISchemaTestVisitor())
>
>  for doc in schema.docs:
> --
> 2.13.6
>

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 12/21] qapi: Concentrate QAPISchemaParser.exprs updates in .__init__()
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 12/21] qapi: Concentrate QAPISchemaParser.exprs updates in .__init__() Markus Armbruster
@ 2018-02-05 13:45   ` Marc-Andre Lureau
  2018-02-05 14:26     ` Markus Armbruster
  0 siblings, 1 reply; 87+ messages in thread
From: Marc-Andre Lureau @ 2018-02-05 13:45 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: qemu-devel, marcandre, Blake, Eric, mdroth

On Fri, Feb 2, 2018 at 2:03 PM, Markus Armbruster <armbru@redhat.com> wrote:
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

It's not obvious the motivation behind this change (beside behind more
elegant), but
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>


> ---
>  scripts/qapi/common.py | 15 +++++++++------
>  1 file changed, 9 insertions(+), 6 deletions(-)
>
> diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py
> index d334e1db5a..7a327bfe9f 100644
> --- a/scripts/qapi/common.py
> +++ b/scripts/qapi/common.py
> @@ -286,8 +286,12 @@ class QAPISchemaParser(object):
>                  if not isinstance(include, str):
>                      raise QAPISemError(info,
>                                         "Value of 'include' must be a string")
> -                self._include(include, info, os.path.dirname(self.fname),
> -                              previously_included)
> +                exprs_include = self._include(include, info,
> +                                              os.path.dirname(self.fname),
> +                                              previously_included)
> +                if exprs_include:
> +                    self.exprs.extend(exprs_include.exprs)
> +                    self.docs.extend(exprs_include.docs)
>              elif "pragma" in expr:
>                  self.reject_expr_doc(cur_doc)
>                  if len(expr) != 1:
> @@ -330,14 +334,13 @@ class QAPISchemaParser(object):
>
>          # skip multiple include of the same file
>          if incl_abs_fname in previously_included:
> -            return
> +            return None
> +
>          try:
>              fobj = open(incl_fname, 'r')
>          except IOError as e:
>              raise QAPISemError(info, '%s: %s' % (e.strerror, incl_fname))
> -        exprs_include = QAPISchemaParser(fobj, previously_included, info)
> -        self.exprs.extend(exprs_include.exprs)
> -        self.docs.extend(exprs_include.docs)
> +        return QAPISchemaParser(fobj, previously_included, info)
>
>      def _pragma(self, name, value, info):
>          global doc_required, returns_whitelist, name_case_whitelist
> --
> 2.13.6
>

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 13/21] qapi: Record 'include' directives in parse tree
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 13/21] qapi: Record 'include' directives in parse tree Markus Armbruster
@ 2018-02-05 13:45   ` Marc-Andre Lureau
  0 siblings, 0 replies; 87+ messages in thread
From: Marc-Andre Lureau @ 2018-02-05 13:45 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: qemu-devel, marcandre, Blake, Eric, mdroth

On Fri, Feb 2, 2018 at 2:03 PM, Markus Armbruster <armbru@redhat.com> wrote:
> The parse tree is a list of expressions.  Except include expressions
> currently get replaced by the included file's parse tree.
>
> Instead of throwing away the include expression, keep it with the file
> name expanded so you don't have to track the including file's
> directory to make sense of it.
>
> A future commit will put this include expression to use.
>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>


> ---
>  scripts/qapi/common.py | 21 +++++++++++++++++----
>  1 file changed, 17 insertions(+), 4 deletions(-)
>
> diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py
> index 7a327bfe9f..d5b93e7381 100644
> --- a/scripts/qapi/common.py
> +++ b/scripts/qapi/common.py
> @@ -286,8 +286,11 @@ class QAPISchemaParser(object):
>                  if not isinstance(include, str):
>                      raise QAPISemError(info,
>                                         "Value of 'include' must be a string")
> -                exprs_include = self._include(include, info,
> -                                              os.path.dirname(self.fname),
> +                incl_fname = os.path.join(os.path.dirname(self.fname),
> +                                          include)
> +                self.exprs.append({'expr': {'include': incl_fname},
> +                                   'info': info})
> +                exprs_include = self._include(include, info, incl_fname,
>                                                previously_included)
>                  if exprs_include:
>                      self.exprs.extend(exprs_include.exprs)
> @@ -322,8 +325,7 @@ class QAPISchemaParser(object):
>                  "Documentation for '%s' is not followed by the definition"
>                  % doc.symbol)
>
> -    def _include(self, include, info, base_dir, previously_included):
> -        incl_fname = os.path.join(base_dir, include)
> +    def _include(self, include, info, incl_fname, previously_included):
>          incl_abs_fname = os.path.abspath(incl_fname)
>          # catch inclusion cycle
>          inf = info
> @@ -889,6 +891,9 @@ def check_exprs(exprs):
>          info = expr_elem['info']
>          doc = expr_elem.get('doc')
>
> +        if 'include' in expr:
> +            continue
> +
>          if not doc and doc_required:
>              raise QAPISemError(info,
>                                 "Expression missing documentation comment")
> @@ -927,6 +932,9 @@ def check_exprs(exprs):
>
>      # Try again for hidden UnionKind enum
>      for expr_elem in exprs:
> +        if 'include' in expr:
> +            continue
> +
>          expr = expr_elem['expr']
>          if 'union' in expr and not discriminator_find_enum_define(expr):
>              name = '%sKind' % expr['union']
> @@ -939,6 +947,9 @@ def check_exprs(exprs):
>
>      # Validate that exprs make sense
>      for expr_elem in exprs:
> +        if 'include' in expr:
> +            continue
> +
>          expr = expr_elem['expr']
>          info = expr_elem['info']
>          doc = expr_elem.get('doc')
> @@ -1663,6 +1674,8 @@ class QAPISchema(object):
>                  self._def_command(expr, info, doc)
>              elif 'event' in expr:
>                  self._def_event(expr, info, doc)
> +            elif 'include' in expr:
> +                pass
>              else:
>                  assert False
>
> --
> 2.13.6
>

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 14/21] qapi: Generate in source order
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 14/21] qapi: Generate in source order Markus Armbruster
@ 2018-02-05 13:45   ` Marc-Andre Lureau
  2018-02-05 14:33     ` Markus Armbruster
  0 siblings, 1 reply; 87+ messages in thread
From: Marc-Andre Lureau @ 2018-02-05 13:45 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: qemu-devel, marcandre, Blake, Eric, mdroth

On Fri, Feb 2, 2018 at 2:03 PM, Markus Armbruster <armbru@redhat.com> wrote:
> The generators' conversion to visitors (merge commit 9e72681d16)
> changed the processing order of entities from source order to
> alphabetical order.  The next commit needs source order, so change it
> back.
>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  scripts/qapi/common.py                   |   4 +-
>  tests/qapi-schema/comments.out           |   2 +-
>  tests/qapi-schema/doc-bad-section.out    |   4 +-
>  tests/qapi-schema/doc-good.out           |  32 ++--
>  tests/qapi-schema/empty.out              |   2 +-
>  tests/qapi-schema/event-case.out         |   2 +-
>  tests/qapi-schema/ident-with-escape.out  |   6 +-
>  tests/qapi-schema/include-relpath.out    |   2 +-
>  tests/qapi-schema/include-repetition.out |   2 +-
>  tests/qapi-schema/include-simple.out     |   2 +-
>  tests/qapi-schema/indented-expr.out      |   2 +-
>  tests/qapi-schema/qapi-schema-test.out   | 320 +++++++++++++++----------------
>  12 files changed, 191 insertions(+), 189 deletions(-)
>
> diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py
> index d5b93e7381..3b97bf8702 100644
> --- a/scripts/qapi/common.py
> +++ b/scripts/qapi/common.py
> @@ -1471,6 +1471,7 @@ class QAPISchema(object):
>          parser = QAPISchemaParser(open(fname, 'r'))
>          exprs = check_exprs(parser.exprs)
>          self.docs = parser.docs
> +        self._entity_list = []
>          self._entity_dict = {}
>          self._predefining = True
>          self._def_predefineds()
> @@ -1482,6 +1483,7 @@ class QAPISchema(object):
>          # Only the predefined types are allowed to not have info
>          assert ent.info or self._predefining
>          assert ent.name not in self._entity_dict
> +        self._entity_list.append(ent)
>          self._entity_dict[ent.name] = ent

Why not use the OrderedDict instead?

>
>      def lookup_entity(self, name, typ=None):
> @@ -1685,7 +1687,7 @@ class QAPISchema(object):
>
>      def visit(self, visitor):
>          visitor.visit_begin(self)
> -        for (name, entity) in sorted(self._entity_dict.items()):
> +        for entity in self._entity_list:
>              if visitor.visit_needed(entity):
>                  entity.visit(visitor)
>          visitor.visit_end()
> diff --git a/tests/qapi-schema/comments.out b/tests/qapi-schema/comments.out
> index 17e652535c..0261ddf202 100644
> --- a/tests/qapi-schema/comments.out
> +++ b/tests/qapi-schema/comments.out
> @@ -1,4 +1,4 @@
> +object q_empty
>  enum QType ['none', 'qnull', 'qnum', 'qstring', 'qdict', 'qlist', 'qbool']
>      prefix QTYPE
>  enum Status ['good', 'bad', 'ugly']
> -object q_empty
> diff --git a/tests/qapi-schema/doc-bad-section.out b/tests/qapi-schema/doc-bad-section.out
> index 089bde1381..23bf8c71ab 100644
> --- a/tests/qapi-schema/doc-bad-section.out
> +++ b/tests/qapi-schema/doc-bad-section.out
> @@ -1,7 +1,7 @@
> -enum Enum ['one', 'two']
> +object q_empty
>  enum QType ['none', 'qnull', 'qnum', 'qstring', 'qdict', 'qlist', 'qbool']
>      prefix QTYPE
> -object q_empty
> +enum Enum ['one', 'two']
>  doc symbol=Enum
>      body=
>  == Produces *invalid* texinfo
> diff --git a/tests/qapi-schema/doc-good.out b/tests/qapi-schema/doc-good.out
> index 1d2c250527..0c07301f07 100644
> --- a/tests/qapi-schema/doc-good.out
> +++ b/tests/qapi-schema/doc-good.out
> @@ -1,35 +1,35 @@
> +object q_empty
> +enum QType ['none', 'qnull', 'qnum', 'qstring', 'qdict', 'qlist', 'qbool']
> +    prefix QTYPE
> +enum Enum ['one', 'two']
>  object Base
>      member base1: Enum optional=False
> -enum Enum ['one', 'two']
> +object Variant1
> +    member var1: str optional=False
> +object Variant2
>  object Object
>      base Base
>      tag base1
>      case one: Variant1
>      case two: Variant2
> -enum QType ['none', 'qnull', 'qnum', 'qstring', 'qdict', 'qlist', 'qbool']
> -    prefix QTYPE
> +object q_obj_Variant1-wrapper
> +    member data: Variant1 optional=False
> +object q_obj_Variant2-wrapper
> +    member data: Variant2 optional=False
> +enum SugaredUnionKind ['one', 'two']
>  object SugaredUnion
>      member type: SugaredUnionKind optional=False
>      tag type
>      case one: q_obj_Variant1-wrapper
>      case two: q_obj_Variant2-wrapper
> -enum SugaredUnionKind ['one', 'two']
> -object Variant1
> -    member var1: str optional=False
> -object Variant2
> -command cmd q_obj_cmd-arg -> Object
> -   gen=True success_response=True boxed=False
> -command cmd-boxed Object -> None
> -   gen=True success_response=True boxed=True
> -object q_empty
> -object q_obj_Variant1-wrapper
> -    member data: Variant1 optional=False
> -object q_obj_Variant2-wrapper
> -    member data: Variant2 optional=False
>  object q_obj_cmd-arg
>      member arg1: int optional=False
>      member arg2: str optional=True
>      member arg3: bool optional=False
> +command cmd q_obj_cmd-arg -> Object
> +   gen=True success_response=True boxed=False
> +command cmd-boxed Object -> None
> +   gen=True success_response=True boxed=True
>  doc freeform
>      body=
>  = Section
> diff --git a/tests/qapi-schema/empty.out b/tests/qapi-schema/empty.out
> index 40b886ddae..0ec234eec4 100644
> --- a/tests/qapi-schema/empty.out
> +++ b/tests/qapi-schema/empty.out
> @@ -1,3 +1,3 @@
> +object q_empty
>  enum QType ['none', 'qnull', 'qnum', 'qstring', 'qdict', 'qlist', 'qbool']
>      prefix QTYPE
> -object q_empty
> diff --git a/tests/qapi-schema/event-case.out b/tests/qapi-schema/event-case.out
> index 313c0fe7be..110571b793 100644
> --- a/tests/qapi-schema/event-case.out
> +++ b/tests/qapi-schema/event-case.out
> @@ -1,5 +1,5 @@
> +object q_empty
>  enum QType ['none', 'qnull', 'qnum', 'qstring', 'qdict', 'qlist', 'qbool']
>      prefix QTYPE
>  event oops None
>     boxed=False
> -object q_empty
> diff --git a/tests/qapi-schema/ident-with-escape.out b/tests/qapi-schema/ident-with-escape.out
> index b5637cb2e0..8336aa7629 100644
> --- a/tests/qapi-schema/ident-with-escape.out
> +++ b/tests/qapi-schema/ident-with-escape.out
> @@ -1,7 +1,7 @@
> +object q_empty
>  enum QType ['none', 'qnull', 'qnum', 'qstring', 'qdict', 'qlist', 'qbool']
>      prefix QTYPE
> -command fooA q_obj_fooA-arg -> None
> -   gen=True success_response=True boxed=False
> -object q_empty
>  object q_obj_fooA-arg
>      member bar1: str optional=False
> +command fooA q_obj_fooA-arg -> None
> +   gen=True success_response=True boxed=False
> diff --git a/tests/qapi-schema/include-relpath.out b/tests/qapi-schema/include-relpath.out
> index 17e652535c..0261ddf202 100644
> --- a/tests/qapi-schema/include-relpath.out
> +++ b/tests/qapi-schema/include-relpath.out
> @@ -1,4 +1,4 @@
> +object q_empty
>  enum QType ['none', 'qnull', 'qnum', 'qstring', 'qdict', 'qlist', 'qbool']
>      prefix QTYPE
>  enum Status ['good', 'bad', 'ugly']
> -object q_empty
> diff --git a/tests/qapi-schema/include-repetition.out b/tests/qapi-schema/include-repetition.out
> index 17e652535c..0261ddf202 100644
> --- a/tests/qapi-schema/include-repetition.out
> +++ b/tests/qapi-schema/include-repetition.out
> @@ -1,4 +1,4 @@
> +object q_empty
>  enum QType ['none', 'qnull', 'qnum', 'qstring', 'qdict', 'qlist', 'qbool']
>      prefix QTYPE
>  enum Status ['good', 'bad', 'ugly']
> -object q_empty
> diff --git a/tests/qapi-schema/include-simple.out b/tests/qapi-schema/include-simple.out
> index 17e652535c..0261ddf202 100644
> --- a/tests/qapi-schema/include-simple.out
> +++ b/tests/qapi-schema/include-simple.out
> @@ -1,4 +1,4 @@
> +object q_empty
>  enum QType ['none', 'qnull', 'qnum', 'qstring', 'qdict', 'qlist', 'qbool']
>      prefix QTYPE
>  enum Status ['good', 'bad', 'ugly']
> -object q_empty
> diff --git a/tests/qapi-schema/indented-expr.out b/tests/qapi-schema/indented-expr.out
> index 586795f44d..34de8be426 100644
> --- a/tests/qapi-schema/indented-expr.out
> +++ b/tests/qapi-schema/indented-expr.out
> @@ -1,7 +1,7 @@
> +object q_empty
>  enum QType ['none', 'qnull', 'qnum', 'qstring', 'qdict', 'qlist', 'qbool']
>      prefix QTYPE
>  command eins None -> None
>     gen=True success_response=True boxed=False
> -object q_empty
>  command zwei None -> None
>     gen=True success_response=True boxed=False
> diff --git a/tests/qapi-schema/qapi-schema-test.out b/tests/qapi-schema/qapi-schema-test.out
> index 3b1e9082d3..50706b0136 100644
> --- a/tests/qapi-schema/qapi-schema-test.out
> +++ b/tests/qapi-schema/qapi-schema-test.out
> @@ -1,87 +1,129 @@
> -alternate AltEnumBool
> -    tag type
> -    case e: EnumOne
> -    case b: bool
> -alternate AltEnumInt
> -    tag type
> -    case e: EnumOne
> -    case i: int
> -alternate AltEnumNum
> -    tag type
> -    case e: EnumOne
> -    case n: number
> -alternate AltNumEnum
> -    tag type
> -    case n: number
> -    case e: EnumOne
> -alternate AltStrObj
> -    tag type
> -    case s: str
> -    case o: TestStruct
> -event EVENT_A None
> -   boxed=False
> -event EVENT_B None
> -   boxed=False
> -event EVENT_C q_obj_EVENT_C-arg
> -   boxed=False
> -event EVENT_D q_obj_EVENT_D-arg
> -   boxed=False
> -event EVENT_E UserDefZero
> -   boxed=True
> -event EVENT_F UserDefAlternate
> -   boxed=True
> +object q_empty
> +enum QType ['none', 'qnull', 'qnum', 'qstring', 'qdict', 'qlist', 'qbool']
> +    prefix QTYPE
> +object TestStruct
> +    member integer: int optional=False
> +    member boolean: bool optional=False
> +    member string: str optional=False
> +object NestedEnumsOne
> +    member enum1: EnumOne optional=False
> +    member enum2: EnumOne optional=True
> +    member enum3: EnumOne optional=False
> +    member enum4: EnumOne optional=True
> +enum MyEnum []
>  object Empty1
>  object Empty2
>      base Empty1
> +command user_def_cmd0 Empty2 -> Empty2
> +   gen=True success_response=True boxed=False
> +enum QEnumTwo ['value1', 'value2']
> +    prefix QENUM_TWO
> +object UserDefOne
> +    base UserDefZero
> +    member string: str optional=False
> +    member enum1: EnumOne optional=True
>  enum EnumOne ['value1', 'value2', 'value3']
> -object EventStructOne
> -    member struct1: UserDefOne optional=False
> +object UserDefZero
> +    member integer: int optional=False
> +object UserDefTwoDictDict
> +    member userdef: UserDefOne optional=False
>      member string: str optional=False
> -    member enum2: EnumOne optional=True
> +object UserDefTwoDict
> +    member string1: str optional=False
> +    member dict2: UserDefTwoDictDict optional=False
> +    member dict3: UserDefTwoDictDict optional=True
> +object UserDefTwo
> +    member string0: str optional=False
> +    member dict1: UserDefTwoDict optional=False
>  object ForceArrays
>      member unused1: UserDefOneList optional=False
>      member unused2: UserDefTwoList optional=False
>      member unused3: TestStructList optional=False
> -enum MyEnum []
> -object NestedEnumsOne
> -    member enum1: EnumOne optional=False
> -    member enum2: EnumOne optional=True
> -    member enum3: EnumOne optional=False
> -    member enum4: EnumOne optional=True
> -enum QEnumTwo ['value1', 'value2']
> -    prefix QENUM_TWO
> -enum QType ['none', 'qnull', 'qnum', 'qstring', 'qdict', 'qlist', 'qbool']
> -    prefix QTYPE
> -object TestStruct
> -    member integer: int optional=False
> -    member boolean: bool optional=False
> -    member string: str optional=False
>  object UserDefA
>      member boolean: bool optional=False
>      member a_b: int optional=True
> -alternate UserDefAlternate
> -    tag type
> -    case udfu: UserDefFlatUnion
> -    case e: EnumOne
> -    case i: int
> -    case n: null
>  object UserDefB
>      member intb: int optional=False
>      member a-b: bool optional=True
> -object UserDefC
> -    member string1: str optional=False
> -    member string2: str optional=False
>  object UserDefFlatUnion
>      base UserDefUnionBase
>      tag enum1
>      case value1: UserDefA
>      case value2: UserDefB
>      case value3: UserDefB
> +object UserDefUnionBase
> +    base UserDefZero
> +    member string: str optional=False
> +    member enum1: EnumOne optional=False
> +object q_obj_UserDefFlatUnion2-base
> +    member integer: int optional=True
> +    member string: str optional=False
> +    member enum1: QEnumTwo optional=False
>  object UserDefFlatUnion2
>      base q_obj_UserDefFlatUnion2-base
>      tag enum1
>      case value1: UserDefC
>      case value2: UserDefB
> +object WrapAlternate
> +    member alt: UserDefAlternate optional=False
> +alternate UserDefAlternate
> +    tag type
> +    case udfu: UserDefFlatUnion
> +    case e: EnumOne
> +    case i: int
> +    case n: null
> +object UserDefC
> +    member string1: str optional=False
> +    member string2: str optional=False
> +alternate AltEnumBool
> +    tag type
> +    case e: EnumOne
> +    case b: bool
> +alternate AltEnumNum
> +    tag type
> +    case e: EnumOne
> +    case n: number
> +alternate AltNumEnum
> +    tag type
> +    case n: number
> +    case e: EnumOne
> +alternate AltEnumInt
> +    tag type
> +    case e: EnumOne
> +    case i: int
> +alternate AltStrObj
> +    tag type
> +    case s: str
> +    case o: TestStruct
> +object q_obj_intList-wrapper
> +    member data: intList optional=False
> +object q_obj_int8List-wrapper
> +    member data: int8List optional=False
> +object q_obj_int16List-wrapper
> +    member data: int16List optional=False
> +object q_obj_int32List-wrapper
> +    member data: int32List optional=False
> +object q_obj_int64List-wrapper
> +    member data: int64List optional=False
> +object q_obj_uint8List-wrapper
> +    member data: uint8List optional=False
> +object q_obj_uint16List-wrapper
> +    member data: uint16List optional=False
> +object q_obj_uint32List-wrapper
> +    member data: uint32List optional=False
> +object q_obj_uint64List-wrapper
> +    member data: uint64List optional=False
> +object q_obj_numberList-wrapper
> +    member data: numberList optional=False
> +object q_obj_boolList-wrapper
> +    member data: boolList optional=False
> +object q_obj_strList-wrapper
> +    member data: strList optional=False
> +object q_obj_sizeList-wrapper
> +    member data: sizeList optional=False
> +object q_obj_anyList-wrapper
> +    member data: anyList optional=False
> +enum UserDefNativeListUnionKind ['integer', 's8', 's16', 's32', 's64', 'u8', 'u16', 'u32', 'u64', 'number', 'boolean', 'string', 'sizes', 'any']
>  object UserDefNativeListUnion
>      member type: UserDefNativeListUnionKind optional=False
>      tag type
> @@ -99,133 +141,91 @@ object UserDefNativeListUnion
>      case string: q_obj_strList-wrapper
>      case sizes: q_obj_sizeList-wrapper
>      case any: q_obj_anyList-wrapper
> -enum UserDefNativeListUnionKind ['integer', 's8', 's16', 's32', 's64', 'u8', 'u16', 'u32', 'u64', 'number', 'boolean', 'string', 'sizes', 'any']
> -object UserDefOne
> -    base UserDefZero
> -    member string: str optional=False
> -    member enum1: EnumOne optional=True
> +command user_def_cmd None -> None
> +   gen=True success_response=True boxed=False
> +object q_obj_user_def_cmd1-arg
> +    member ud1a: UserDefOne optional=False
> +command user_def_cmd1 q_obj_user_def_cmd1-arg -> None
> +   gen=True success_response=True boxed=False
> +object q_obj_user_def_cmd2-arg
> +    member ud1a: UserDefOne optional=False
> +    member ud1b: UserDefOne optional=True
> +command user_def_cmd2 q_obj_user_def_cmd2-arg -> UserDefTwo
> +   gen=True success_response=True boxed=False
> +object q_obj_guest-get-time-arg
> +    member a: int optional=False
> +    member b: int optional=True
> +command guest-get-time q_obj_guest-get-time-arg -> int
> +   gen=True success_response=True boxed=False
> +object q_obj_guest-sync-arg
> +    member arg: any optional=False
> +command guest-sync q_obj_guest-sync-arg -> any
> +   gen=True success_response=True boxed=False
> +command boxed-struct UserDefZero -> None
> +   gen=True success_response=True boxed=True
> +command boxed-union UserDefNativeListUnion -> None
> +   gen=True success_response=True boxed=True
>  object UserDefOptions
>      member i64: intList optional=True
>      member u64: uint64List optional=True
>      member u16: uint16List optional=True
>      member i64x: int optional=True
>      member u64x: uint64 optional=True
> -object UserDefTwo
> -    member string0: str optional=False
> -    member dict1: UserDefTwoDict optional=False
> -object UserDefTwoDict
> -    member string1: str optional=False
> -    member dict2: UserDefTwoDictDict optional=False
> -    member dict3: UserDefTwoDictDict optional=True
> -object UserDefTwoDictDict
> -    member userdef: UserDefOne optional=False
> +object EventStructOne
> +    member struct1: UserDefOne optional=False
>      member string: str optional=False
> -object UserDefUnionBase
> -    base UserDefZero
> -    member string: str optional=False
> -    member enum1: EnumOne optional=False
> -object UserDefZero
> -    member integer: int optional=False
> -object WrapAlternate
> -    member alt: UserDefAlternate optional=False
> -event __ORG.QEMU_X-EVENT __org.qemu_x-Struct
> +    member enum2: EnumOne optional=True
> +event EVENT_A None
> +   boxed=False
> +event EVENT_B None
> +   boxed=False
> +object q_obj_EVENT_C-arg
> +    member a: int optional=True
> +    member b: UserDefOne optional=True
> +    member c: str optional=False
> +event EVENT_C q_obj_EVENT_C-arg
> +   boxed=False
> +object q_obj_EVENT_D-arg
> +    member a: EventStructOne optional=False
> +    member b: str optional=False
> +    member c: str optional=True
> +    member enum3: EnumOne optional=True
> +event EVENT_D q_obj_EVENT_D-arg
>     boxed=False
> -alternate __org.qemu_x-Alt
> -    tag type
> -    case __org.qemu_x-branch: str
> -    case b: __org.qemu_x-Base
> +event EVENT_E UserDefZero
> +   boxed=True
> +event EVENT_F UserDefAlternate
> +   boxed=True
> +enum __org.qemu_x-Enum ['__org.qemu_x-value']
>  object __org.qemu_x-Base
>      member __org.qemu_x-member1: __org.qemu_x-Enum optional=False
> -enum __org.qemu_x-Enum ['__org.qemu_x-value']
>  object __org.qemu_x-Struct
>      base __org.qemu_x-Base
>      member __org.qemu_x-member2: str optional=False
>      member wchar-t: int optional=True
> -object __org.qemu_x-Struct2
> -    member array: __org.qemu_x-Union1List optional=False
> +object q_obj_str-wrapper
> +    member data: str optional=False
> +enum __org.qemu_x-Union1Kind ['__org.qemu_x-branch']
>  object __org.qemu_x-Union1
>      member type: __org.qemu_x-Union1Kind optional=False
>      tag type
>      case __org.qemu_x-branch: q_obj_str-wrapper
> -enum __org.qemu_x-Union1Kind ['__org.qemu_x-branch']
> +object __org.qemu_x-Struct2
> +    member array: __org.qemu_x-Union1List optional=False
>  object __org.qemu_x-Union2
>      base __org.qemu_x-Base
>      tag __org.qemu_x-member1
>      case __org.qemu_x-value: __org.qemu_x-Struct2
> -command __org.qemu_x-command q_obj___org.qemu_x-command-arg -> __org.qemu_x-Union1
> -   gen=True success_response=True boxed=False
> -command boxed-struct UserDefZero -> None
> -   gen=True success_response=True boxed=True
> -command boxed-union UserDefNativeListUnion -> None
> -   gen=True success_response=True boxed=True
> -command guest-get-time q_obj_guest-get-time-arg -> int
> -   gen=True success_response=True boxed=False
> -command guest-sync q_obj_guest-sync-arg -> any
> -   gen=True success_response=True boxed=False
> -object q_empty
> -object q_obj_EVENT_C-arg
> -    member a: int optional=True
> -    member b: UserDefOne optional=True
> -    member c: str optional=False
> -object q_obj_EVENT_D-arg
> -    member a: EventStructOne optional=False
> -    member b: str optional=False
> -    member c: str optional=True
> -    member enum3: EnumOne optional=True
> -object q_obj_UserDefFlatUnion2-base
> -    member integer: int optional=True
> -    member string: str optional=False
> -    member enum1: QEnumTwo optional=False
> +alternate __org.qemu_x-Alt
> +    tag type
> +    case __org.qemu_x-branch: str
> +    case b: __org.qemu_x-Base
> +event __ORG.QEMU_X-EVENT __org.qemu_x-Struct
> +   boxed=False
>  object q_obj___org.qemu_x-command-arg
>      member a: __org.qemu_x-EnumList optional=False
>      member b: __org.qemu_x-StructList optional=False
>      member c: __org.qemu_x-Union2 optional=False
>      member d: __org.qemu_x-Alt optional=False
> -object q_obj_anyList-wrapper
> -    member data: anyList optional=False
> -object q_obj_boolList-wrapper
> -    member data: boolList optional=False
> -object q_obj_guest-get-time-arg
> -    member a: int optional=False
> -    member b: int optional=True
> -object q_obj_guest-sync-arg
> -    member arg: any optional=False
> -object q_obj_int16List-wrapper
> -    member data: int16List optional=False
> -object q_obj_int32List-wrapper
> -    member data: int32List optional=False
> -object q_obj_int64List-wrapper
> -    member data: int64List optional=False
> -object q_obj_int8List-wrapper
> -    member data: int8List optional=False
> -object q_obj_intList-wrapper
> -    member data: intList optional=False
> -object q_obj_numberList-wrapper
> -    member data: numberList optional=False
> -object q_obj_sizeList-wrapper
> -    member data: sizeList optional=False
> -object q_obj_str-wrapper
> -    member data: str optional=False
> -object q_obj_strList-wrapper
> -    member data: strList optional=False
> -object q_obj_uint16List-wrapper
> -    member data: uint16List optional=False
> -object q_obj_uint32List-wrapper
> -    member data: uint32List optional=False
> -object q_obj_uint64List-wrapper
> -    member data: uint64List optional=False
> -object q_obj_uint8List-wrapper
> -    member data: uint8List optional=False
> -object q_obj_user_def_cmd1-arg
> -    member ud1a: UserDefOne optional=False
> -object q_obj_user_def_cmd2-arg
> -    member ud1a: UserDefOne optional=False
> -    member ud1b: UserDefOne optional=True
> -command user_def_cmd None -> None
> -   gen=True success_response=True boxed=False
> -command user_def_cmd0 Empty2 -> Empty2
> -   gen=True success_response=True boxed=False
> -command user_def_cmd1 q_obj_user_def_cmd1-arg -> None
> -   gen=True success_response=True boxed=False
> -command user_def_cmd2 q_obj_user_def_cmd2-arg -> UserDefTwo
> +command __org.qemu_x-command q_obj___org.qemu_x-command-arg -> __org.qemu_x-Union1
>     gen=True success_response=True boxed=False
> --
> 2.13.6
>

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 15/21] qapi: Record 'include' directives in intermediate representation
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 15/21] qapi: Record 'include' directives in intermediate representation Markus Armbruster
@ 2018-02-05 13:45   ` Marc-Andre Lureau
  0 siblings, 0 replies; 87+ messages in thread
From: Marc-Andre Lureau @ 2018-02-05 13:45 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: qemu-devel, marcandre, Blake, Eric, mdroth

On Fri, Feb 2, 2018 at 2:03 PM, Markus Armbruster <armbru@redhat.com> wrote:
> The include directive permits modular QAPI schemata, but the generated
> code is monolithic all the same.  To permit generating modular code,
> the front end needs to pass more information on inclusions to the back
> ends.  The commit before last added the necessary information to the
> parse tree.  This commit adds it to the intermediate representation
> and its QAPISchemaVisitor.  A later commit will use this to to
> generate modular code.
>
> New entity QAPISchemaInclude represents inclusions.  Call new visitor
> method visit_include() for it, so visitors can see the sub-modules a
> module includes.
>
> New QAPISchemaEntity attribute @module names the entity's source file.
> Call new visitor method visit_module() when it changes during a visit,
> so visitors can keep track of the module being visited.
>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>


> ---
>  scripts/qapi/common.py                   | 44 ++++++++++++++++++++++++++++----
>  tests/qapi-schema/comments.out           |  1 +
>  tests/qapi-schema/doc-bad-section.out    |  1 +
>  tests/qapi-schema/doc-good.out           |  1 +
>  tests/qapi-schema/event-case.out         |  1 +
>  tests/qapi-schema/ident-with-escape.out  |  1 +
>  tests/qapi-schema/include-relpath.out    |  5 ++++
>  tests/qapi-schema/include-repetition.out | 10 ++++++++
>  tests/qapi-schema/include-simple.out     |  3 +++
>  tests/qapi-schema/indented-expr.out      |  1 +
>  tests/qapi-schema/qapi-schema-test.out   |  1 +
>  tests/qapi-schema/test-qapi.py           |  7 +++++
>  12 files changed, 71 insertions(+), 5 deletions(-)
>
> diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py
> index 3b97bf8702..f4e9ebbb53 100644
> --- a/scripts/qapi/common.py
> +++ b/scripts/qapi/common.py
> @@ -981,8 +981,9 @@ def check_exprs(exprs):
>
>  class QAPISchemaEntity(object):
>      def __init__(self, name, info, doc):
> -        assert isinstance(name, str)
> +        assert name is None or isinstance(name, str)
>          self.name = name
> +        self.module = None
>          # For explicitly defined entities, info points to the (explicit)
>          # definition.  For builtins (and their arrays), info is None.
>          # For implicitly defined entities, info points to a place that
> @@ -1011,10 +1012,16 @@ class QAPISchemaVisitor(object):
>      def visit_end(self):
>          pass
>
> +    def visit_module(self, fname):
> +        pass
> +
>      def visit_needed(self, entity):
>          # Default to visiting everything
>          return True
>
> +    def visit_include(self, fname, info):
> +        pass
> +
>      def visit_builtin_type(self, name, info, json_type):
>          pass
>
> @@ -1041,6 +1048,16 @@ class QAPISchemaVisitor(object):
>          pass
>
>
> +class QAPISchemaInclude(QAPISchemaEntity):
> +
> +    def __init__(self, fname, info):
> +        QAPISchemaEntity.__init__(self, None, info, None)
> +        self.fname = fname
> +
> +    def visit(self, visitor):
> +        visitor.visit_include(self.fname, self.info)
> +
> +
>  class QAPISchemaType(QAPISchemaEntity):
>      # Return the C type for common use.
>      # For the types we commonly box, this is a pointer type.
> @@ -1468,6 +1485,7 @@ class QAPISchemaEvent(QAPISchemaEntity):
>
>  class QAPISchema(object):
>      def __init__(self, fname):
> +        self._fname = fname
>          parser = QAPISchemaParser(open(fname, 'r'))
>          exprs = check_exprs(parser.exprs)
>          self.docs = parser.docs
> @@ -1475,16 +1493,19 @@ class QAPISchema(object):
>          self._entity_dict = {}
>          self._predefining = True
>          self._def_predefineds()
> -        self._predefining = False
>          self._def_exprs(exprs)
>          self.check()
>
>      def _def_entity(self, ent):
>          # Only the predefined types are allowed to not have info
>          assert ent.info or self._predefining
> -        assert ent.name not in self._entity_dict
> +        assert ent.name is None or ent.name not in self._entity_dict
>          self._entity_list.append(ent)
> -        self._entity_dict[ent.name] = ent
> +        if ent.name is not None:
> +            self._entity_dict[ent.name] = ent
> +        if ent.info:
> +            ent.module = os.path.relpath(ent.info['file'],
> +                                         os.path.dirname(self._fname))
>
>      def lookup_entity(self, name, typ=None):
>          ent = self._entity_dict.get(name)
> @@ -1495,6 +1516,15 @@ class QAPISchema(object):
>      def lookup_type(self, name):
>          return self.lookup_entity(name, QAPISchemaType)
>
> +    def _def_include(self, expr, info, doc):
> +        include = expr['include']
> +        assert doc is None
> +        main_info = info
> +        while main_info['parent']:
> +            main_info = main_info['parent']
> +        fname = os.path.relpath(include, os.path.dirname(main_info['file']))
> +        self._def_entity(QAPISchemaInclude(fname, info))
> +
>      def _def_builtin_type(self, name, json_type, c_type):
>          self._def_entity(QAPISchemaBuiltinType(name, json_type, c_type))
>          # TODO As long as we have QAPI_TYPES_BUILTIN to share multiple
> @@ -1677,7 +1707,7 @@ class QAPISchema(object):
>              elif 'event' in expr:
>                  self._def_event(expr, info, doc)
>              elif 'include' in expr:
> -                pass
> +                self._def_include(expr, info, doc)
>              else:
>                  assert False
>
> @@ -1687,8 +1717,12 @@ class QAPISchema(object):
>
>      def visit(self, visitor):
>          visitor.visit_begin(self)
> +        module = None
>          for entity in self._entity_list:
>              if visitor.visit_needed(entity):
> +                if entity.module != module:
> +                    module = entity.module
> +                    visitor.visit_module(module)
>                  entity.visit(visitor)
>          visitor.visit_end()
>
> diff --git a/tests/qapi-schema/comments.out b/tests/qapi-schema/comments.out
> index 0261ddf202..8d2f1ce8a2 100644
> --- a/tests/qapi-schema/comments.out
> +++ b/tests/qapi-schema/comments.out
> @@ -1,4 +1,5 @@
>  object q_empty
>  enum QType ['none', 'qnull', 'qnum', 'qstring', 'qdict', 'qlist', 'qbool']
>      prefix QTYPE
> +module comments.json
>  enum Status ['good', 'bad', 'ugly']
> diff --git a/tests/qapi-schema/doc-bad-section.out b/tests/qapi-schema/doc-bad-section.out
> index 23bf8c71ab..cd28721568 100644
> --- a/tests/qapi-schema/doc-bad-section.out
> +++ b/tests/qapi-schema/doc-bad-section.out
> @@ -1,6 +1,7 @@
>  object q_empty
>  enum QType ['none', 'qnull', 'qnum', 'qstring', 'qdict', 'qlist', 'qbool']
>      prefix QTYPE
> +module doc-bad-section.json
>  enum Enum ['one', 'two']
>  doc symbol=Enum
>      body=
> diff --git a/tests/qapi-schema/doc-good.out b/tests/qapi-schema/doc-good.out
> index 0c07301f07..430b5a87db 100644
> --- a/tests/qapi-schema/doc-good.out
> +++ b/tests/qapi-schema/doc-good.out
> @@ -1,6 +1,7 @@
>  object q_empty
>  enum QType ['none', 'qnull', 'qnum', 'qstring', 'qdict', 'qlist', 'qbool']
>      prefix QTYPE
> +module doc-good.json
>  enum Enum ['one', 'two']
>  object Base
>      member base1: Enum optional=False
> diff --git a/tests/qapi-schema/event-case.out b/tests/qapi-schema/event-case.out
> index 110571b793..88c0964917 100644
> --- a/tests/qapi-schema/event-case.out
> +++ b/tests/qapi-schema/event-case.out
> @@ -1,5 +1,6 @@
>  object q_empty
>  enum QType ['none', 'qnull', 'qnum', 'qstring', 'qdict', 'qlist', 'qbool']
>      prefix QTYPE
> +module event-case.json
>  event oops None
>     boxed=False
> diff --git a/tests/qapi-schema/ident-with-escape.out b/tests/qapi-schema/ident-with-escape.out
> index 8336aa7629..ee3b34e623 100644
> --- a/tests/qapi-schema/ident-with-escape.out
> +++ b/tests/qapi-schema/ident-with-escape.out
> @@ -1,6 +1,7 @@
>  object q_empty
>  enum QType ['none', 'qnull', 'qnum', 'qstring', 'qdict', 'qlist', 'qbool']
>      prefix QTYPE
> +module ident-with-escape.json
>  object q_obj_fooA-arg
>      member bar1: str optional=False
>  command fooA q_obj_fooA-arg -> None
> diff --git a/tests/qapi-schema/include-relpath.out b/tests/qapi-schema/include-relpath.out
> index 0261ddf202..ebbabd7a18 100644
> --- a/tests/qapi-schema/include-relpath.out
> +++ b/tests/qapi-schema/include-relpath.out
> @@ -1,4 +1,9 @@
>  object q_empty
>  enum QType ['none', 'qnull', 'qnum', 'qstring', 'qdict', 'qlist', 'qbool']
>      prefix QTYPE
> +module include-relpath.json
> +include include/relpath.json
> +module include/relpath.json
> +include include-relpath-sub.json
> +module include-relpath-sub.json
>  enum Status ['good', 'bad', 'ugly']
> diff --git a/tests/qapi-schema/include-repetition.out b/tests/qapi-schema/include-repetition.out
> index 0261ddf202..7235e055bc 100644
> --- a/tests/qapi-schema/include-repetition.out
> +++ b/tests/qapi-schema/include-repetition.out
> @@ -1,4 +1,14 @@
>  object q_empty
>  enum QType ['none', 'qnull', 'qnum', 'qstring', 'qdict', 'qlist', 'qbool']
>      prefix QTYPE
> +module include-repetition.json
> +include comments.json
> +module comments.json
>  enum Status ['good', 'bad', 'ugly']
> +module include-repetition.json
> +include include-repetition-sub.json
> +module include-repetition-sub.json
> +include comments.json
> +include comments.json
> +module include-repetition.json
> +include comments.json
> diff --git a/tests/qapi-schema/include-simple.out b/tests/qapi-schema/include-simple.out
> index 0261ddf202..006f723eeb 100644
> --- a/tests/qapi-schema/include-simple.out
> +++ b/tests/qapi-schema/include-simple.out
> @@ -1,4 +1,7 @@
>  object q_empty
>  enum QType ['none', 'qnull', 'qnum', 'qstring', 'qdict', 'qlist', 'qbool']
>      prefix QTYPE
> +module include-simple.json
> +include include-simple-sub.json
> +module include-simple-sub.json
>  enum Status ['good', 'bad', 'ugly']
> diff --git a/tests/qapi-schema/indented-expr.out b/tests/qapi-schema/indented-expr.out
> index 34de8be426..a79935e8c3 100644
> --- a/tests/qapi-schema/indented-expr.out
> +++ b/tests/qapi-schema/indented-expr.out
> @@ -1,6 +1,7 @@
>  object q_empty
>  enum QType ['none', 'qnull', 'qnum', 'qstring', 'qdict', 'qlist', 'qbool']
>      prefix QTYPE
> +module indented-expr.json
>  command eins None -> None
>     gen=True success_response=True boxed=False
>  command zwei None -> None
> diff --git a/tests/qapi-schema/qapi-schema-test.out b/tests/qapi-schema/qapi-schema-test.out
> index 50706b0136..012e7fc06a 100644
> --- a/tests/qapi-schema/qapi-schema-test.out
> +++ b/tests/qapi-schema/qapi-schema-test.out
> @@ -1,6 +1,7 @@
>  object q_empty
>  enum QType ['none', 'qnull', 'qnum', 'qstring', 'qdict', 'qlist', 'qbool']
>      prefix QTYPE
> +module qapi-schema-test.json
>  object TestStruct
>      member integer: int optional=False
>      member boolean: bool optional=False
> diff --git a/tests/qapi-schema/test-qapi.py b/tests/qapi-schema/test-qapi.py
> index d6bb8ec6a4..2027eef3e5 100644
> --- a/tests/qapi-schema/test-qapi.py
> +++ b/tests/qapi-schema/test-qapi.py
> @@ -17,6 +17,13 @@ import sys
>
>
>  class QAPISchemaTestVisitor(QAPISchemaVisitor):
> +
> +    def visit_module(self, name):
> +        print 'module %s' % name
> +
> +    def visit_include(self, name, info):
> +        print 'include %s' % name
> +
>      def visit_enum_type(self, name, info, values, prefix):
>          print 'enum %s %s' % (name, values)
>          if prefix:
> --
> 2.13.6
>

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 21/21] qapi: Empty out qapi-schema.json
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 21/21] qapi: Empty out qapi-schema.json Markus Armbruster
@ 2018-02-05 13:45   ` Marc-Andre Lureau
  0 siblings, 0 replies; 87+ messages in thread
From: Marc-Andre Lureau @ 2018-02-05 13:45 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: qemu-devel, marcandre, Blake, Eric, mdroth

On Fri, Feb 2, 2018 at 2:03 PM, Markus Armbruster <armbru@redhat.com> wrote:
> Types defined directly in qapi-schema.json end up in qapi-types.h, and
> including that pulls in everything else.
>
> Move everything but include directives from qapi-schema.json to new
> sub-module qapi/misc.json, and replace the remaining includes of
> qapi-types.h.
>
> Adding a type to qapi/migration.json now recompiles less than 200
> instead of 2300 out of 4500 objects.
>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>


> ---
>  Makefile                     |    2 +
>  Makefile.objs                |    1 +
>  include/hw/qdev-properties.h |    3 +-
>  include/monitor/monitor.h    |    2 +-
>  include/sysemu/arch_init.h   |    2 +-
>  include/sysemu/balloon.h     |    2 +-
>  include/sysemu/dump.h        |    2 +-
>  include/sysemu/hostmem.h     |    2 +-
>  include/sysemu/replay.h      |    3 +-
>  qapi-schema.json             | 3098 +-----------------------------------------
>  qapi/misc.json               | 3090 +++++++++++++++++++++++++++++++++++++++++
>  qapi/run-state.json          |   10 +
>  12 files changed, 3113 insertions(+), 3104 deletions(-)
>  create mode 100644 qapi/misc.json
>
> diff --git a/Makefile b/Makefile
> index f1b68dca9b..0cf2a9caba 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -98,6 +98,7 @@ GENERATED_FILES += qapi/qapi-types-common.h qapi/qapi-types-common.c
>  GENERATED_FILES += qapi/qapi-types-crypto.h qapi/qapi-types-crypto.c
>  GENERATED_FILES += qapi/qapi-types-introspect.h qapi/qapi-types-introspect.c
>  GENERATED_FILES += qapi/qapi-types-migration.h qapi/qapi-types-migration.c
> +GENERATED_FILES += qapi/qapi-types-misc.h qapi/qapi-types-misc.c
>  GENERATED_FILES += qapi/qapi-types-net.h qapi/qapi-types-net.c
>  GENERATED_FILES += qapi/qapi-types-rocker.h qapi/qapi-types-rocker.c
>  GENERATED_FILES += qapi/qapi-types-run-state.h qapi/qapi-types-run-state.c
> @@ -541,6 +542,7 @@ qapi/qapi-types-common.c qapi/qapi-types-common.h \
>  qapi/qapi-types-crypto.c qapi/qapi-types-crypto.h \
>  qapi/qapi-types-introspect.c qapi/qapi-types-introspect.h \
>  qapi/qapi-types-migration.c qapi/qapi-types-migration.h \
> +qapi/qapi-types-misc.c qapi/qapi-types-misc.h \
>  qapi/qapi-types-net.c qapi/qapi-types-net.h \
>  qapi/qapi-types-rocker.c qapi/qapi-types-rocker.h \
>  qapi/qapi-types-run-state.c qapi/qapi-types-run-state.h \
> diff --git a/Makefile.objs b/Makefile.objs
> index e7411a2658..efef7f095b 100644
> --- a/Makefile.objs
> +++ b/Makefile.objs
> @@ -11,6 +11,7 @@ util-obj-y += qapi/qapi-types-common.o
>  util-obj-y += qapi/qapi-types-crypto.o
>  util-obj-y += qapi/qapi-types-introspect.o
>  util-obj-y += qapi/qapi-types-migration.o
> +util-obj-y += qapi/qapi-types-misc.o
>  util-obj-y += qapi/qapi-types-net.o
>  util-obj-y += qapi/qapi-types-rocker.o
>  util-obj-y += qapi/qapi-types-run-state.o
> diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h
> index c5d1b1bd63..2f6bd7d73d 100644
> --- a/include/hw/qdev-properties.h
> +++ b/include/hw/qdev-properties.h
> @@ -1,7 +1,8 @@
>  #ifndef QEMU_QDEV_PROPERTIES_H
>  #define QEMU_QDEV_PROPERTIES_H
>
> -#include "qapi-types.h"
> +#include "qapi/qapi-types-block.h"
> +#include "qapi/qapi-types-misc.h"
>  #include "hw/qdev-core.h"
>
>  /*** qdev-properties.c ***/
> diff --git a/include/monitor/monitor.h b/include/monitor/monitor.h
> index 50f7cea057..d1024d4bdc 100644
> --- a/include/monitor/monitor.h
> +++ b/include/monitor/monitor.h
> @@ -3,7 +3,7 @@
>
>  #include "qemu-common.h"
>  #include "block/block.h"
> -#include "qapi-types.h"
> +#include "qapi/qapi-types-misc.h"
>  #include "qemu/readline.h"
>
>  extern Monitor *cur_mon;
> diff --git a/include/sysemu/arch_init.h b/include/sysemu/arch_init.h
> index ced67c7842..979fd022d0 100644
> --- a/include/sysemu/arch_init.h
> +++ b/include/sysemu/arch_init.h
> @@ -1,7 +1,7 @@
>  #ifndef QEMU_ARCH_INIT_H
>  #define QEMU_ARCH_INIT_H
>
> -#include "qapi-types.h"
> +#include "qapi/qapi-types-misc.h"
>
>  enum {
>      QEMU_ARCH_ALL = -1,
> diff --git a/include/sysemu/balloon.h b/include/sysemu/balloon.h
> index af49e19c78..66543ae8f4 100644
> --- a/include/sysemu/balloon.h
> +++ b/include/sysemu/balloon.h
> @@ -14,7 +14,7 @@
>  #ifndef QEMU_BALLOON_H
>  #define QEMU_BALLOON_H
>
> -#include "qapi-types.h"
> +#include "qapi/qapi-types-misc.h"
>
>  typedef void (QEMUBalloonEvent)(void *opaque, ram_addr_t target);
>  typedef void (QEMUBalloonStatus)(void *opaque, BalloonInfo *info);
> diff --git a/include/sysemu/dump.h b/include/sysemu/dump.h
> index 2424e31425..d824bc0941 100644
> --- a/include/sysemu/dump.h
> +++ b/include/sysemu/dump.h
> @@ -14,7 +14,7 @@
>  #ifndef DUMP_H
>  #define DUMP_H
>
> -#include "qapi-types.h"
> +#include "qapi/qapi-types-misc.h"
>
>  #define MAKEDUMPFILE_SIGNATURE      "makedumpfile"
>  #define MAX_SIZE_MDF_HEADER         (4096) /* max size of makedumpfile_header */
> diff --git a/include/sysemu/hostmem.h b/include/sysemu/hostmem.h
> index 6424f96df9..dc3ac3d301 100644
> --- a/include/sysemu/hostmem.h
> +++ b/include/sysemu/hostmem.h
> @@ -14,7 +14,7 @@
>  #define SYSEMU_HOSTMEM_H
>
>  #include "sysemu/sysemu.h" /* for MAX_NODES */
> -#include "qapi-types.h"
> +#include "qapi/qapi-types-misc.h"
>  #include "qom/object.h"
>  #include "exec/memory.h"
>  #include "qemu/bitmap.h"
> diff --git a/include/sysemu/replay.h b/include/sysemu/replay.h
> index fb533ed9b6..c0204e641c 100644
> --- a/include/sysemu/replay.h
> +++ b/include/sysemu/replay.h
> @@ -13,7 +13,8 @@
>   */
>
>  #include "sysemu.h"
> -#include "qapi-types.h"
> +#include "qapi/qapi-types-misc.h"
> +#include "qapi/qapi-types-ui.h"
>
>  /* replay clock kinds */
>  enum ReplayClockKind {
> diff --git a/qapi-schema.json b/qapi-schema.json
> index 5c06745c79..541e0c3fcb 100644
> --- a/qapi-schema.json
> +++ b/qapi-schema.json
> @@ -92,3100 +92,4 @@
>  { 'include': 'qapi/transaction.json' }
>  { 'include': 'qapi/trace.json' }
>  { 'include': 'qapi/introspect.json' }
> -
> -##
> -# = Miscellanea
> -##
> -
> -##
> -# @qmp_capabilities:
> -#
> -# Enable QMP capabilities.
> -#
> -# Arguments: None.
> -#
> -# Example:
> -#
> -# -> { "execute": "qmp_capabilities" }
> -# <- { "return": {} }
> -#
> -# Notes: This command is valid exactly when first connecting: it must be
> -# issued before any other command will be accepted, and will fail once the
> -# monitor is accepting other commands. (see qemu docs/interop/qmp-spec.txt)
> -#
> -# Since: 0.13
> -#
> -##
> -{ 'command': 'qmp_capabilities' }
> -
> -##
> -# @VersionTriple:
> -#
> -# A three-part version number.
> -#
> -# @major:  The major version number.
> -#
> -# @minor:  The minor version number.
> -#
> -# @micro:  The micro version number.
> -#
> -# Since: 2.4
> -##
> -{ 'struct': 'VersionTriple',
> -  'data': {'major': 'int', 'minor': 'int', 'micro': 'int'} }
> -
> -
> -##
> -# @VersionInfo:
> -#
> -# A description of QEMU's version.
> -#
> -# @qemu:        The version of QEMU.  By current convention, a micro
> -#               version of 50 signifies a development branch.  A micro version
> -#               greater than or equal to 90 signifies a release candidate for
> -#               the next minor version.  A micro version of less than 50
> -#               signifies a stable release.
> -#
> -# @package:     QEMU will always set this field to an empty string.  Downstream
> -#               versions of QEMU should set this to a non-empty string.  The
> -#               exact format depends on the downstream however it highly
> -#               recommended that a unique name is used.
> -#
> -# Since: 0.14.0
> -##
> -{ 'struct': 'VersionInfo',
> -  'data': {'qemu': 'VersionTriple', 'package': 'str'} }
> -
> -##
> -# @query-version:
> -#
> -# Returns the current version of QEMU.
> -#
> -# Returns:  A @VersionInfo object describing the current version of QEMU.
> -#
> -# Since: 0.14.0
> -#
> -# Example:
> -#
> -# -> { "execute": "query-version" }
> -# <- {
> -#       "return":{
> -#          "qemu":{
> -#             "major":0,
> -#             "minor":11,
> -#             "micro":5
> -#          },
> -#          "package":""
> -#       }
> -#    }
> -#
> -##
> -{ 'command': 'query-version', 'returns': 'VersionInfo' }
> -
> -##
> -# @CommandInfo:
> -#
> -# Information about a QMP command
> -#
> -# @name: The command name
> -#
> -# Since: 0.14.0
> -##
> -{ 'struct': 'CommandInfo', 'data': {'name': 'str'} }
> -
> -##
> -# @query-commands:
> -#
> -# Return a list of supported QMP commands by this server
> -#
> -# Returns: A list of @CommandInfo for all supported commands
> -#
> -# Since: 0.14.0
> -#
> -# Example:
> -#
> -# -> { "execute": "query-commands" }
> -# <- {
> -#      "return":[
> -#         {
> -#            "name":"query-balloon"
> -#         },
> -#         {
> -#            "name":"system_powerdown"
> -#         }
> -#      ]
> -#    }
> -#
> -# Note: This example has been shortened as the real response is too long.
> -#
> -##
> -{ 'command': 'query-commands', 'returns': ['CommandInfo'] }
> -
> -##
> -# @LostTickPolicy:
> -#
> -# Policy for handling lost ticks in timer devices.
> -#
> -# @discard: throw away the missed tick(s) and continue with future injection
> -#           normally.  Guest time may be delayed, unless the OS has explicit
> -#           handling of lost ticks
> -#
> -# @delay: continue to deliver ticks at the normal rate.  Guest time will be
> -#         delayed due to the late tick
> -#
> -# @merge: merge the missed tick(s) into one tick and inject.  Guest time
> -#         may be delayed, depending on how the OS reacts to the merging
> -#         of ticks
> -#
> -# @slew: deliver ticks at a higher rate to catch up with the missed tick. The
> -#        guest time should not be delayed once catchup is complete.
> -#
> -# Since: 2.0
> -##
> -{ 'enum': 'LostTickPolicy',
> -  'data': ['discard', 'delay', 'merge', 'slew' ] }
> -
> -##
> -# @add_client:
> -#
> -# Allow client connections for VNC, Spice and socket based
> -# character devices to be passed in to QEMU via SCM_RIGHTS.
> -#
> -# @protocol: protocol name. Valid names are "vnc", "spice" or the
> -#            name of a character device (eg. from -chardev id=XXXX)
> -#
> -# @fdname: file descriptor name previously passed via 'getfd' command
> -#
> -# @skipauth: whether to skip authentication. Only applies
> -#            to "vnc" and "spice" protocols
> -#
> -# @tls: whether to perform TLS. Only applies to the "spice"
> -#       protocol
> -#
> -# Returns: nothing on success.
> -#
> -# Since: 0.14.0
> -#
> -# Example:
> -#
> -# -> { "execute": "add_client", "arguments": { "protocol": "vnc",
> -#                                              "fdname": "myclient" } }
> -# <- { "return": {} }
> -#
> -##
> -{ 'command': 'add_client',
> -  'data': { 'protocol': 'str', 'fdname': 'str', '*skipauth': 'bool',
> -            '*tls': 'bool' } }
> -
> -##
> -# @NameInfo:
> -#
> -# Guest name information.
> -#
> -# @name: The name of the guest
> -#
> -# Since: 0.14.0
> -##
> -{ 'struct': 'NameInfo', 'data': {'*name': 'str'} }
> -
> -##
> -# @query-name:
> -#
> -# Return the name information of a guest.
> -#
> -# Returns: @NameInfo of the guest
> -#
> -# Since: 0.14.0
> -#
> -# Example:
> -#
> -# -> { "execute": "query-name" }
> -# <- { "return": { "name": "qemu-name" } }
> -#
> -##
> -{ 'command': 'query-name', 'returns': 'NameInfo' }
> -
> -##
> -# @KvmInfo:
> -#
> -# Information about support for KVM acceleration
> -#
> -# @enabled: true if KVM acceleration is active
> -#
> -# @present: true if KVM acceleration is built into this executable
> -#
> -# Since: 0.14.0
> -##
> -{ 'struct': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool'} }
> -
> -##
> -# @query-kvm:
> -#
> -# Returns information about KVM acceleration
> -#
> -# Returns: @KvmInfo
> -#
> -# Since: 0.14.0
> -#
> -# Example:
> -#
> -# -> { "execute": "query-kvm" }
> -# <- { "return": { "enabled": true, "present": true } }
> -#
> -##
> -{ 'command': 'query-kvm', 'returns': 'KvmInfo' }
> -
> -##
> -# @UuidInfo:
> -#
> -# Guest UUID information (Universally Unique Identifier).
> -#
> -# @UUID: the UUID of the guest
> -#
> -# Since: 0.14.0
> -#
> -# Notes: If no UUID was specified for the guest, a null UUID is returned.
> -##
> -{ 'struct': 'UuidInfo', 'data': {'UUID': 'str'} }
> -
> -##
> -# @query-uuid:
> -#
> -# Query the guest UUID information.
> -#
> -# Returns: The @UuidInfo for the guest
> -#
> -# Since: 0.14.0
> -#
> -# Example:
> -#
> -# -> { "execute": "query-uuid" }
> -# <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
> -#
> -##
> -{ 'command': 'query-uuid', 'returns': 'UuidInfo' }
> -
> -##
> -# @EventInfo:
> -#
> -# Information about a QMP event
> -#
> -# @name: The event name
> -#
> -# Since: 1.2.0
> -##
> -{ 'struct': 'EventInfo', 'data': {'name': 'str'} }
> -
> -##
> -# @query-events:
> -#
> -# Return a list of supported QMP events by this server
> -#
> -# Returns: A list of @EventInfo for all supported events
> -#
> -# Since: 1.2.0
> -#
> -# Example:
> -#
> -# -> { "execute": "query-events" }
> -# <- {
> -#      "return": [
> -#          {
> -#             "name":"SHUTDOWN"
> -#          },
> -#          {
> -#             "name":"RESET"
> -#          }
> -#       ]
> -#    }
> -#
> -# Note: This example has been shortened as the real response is too long.
> -#
> -##
> -{ 'command': 'query-events', 'returns': ['EventInfo'] }
> -
> -##
> -# @CpuInfoArch:
> -#
> -# An enumeration of cpu types that enable additional information during
> -# @query-cpus.
> -#
> -# Since: 2.6
> -##
> -{ 'enum': 'CpuInfoArch',
> -  'data': ['x86', 'sparc', 'ppc', 'mips', 'tricore', 'other' ] }
> -
> -##
> -# @CpuInfo:
> -#
> -# Information about a virtual CPU
> -#
> -# @CPU: the index of the virtual CPU
> -#
> -# @current: this only exists for backwards compatibility and should be ignored
> -#
> -# @halted: true if the virtual CPU is in the halt state.  Halt usually refers
> -#          to a processor specific low power mode.
> -#
> -# @qom_path: path to the CPU object in the QOM tree (since 2.4)
> -#
> -# @thread_id: ID of the underlying host thread
> -#
> -# @props: properties describing to which node/socket/core/thread
> -#         virtual CPU belongs to, provided if supported by board (since 2.10)
> -#
> -# @arch: architecture of the cpu, which determines which additional fields
> -#        will be listed (since 2.6)
> -#
> -# Since: 0.14.0
> -#
> -# Notes: @halted is a transient state that changes frequently.  By the time the
> -#        data is sent to the client, the guest may no longer be halted.
> -##
> -{ 'union': 'CpuInfo',
> -  'base': {'CPU': 'int', 'current': 'bool', 'halted': 'bool',
> -           'qom_path': 'str', 'thread_id': 'int',
> -           '*props': 'CpuInstanceProperties', 'arch': 'CpuInfoArch' },
> -  'discriminator': 'arch',
> -  'data': { 'x86': 'CpuInfoX86',
> -            'sparc': 'CpuInfoSPARC',
> -            'ppc': 'CpuInfoPPC',
> -            'mips': 'CpuInfoMIPS',
> -            'tricore': 'CpuInfoTricore',
> -            'other': 'CpuInfoOther' } }
> -
> -##
> -# @CpuInfoX86:
> -#
> -# Additional information about a virtual i386 or x86_64 CPU
> -#
> -# @pc: the 64-bit instruction pointer
> -#
> -# Since: 2.6
> -##
> -{ 'struct': 'CpuInfoX86', 'data': { 'pc': 'int' } }
> -
> -##
> -# @CpuInfoSPARC:
> -#
> -# Additional information about a virtual SPARC CPU
> -#
> -# @pc: the PC component of the instruction pointer
> -#
> -# @npc: the NPC component of the instruction pointer
> -#
> -# Since: 2.6
> -##
> -{ 'struct': 'CpuInfoSPARC', 'data': { 'pc': 'int', 'npc': 'int' } }
> -
> -##
> -# @CpuInfoPPC:
> -#
> -# Additional information about a virtual PPC CPU
> -#
> -# @nip: the instruction pointer
> -#
> -# Since: 2.6
> -##
> -{ 'struct': 'CpuInfoPPC', 'data': { 'nip': 'int' } }
> -
> -##
> -# @CpuInfoMIPS:
> -#
> -# Additional information about a virtual MIPS CPU
> -#
> -# @PC: the instruction pointer
> -#
> -# Since: 2.6
> -##
> -{ 'struct': 'CpuInfoMIPS', 'data': { 'PC': 'int' } }
> -
> -##
> -# @CpuInfoTricore:
> -#
> -# Additional information about a virtual Tricore CPU
> -#
> -# @PC: the instruction pointer
> -#
> -# Since: 2.6
> -##
> -{ 'struct': 'CpuInfoTricore', 'data': { 'PC': 'int' } }
> -
> -##
> -# @CpuInfoOther:
> -#
> -# No additional information is available about the virtual CPU
> -#
> -# Since: 2.6
> -#
> -##
> -{ 'struct': 'CpuInfoOther', 'data': { } }
> -
> -##
> -# @query-cpus:
> -#
> -# Returns a list of information about each virtual CPU.
> -#
> -# Returns: a list of @CpuInfo for each virtual CPU
> -#
> -# Since: 0.14.0
> -#
> -# Example:
> -#
> -# -> { "execute": "query-cpus" }
> -# <- { "return": [
> -#          {
> -#             "CPU":0,
> -#             "current":true,
> -#             "halted":false,
> -#             "qom_path":"/machine/unattached/device[0]",
> -#             "arch":"x86",
> -#             "pc":3227107138,
> -#             "thread_id":3134
> -#          },
> -#          {
> -#             "CPU":1,
> -#             "current":false,
> -#             "halted":true,
> -#             "qom_path":"/machine/unattached/device[2]",
> -#             "arch":"x86",
> -#             "pc":7108165,
> -#             "thread_id":3135
> -#          }
> -#       ]
> -#    }
> -#
> -##
> -{ 'command': 'query-cpus', 'returns': ['CpuInfo'] }
> -
> -##
> -# @IOThreadInfo:
> -#
> -# Information about an iothread
> -#
> -# @id: the identifier of the iothread
> -#
> -# @thread-id: ID of the underlying host thread
> -#
> -# @poll-max-ns: maximum polling time in ns, 0 means polling is disabled
> -#               (since 2.9)
> -#
> -# @poll-grow: how many ns will be added to polling time, 0 means that it's not
> -#             configured (since 2.9)
> -#
> -# @poll-shrink: how many ns will be removed from polling time, 0 means that
> -#               it's not configured (since 2.9)
> -#
> -# Since: 2.0
> -##
> -{ 'struct': 'IOThreadInfo',
> -  'data': {'id': 'str',
> -           'thread-id': 'int',
> -           'poll-max-ns': 'int',
> -           'poll-grow': 'int',
> -           'poll-shrink': 'int' } }
> -
> -##
> -# @query-iothreads:
> -#
> -# Returns a list of information about each iothread.
> -#
> -# Note: this list excludes the QEMU main loop thread, which is not declared
> -# using the -object iothread command-line option.  It is always the main thread
> -# of the process.
> -#
> -# Returns: a list of @IOThreadInfo for each iothread
> -#
> -# Since: 2.0
> -#
> -# Example:
> -#
> -# -> { "execute": "query-iothreads" }
> -# <- { "return": [
> -#          {
> -#             "id":"iothread0",
> -#             "thread-id":3134
> -#          },
> -#          {
> -#             "id":"iothread1",
> -#             "thread-id":3135
> -#          }
> -#       ]
> -#    }
> -#
> -##
> -{ 'command': 'query-iothreads', 'returns': ['IOThreadInfo'] }
> -
> -##
> -# @BalloonInfo:
> -#
> -# Information about the guest balloon device.
> -#
> -# @actual: the number of bytes the balloon currently contains
> -#
> -# Since: 0.14.0
> -#
> -##
> -{ 'struct': 'BalloonInfo', 'data': {'actual': 'int' } }
> -
> -##
> -# @query-balloon:
> -#
> -# Return information about the balloon device.
> -#
> -# Returns: @BalloonInfo on success
> -#
> -#          If the balloon driver is enabled but not functional because the KVM
> -#          kernel module cannot support it, KvmMissingCap
> -#
> -#          If no balloon device is present, DeviceNotActive
> -#
> -# Since: 0.14.0
> -#
> -# Example:
> -#
> -# -> { "execute": "query-balloon" }
> -# <- { "return": {
> -#          "actual": 1073741824,
> -#       }
> -#    }
> -#
> -##
> -{ 'command': 'query-balloon', 'returns': 'BalloonInfo' }
> -
> -##
> -# @BALLOON_CHANGE:
> -#
> -# Emitted when the guest changes the actual BALLOON level. This value is
> -# equivalent to the @actual field return by the 'query-balloon' command
> -#
> -# @actual: actual level of the guest memory balloon in bytes
> -#
> -# Note: this event is rate-limited.
> -#
> -# Since: 1.2
> -#
> -# Example:
> -#
> -# <- { "event": "BALLOON_CHANGE",
> -#      "data": { "actual": 944766976 },
> -#      "timestamp": { "seconds": 1267020223, "microseconds": 435656 } }
> -#
> -##
> -{ 'event': 'BALLOON_CHANGE',
> -  'data': { 'actual': 'int' } }
> -
> -##
> -# @PciMemoryRange:
> -#
> -# A PCI device memory region
> -#
> -# @base: the starting address (guest physical)
> -#
> -# @limit: the ending address (guest physical)
> -#
> -# Since: 0.14.0
> -##
> -{ 'struct': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} }
> -
> -##
> -# @PciMemoryRegion:
> -#
> -# Information about a PCI device I/O region.
> -#
> -# @bar: the index of the Base Address Register for this region
> -#
> -# @type: 'io' if the region is a PIO region
> -#        'memory' if the region is a MMIO region
> -#
> -# @size: memory size
> -#
> -# @prefetch: if @type is 'memory', true if the memory is prefetchable
> -#
> -# @mem_type_64: if @type is 'memory', true if the BAR is 64-bit
> -#
> -# Since: 0.14.0
> -##
> -{ 'struct': 'PciMemoryRegion',
> -  'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int',
> -           '*prefetch': 'bool', '*mem_type_64': 'bool' } }
> -
> -##
> -# @PciBusInfo:
> -#
> -# Information about a bus of a PCI Bridge device
> -#
> -# @number: primary bus interface number.  This should be the number of the
> -#          bus the device resides on.
> -#
> -# @secondary: secondary bus interface number.  This is the number of the
> -#             main bus for the bridge
> -#
> -# @subordinate: This is the highest number bus that resides below the
> -#               bridge.
> -#
> -# @io_range: The PIO range for all devices on this bridge
> -#
> -# @memory_range: The MMIO range for all devices on this bridge
> -#
> -# @prefetchable_range: The range of prefetchable MMIO for all devices on
> -#                      this bridge
> -#
> -# Since: 2.4
> -##
> -{ 'struct': 'PciBusInfo',
> -  'data': {'number': 'int', 'secondary': 'int', 'subordinate': 'int',
> -           'io_range': 'PciMemoryRange',
> -           'memory_range': 'PciMemoryRange',
> -           'prefetchable_range': 'PciMemoryRange' } }
> -
> -##
> -# @PciBridgeInfo:
> -#
> -# Information about a PCI Bridge device
> -#
> -# @bus: information about the bus the device resides on
> -#
> -# @devices: a list of @PciDeviceInfo for each device on this bridge
> -#
> -# Since: 0.14.0
> -##
> -{ 'struct': 'PciBridgeInfo',
> -  'data': {'bus': 'PciBusInfo', '*devices': ['PciDeviceInfo']} }
> -
> -##
> -# @PciDeviceClass:
> -#
> -# Information about the Class of a PCI device
> -#
> -# @desc: a string description of the device's class
> -#
> -# @class: the class code of the device
> -#
> -# Since: 2.4
> -##
> -{ 'struct': 'PciDeviceClass',
> -  'data': {'*desc': 'str', 'class': 'int'} }
> -
> -##
> -# @PciDeviceId:
> -#
> -# Information about the Id of a PCI device
> -#
> -# @device: the PCI device id
> -#
> -# @vendor: the PCI vendor id
> -#
> -# Since: 2.4
> -##
> -{ 'struct': 'PciDeviceId',
> -  'data': {'device': 'int', 'vendor': 'int'} }
> -
> -##
> -# @PciDeviceInfo:
> -#
> -# Information about a PCI device
> -#
> -# @bus: the bus number of the device
> -#
> -# @slot: the slot the device is located in
> -#
> -# @function: the function of the slot used by the device
> -#
> -# @class_info: the class of the device
> -#
> -# @id: the PCI device id
> -#
> -# @irq: if an IRQ is assigned to the device, the IRQ number
> -#
> -# @qdev_id: the device name of the PCI device
> -#
> -# @pci_bridge: if the device is a PCI bridge, the bridge information
> -#
> -# @regions: a list of the PCI I/O regions associated with the device
> -#
> -# Notes: the contents of @class_info.desc are not stable and should only be
> -#        treated as informational.
> -#
> -# Since: 0.14.0
> -##
> -{ 'struct': 'PciDeviceInfo',
> -  'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
> -           'class_info': 'PciDeviceClass', 'id': 'PciDeviceId',
> -           '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo',
> -           'regions': ['PciMemoryRegion']} }
> -
> -##
> -# @PciInfo:
> -#
> -# Information about a PCI bus
> -#
> -# @bus: the bus index
> -#
> -# @devices: a list of devices on this bus
> -#
> -# Since: 0.14.0
> -##
> -{ 'struct': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
> -
> -##
> -# @query-pci:
> -#
> -# Return information about the PCI bus topology of the guest.
> -#
> -# Returns: a list of @PciInfo for each PCI bus. Each bus is
> -# represented by a json-object, which has a key with a json-array of
> -# all PCI devices attached to it. Each device is represented by a
> -# json-object.
> -#
> -# Since: 0.14.0
> -#
> -# Example:
> -#
> -# -> { "execute": "query-pci" }
> -# <- { "return": [
> -#          {
> -#             "bus": 0,
> -#             "devices": [
> -#                {
> -#                   "bus": 0,
> -#                   "qdev_id": "",
> -#                   "slot": 0,
> -#                   "class_info": {
> -#                      "class": 1536,
> -#                      "desc": "Host bridge"
> -#                   },
> -#                   "id": {
> -#                      "device": 32902,
> -#                      "vendor": 4663
> -#                   },
> -#                   "function": 0,
> -#                   "regions": [
> -#                   ]
> -#                },
> -#                {
> -#                   "bus": 0,
> -#                   "qdev_id": "",
> -#                   "slot": 1,
> -#                   "class_info": {
> -#                      "class": 1537,
> -#                      "desc": "ISA bridge"
> -#                   },
> -#                   "id": {
> -#                      "device": 32902,
> -#                      "vendor": 28672
> -#                   },
> -#                   "function": 0,
> -#                   "regions": [
> -#                   ]
> -#                },
> -#                {
> -#                   "bus": 0,
> -#                   "qdev_id": "",
> -#                   "slot": 1,
> -#                   "class_info": {
> -#                      "class": 257,
> -#                      "desc": "IDE controller"
> -#                   },
> -#                   "id": {
> -#                      "device": 32902,
> -#                      "vendor": 28688
> -#                   },
> -#                   "function": 1,
> -#                   "regions": [
> -#                      {
> -#                         "bar": 4,
> -#                         "size": 16,
> -#                         "address": 49152,
> -#                         "type": "io"
> -#                      }
> -#                   ]
> -#                },
> -#                {
> -#                   "bus": 0,
> -#                   "qdev_id": "",
> -#                   "slot": 2,
> -#                   "class_info": {
> -#                      "class": 768,
> -#                      "desc": "VGA controller"
> -#                   },
> -#                   "id": {
> -#                      "device": 4115,
> -#                      "vendor": 184
> -#                   },
> -#                   "function": 0,
> -#                   "regions": [
> -#                      {
> -#                         "prefetch": true,
> -#                         "mem_type_64": false,
> -#                         "bar": 0,
> -#                         "size": 33554432,
> -#                         "address": 4026531840,
> -#                         "type": "memory"
> -#                      },
> -#                      {
> -#                         "prefetch": false,
> -#                         "mem_type_64": false,
> -#                         "bar": 1,
> -#                         "size": 4096,
> -#                         "address": 4060086272,
> -#                         "type": "memory"
> -#                      },
> -#                      {
> -#                         "prefetch": false,
> -#                         "mem_type_64": false,
> -#                         "bar": 6,
> -#                         "size": 65536,
> -#                         "address": -1,
> -#                         "type": "memory"
> -#                      }
> -#                   ]
> -#                },
> -#                {
> -#                   "bus": 0,
> -#                   "qdev_id": "",
> -#                   "irq": 11,
> -#                   "slot": 4,
> -#                   "class_info": {
> -#                      "class": 1280,
> -#                      "desc": "RAM controller"
> -#                   },
> -#                   "id": {
> -#                      "device": 6900,
> -#                      "vendor": 4098
> -#                   },
> -#                   "function": 0,
> -#                   "regions": [
> -#                      {
> -#                         "bar": 0,
> -#                         "size": 32,
> -#                         "address": 49280,
> -#                         "type": "io"
> -#                      }
> -#                   ]
> -#                }
> -#             ]
> -#          }
> -#       ]
> -#    }
> -#
> -# Note: This example has been shortened as the real response is too long.
> -#
> -##
> -{ 'command': 'query-pci', 'returns': ['PciInfo'] }
> -
> -##
> -# @quit:
> -#
> -# This command will cause the QEMU process to exit gracefully.  While every
> -# attempt is made to send the QMP response before terminating, this is not
> -# guaranteed.  When using this interface, a premature EOF would not be
> -# unexpected.
> -#
> -# Since: 0.14.0
> -#
> -# Example:
> -#
> -# -> { "execute": "quit" }
> -# <- { "return": {} }
> -##
> -{ 'command': 'quit' }
> -
> -##
> -# @stop:
> -#
> -# Stop all guest VCPU execution.
> -#
> -# Since:  0.14.0
> -#
> -# Notes:  This function will succeed even if the guest is already in the stopped
> -#         state.  In "inmigrate" state, it will ensure that the guest
> -#         remains paused once migration finishes, as if the -S option was
> -#         passed on the command line.
> -#
> -# Example:
> -#
> -# -> { "execute": "stop" }
> -# <- { "return": {} }
> -#
> -##
> -{ 'command': 'stop' }
> -
> -##
> -# @system_reset:
> -#
> -# Performs a hard reset of a guest.
> -#
> -# Since: 0.14.0
> -#
> -# Example:
> -#
> -# -> { "execute": "system_reset" }
> -# <- { "return": {} }
> -#
> -##
> -{ 'command': 'system_reset' }
> -
> -##
> -# @system_powerdown:
> -#
> -# Requests that a guest perform a powerdown operation.
> -#
> -# Since: 0.14.0
> -#
> -# Notes: A guest may or may not respond to this command.  This command
> -#        returning does not indicate that a guest has accepted the request or
> -#        that it has shut down.  Many guests will respond to this command by
> -#        prompting the user in some way.
> -# Example:
> -#
> -# -> { "execute": "system_powerdown" }
> -# <- { "return": {} }
> -#
> -##
> -{ 'command': 'system_powerdown' }
> -
> -##
> -# @cpu-add:
> -#
> -# Adds CPU with specified ID
> -#
> -# @id: ID of CPU to be created, valid values [0..max_cpus)
> -#
> -# Returns: Nothing on success
> -#
> -# Since: 1.5
> -#
> -# Example:
> -#
> -# -> { "execute": "cpu-add", "arguments": { "id": 2 } }
> -# <- { "return": {} }
> -#
> -##
> -{ 'command': 'cpu-add', 'data': {'id': 'int'} }
> -
> -##
> -# @memsave:
> -#
> -# Save a portion of guest memory to a file.
> -#
> -# @val: the virtual address of the guest to start from
> -#
> -# @size: the size of memory region to save
> -#
> -# @filename: the file to save the memory to as binary data
> -#
> -# @cpu-index: the index of the virtual CPU to use for translating the
> -#                       virtual address (defaults to CPU 0)
> -#
> -# Returns: Nothing on success
> -#
> -# Since: 0.14.0
> -#
> -# Notes: Errors were not reliably returned until 1.1
> -#
> -# Example:
> -#
> -# -> { "execute": "memsave",
> -#      "arguments": { "val": 10,
> -#                     "size": 100,
> -#                     "filename": "/tmp/virtual-mem-dump" } }
> -# <- { "return": {} }
> -#
> -##
> -{ 'command': 'memsave',
> -  'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
> -
> -##
> -# @pmemsave:
> -#
> -# Save a portion of guest physical memory to a file.
> -#
> -# @val: the physical address of the guest to start from
> -#
> -# @size: the size of memory region to save
> -#
> -# @filename: the file to save the memory to as binary data
> -#
> -# Returns: Nothing on success
> -#
> -# Since: 0.14.0
> -#
> -# Notes: Errors were not reliably returned until 1.1
> -#
> -# Example:
> -#
> -# -> { "execute": "pmemsave",
> -#      "arguments": { "val": 10,
> -#                     "size": 100,
> -#                     "filename": "/tmp/physical-mem-dump" } }
> -# <- { "return": {} }
> -#
> -##
> -{ 'command': 'pmemsave',
> -  'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
> -
> -##
> -# @cont:
> -#
> -# Resume guest VCPU execution.
> -#
> -# Since:  0.14.0
> -#
> -# Returns:  If successful, nothing
> -#
> -# Notes:  This command will succeed if the guest is currently running.  It
> -#         will also succeed if the guest is in the "inmigrate" state; in
> -#         this case, the effect of the command is to make sure the guest
> -#         starts once migration finishes, removing the effect of the -S
> -#         command line option if it was passed.
> -#
> -# Example:
> -#
> -# -> { "execute": "cont" }
> -# <- { "return": {} }
> -#
> -##
> -{ 'command': 'cont' }
> -
> -##
> -# @system_wakeup:
> -#
> -# Wakeup guest from suspend.  Does nothing in case the guest isn't suspended.
> -#
> -# Since:  1.1
> -#
> -# Returns:  nothing.
> -#
> -# Example:
> -#
> -# -> { "execute": "system_wakeup" }
> -# <- { "return": {} }
> -#
> -##
> -{ 'command': 'system_wakeup' }
> -
> -##
> -# @inject-nmi:
> -#
> -# Injects a Non-Maskable Interrupt into the default CPU (x86/s390) or all CPUs (ppc64).
> -# The command fails when the guest doesn't support injecting.
> -#
> -# Returns:  If successful, nothing
> -#
> -# Since:  0.14.0
> -#
> -# Note: prior to 2.1, this command was only supported for x86 and s390 VMs
> -#
> -# Example:
> -#
> -# -> { "execute": "inject-nmi" }
> -# <- { "return": {} }
> -#
> -##
> -{ 'command': 'inject-nmi' }
> -
> -##
> -# @balloon:
> -#
> -# Request the balloon driver to change its balloon size.
> -#
> -# @value: the target size of the balloon in bytes
> -#
> -# Returns: Nothing on success
> -#          If the balloon driver is enabled but not functional because the KVM
> -#            kernel module cannot support it, KvmMissingCap
> -#          If no balloon device is present, DeviceNotActive
> -#
> -# Notes: This command just issues a request to the guest.  When it returns,
> -#        the balloon size may not have changed.  A guest can change the balloon
> -#        size independent of this command.
> -#
> -# Since: 0.14.0
> -#
> -# Example:
> -#
> -# -> { "execute": "balloon", "arguments": { "value": 536870912 } }
> -# <- { "return": {} }
> -#
> -##
> -{ 'command': 'balloon', 'data': {'value': 'int'} }
> -
> -##
> -# @human-monitor-command:
> -#
> -# Execute a command on the human monitor and return the output.
> -#
> -# @command-line: the command to execute in the human monitor
> -#
> -# @cpu-index: The CPU to use for commands that require an implicit CPU
> -#
> -# Returns: the output of the command as a string
> -#
> -# Since: 0.14.0
> -#
> -# Notes: This command only exists as a stop-gap.  Its use is highly
> -#        discouraged.  The semantics of this command are not
> -#        guaranteed: this means that command names, arguments and
> -#        responses can change or be removed at ANY time.  Applications
> -#        that rely on long term stability guarantees should NOT
> -#        use this command.
> -#
> -#        Known limitations:
> -#
> -#        * This command is stateless, this means that commands that depend
> -#          on state information (such as getfd) might not work
> -#
> -#        * Commands that prompt the user for data don't currently work
> -#
> -# Example:
> -#
> -# -> { "execute": "human-monitor-command",
> -#      "arguments": { "command-line": "info kvm" } }
> -# <- { "return": "kvm support: enabled\r\n" }
> -#
> -##
> -{ 'command': 'human-monitor-command',
> -  'data': {'command-line': 'str', '*cpu-index': 'int'},
> -  'returns': 'str' }
> -
> -##
> -# @ObjectPropertyInfo:
> -#
> -# @name: the name of the property
> -#
> -# @type: the type of the property.  This will typically come in one of four
> -#        forms:
> -#
> -#        1) A primitive type such as 'u8', 'u16', 'bool', 'str', or 'double'.
> -#           These types are mapped to the appropriate JSON type.
> -#
> -#        2) A child type in the form 'child<subtype>' where subtype is a qdev
> -#           device type name.  Child properties create the composition tree.
> -#
> -#        3) A link type in the form 'link<subtype>' where subtype is a qdev
> -#           device type name.  Link properties form the device model graph.
> -#
> -# Since: 1.2
> -##
> -{ 'struct': 'ObjectPropertyInfo',
> -  'data': { 'name': 'str', 'type': 'str' } }
> -
> -##
> -# @qom-list:
> -#
> -# This command will list any properties of a object given a path in the object
> -# model.
> -#
> -# @path: the path within the object model.  See @qom-get for a description of
> -#        this parameter.
> -#
> -# Returns: a list of @ObjectPropertyInfo that describe the properties of the
> -#          object.
> -#
> -# Since: 1.2
> -##
> -{ 'command': 'qom-list',
> -  'data': { 'path': 'str' },
> -  'returns': [ 'ObjectPropertyInfo' ] }
> -
> -##
> -# @qom-get:
> -#
> -# This command will get a property from a object model path and return the
> -# value.
> -#
> -# @path: The path within the object model.  There are two forms of supported
> -#        paths--absolute and partial paths.
> -#
> -#        Absolute paths are derived from the root object and can follow child<>
> -#        or link<> properties.  Since they can follow link<> properties, they
> -#        can be arbitrarily long.  Absolute paths look like absolute filenames
> -#        and are prefixed  with a leading slash.
> -#
> -#        Partial paths look like relative filenames.  They do not begin
> -#        with a prefix.  The matching rules for partial paths are subtle but
> -#        designed to make specifying objects easy.  At each level of the
> -#        composition tree, the partial path is matched as an absolute path.
> -#        The first match is not returned.  At least two matches are searched
> -#        for.  A successful result is only returned if only one match is
> -#        found.  If more than one match is found, a flag is return to
> -#        indicate that the match was ambiguous.
> -#
> -# @property: The property name to read
> -#
> -# Returns: The property value.  The type depends on the property
> -#          type. child<> and link<> properties are returned as #str
> -#          pathnames.  All integer property types (u8, u16, etc) are
> -#          returned as #int.
> -#
> -# Since: 1.2
> -##
> -{ 'command': 'qom-get',
> -  'data': { 'path': 'str', 'property': 'str' },
> -  'returns': 'any' }
> -
> -##
> -# @qom-set:
> -#
> -# This command will set a property from a object model path.
> -#
> -# @path: see @qom-get for a description of this parameter
> -#
> -# @property: the property name to set
> -#
> -# @value: a value who's type is appropriate for the property type.  See @qom-get
> -#         for a description of type mapping.
> -#
> -# Since: 1.2
> -##
> -{ 'command': 'qom-set',
> -  'data': { 'path': 'str', 'property': 'str', 'value': 'any' } }
> -
> -##
> -# @change:
> -#
> -# This command is multiple commands multiplexed together.
> -#
> -# @device: This is normally the name of a block device but it may also be 'vnc'.
> -#          when it's 'vnc', then sub command depends on @target
> -#
> -# @target: If @device is a block device, then this is the new filename.
> -#          If @device is 'vnc', then if the value 'password' selects the vnc
> -#          change password command.   Otherwise, this specifies a new server URI
> -#          address to listen to for VNC connections.
> -#
> -# @arg:    If @device is a block device, then this is an optional format to open
> -#          the device with.
> -#          If @device is 'vnc' and @target is 'password', this is the new VNC
> -#          password to set.  See change-vnc-password for additional notes.
> -#
> -# Returns: Nothing on success.
> -#          If @device is not a valid block device, DeviceNotFound
> -#
> -# Notes:  This interface is deprecated, and it is strongly recommended that you
> -#         avoid using it.  For changing block devices, use
> -#         blockdev-change-medium; for changing VNC parameters, use
> -#         change-vnc-password.
> -#
> -# Since: 0.14.0
> -#
> -# Example:
> -#
> -# 1. Change a removable medium
> -#
> -# -> { "execute": "change",
> -#      "arguments": { "device": "ide1-cd0",
> -#                     "target": "/srv/images/Fedora-12-x86_64-DVD.iso" } }
> -# <- { "return": {} }
> -#
> -# 2. Change VNC password
> -#
> -# -> { "execute": "change",
> -#      "arguments": { "device": "vnc", "target": "password",
> -#                     "arg": "foobar1" } }
> -# <- { "return": {} }
> -#
> -##
> -{ 'command': 'change',
> -  'data': {'device': 'str', 'target': 'str', '*arg': 'str'} }
> -
> -##
> -# @ObjectTypeInfo:
> -#
> -# This structure describes a search result from @qom-list-types
> -#
> -# @name: the type name found in the search
> -#
> -# @abstract: the type is abstract and can't be directly instantiated.
> -#            Omitted if false. (since 2.10)
> -#
> -# @parent: Name of parent type, if any (since 2.10)
> -#
> -# Since: 1.1
> -##
> -{ 'struct': 'ObjectTypeInfo',
> -  'data': { 'name': 'str', '*abstract': 'bool', '*parent': 'str' } }
> -
> -##
> -# @qom-list-types:
> -#
> -# This command will return a list of types given search parameters
> -#
> -# @implements: if specified, only return types that implement this type name
> -#
> -# @abstract: if true, include abstract types in the results
> -#
> -# Returns: a list of @ObjectTypeInfo or an empty list if no results are found
> -#
> -# Since: 1.1
> -##
> -{ 'command': 'qom-list-types',
> -  'data': { '*implements': 'str', '*abstract': 'bool' },
> -  'returns': [ 'ObjectTypeInfo' ] }
> -
> -##
> -# @DevicePropertyInfo:
> -#
> -# Information about device properties.
> -#
> -# @name: the name of the property
> -# @type: the typename of the property
> -# @description: if specified, the description of the property.
> -#               (since 2.2)
> -#
> -# Since: 1.2
> -##
> -{ 'struct': 'DevicePropertyInfo',
> -  'data': { 'name': 'str', 'type': 'str', '*description': 'str' } }
> -
> -##
> -# @device-list-properties:
> -#
> -# List properties associated with a device.
> -#
> -# @typename: the type name of a device
> -#
> -# Returns: a list of DevicePropertyInfo describing a devices properties
> -#
> -# Since: 1.2
> -##
> -{ 'command': 'device-list-properties',
> -  'data': { 'typename': 'str'},
> -  'returns': [ 'DevicePropertyInfo' ] }
> -
> -##
> -# @xen-set-global-dirty-log:
> -#
> -# Enable or disable the global dirty log mode.
> -#
> -# @enable: true to enable, false to disable.
> -#
> -# Returns: nothing
> -#
> -# Since: 1.3
> -#
> -# Example:
> -#
> -# -> { "execute": "xen-set-global-dirty-log",
> -#      "arguments": { "enable": true } }
> -# <- { "return": {} }
> -#
> -##
> -{ 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
> -
> -##
> -# @device_add:
> -#
> -# @driver: the name of the new device's driver
> -#
> -# @bus: the device's parent bus (device tree path)
> -#
> -# @id: the device's ID, must be unique
> -#
> -# Additional arguments depend on the type.
> -#
> -# Add a device.
> -#
> -# Notes:
> -# 1. For detailed information about this command, please refer to the
> -#    'docs/qdev-device-use.txt' file.
> -#
> -# 2. It's possible to list device properties by running QEMU with the
> -#    "-device DEVICE,help" command-line argument, where DEVICE is the
> -#    device's name
> -#
> -# Example:
> -#
> -# -> { "execute": "device_add",
> -#      "arguments": { "driver": "e1000", "id": "net1",
> -#                     "bus": "pci.0",
> -#                     "mac": "52:54:00:12:34:56" } }
> -# <- { "return": {} }
> -#
> -# TODO: This command effectively bypasses QAPI completely due to its
> -# "additional arguments" business.  It shouldn't have been added to
> -# the schema in this form.  It should be qapified properly, or
> -# replaced by a properly qapified command.
> -#
> -# Since: 0.13
> -##
> -{ 'command': 'device_add',
> -  'data': {'driver': 'str', '*bus': 'str', '*id': 'str'},
> -  'gen': false } # so we can get the additional arguments
> -
> -##
> -# @device_del:
> -#
> -# Remove a device from a guest
> -#
> -# @id: the device's ID or QOM path
> -#
> -# Returns: Nothing on success
> -#          If @id is not a valid device, DeviceNotFound
> -#
> -# Notes: When this command completes, the device may not be removed from the
> -#        guest.  Hot removal is an operation that requires guest cooperation.
> -#        This command merely requests that the guest begin the hot removal
> -#        process.  Completion of the device removal process is signaled with a
> -#        DEVICE_DELETED event. Guest reset will automatically complete removal
> -#        for all devices.
> -#
> -# Since: 0.14.0
> -#
> -# Example:
> -#
> -# -> { "execute": "device_del",
> -#      "arguments": { "id": "net1" } }
> -# <- { "return": {} }
> -#
> -# -> { "execute": "device_del",
> -#      "arguments": { "id": "/machine/peripheral-anon/device[0]" } }
> -# <- { "return": {} }
> -#
> -##
> -{ 'command': 'device_del', 'data': {'id': 'str'} }
> -
> -##
> -# @DEVICE_DELETED:
> -#
> -# Emitted whenever the device removal completion is acknowledged by the guest.
> -# At this point, it's safe to reuse the specified device ID. Device removal can
> -# be initiated by the guest or by HMP/QMP commands.
> -#
> -# @device: device name
> -#
> -# @path: device path
> -#
> -# Since: 1.5
> -#
> -# Example:
> -#
> -# <- { "event": "DEVICE_DELETED",
> -#      "data": { "device": "virtio-net-pci-0",
> -#                "path": "/machine/peripheral/virtio-net-pci-0" },
> -#      "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
> -#
> -##
> -{ 'event': 'DEVICE_DELETED',
> -  'data': { '*device': 'str', 'path': 'str' } }
> -
> -##
> -# @DumpGuestMemoryFormat:
> -#
> -# An enumeration of guest-memory-dump's format.
> -#
> -# @elf: elf format
> -#
> -# @kdump-zlib: kdump-compressed format with zlib-compressed
> -#
> -# @kdump-lzo: kdump-compressed format with lzo-compressed
> -#
> -# @kdump-snappy: kdump-compressed format with snappy-compressed
> -#
> -# Since: 2.0
> -##
> -{ 'enum': 'DumpGuestMemoryFormat',
> -  'data': [ 'elf', 'kdump-zlib', 'kdump-lzo', 'kdump-snappy' ] }
> -
> -##
> -# @dump-guest-memory:
> -#
> -# Dump guest's memory to vmcore. It is a synchronous operation that can take
> -# very long depending on the amount of guest memory.
> -#
> -# @paging: if true, do paging to get guest's memory mapping. This allows
> -#          using gdb to process the core file.
> -#
> -#          IMPORTANT: this option can make QEMU allocate several gigabytes
> -#                     of RAM. This can happen for a large guest, or a
> -#                     malicious guest pretending to be large.
> -#
> -#          Also, paging=true has the following limitations:
> -#
> -#             1. The guest may be in a catastrophic state or can have corrupted
> -#                memory, which cannot be trusted
> -#             2. The guest can be in real-mode even if paging is enabled. For
> -#                example, the guest uses ACPI to sleep, and ACPI sleep state
> -#                goes in real-mode
> -#             3. Currently only supported on i386 and x86_64.
> -#
> -# @protocol: the filename or file descriptor of the vmcore. The supported
> -#            protocols are:
> -#
> -#            1. file: the protocol starts with "file:", and the following
> -#               string is the file's path.
> -#            2. fd: the protocol starts with "fd:", and the following string
> -#               is the fd's name.
> -#
> -# @detach: if true, QMP will return immediately rather than
> -#          waiting for the dump to finish. The user can track progress
> -#          using "query-dump". (since 2.6).
> -#
> -# @begin: if specified, the starting physical address.
> -#
> -# @length: if specified, the memory size, in bytes. If you don't
> -#          want to dump all guest's memory, please specify the start @begin
> -#          and @length
> -#
> -# @format: if specified, the format of guest memory dump. But non-elf
> -#          format is conflict with paging and filter, ie. @paging, @begin and
> -#          @length is not allowed to be specified with non-elf @format at the
> -#          same time (since 2.0)
> -#
> -# Note: All boolean arguments default to false
> -#
> -# Returns: nothing on success
> -#
> -# Since: 1.2
> -#
> -# Example:
> -#
> -# -> { "execute": "dump-guest-memory",
> -#      "arguments": { "protocol": "fd:dump" } }
> -# <- { "return": {} }
> -#
> -##
> -{ 'command': 'dump-guest-memory',
> -  'data': { 'paging': 'bool', 'protocol': 'str', '*detach': 'bool',
> -            '*begin': 'int', '*length': 'int',
> -            '*format': 'DumpGuestMemoryFormat'} }
> -
> -##
> -# @DumpStatus:
> -#
> -# Describe the status of a long-running background guest memory dump.
> -#
> -# @none: no dump-guest-memory has started yet.
> -#
> -# @active: there is one dump running in background.
> -#
> -# @completed: the last dump has finished successfully.
> -#
> -# @failed: the last dump has failed.
> -#
> -# Since: 2.6
> -##
> -{ 'enum': 'DumpStatus',
> -  'data': [ 'none', 'active', 'completed', 'failed' ] }
> -
> -##
> -# @DumpQueryResult:
> -#
> -# The result format for 'query-dump'.
> -#
> -# @status: enum of @DumpStatus, which shows current dump status
> -#
> -# @completed: bytes written in latest dump (uncompressed)
> -#
> -# @total: total bytes to be written in latest dump (uncompressed)
> -#
> -# Since: 2.6
> -##
> -{ 'struct': 'DumpQueryResult',
> -  'data': { 'status': 'DumpStatus',
> -            'completed': 'int',
> -            'total': 'int' } }
> -
> -##
> -# @query-dump:
> -#
> -# Query latest dump status.
> -#
> -# Returns: A @DumpStatus object showing the dump status.
> -#
> -# Since: 2.6
> -#
> -# Example:
> -#
> -# -> { "execute": "query-dump" }
> -# <- { "return": { "status": "active", "completed": 1024000,
> -#                  "total": 2048000 } }
> -#
> -##
> -{ 'command': 'query-dump', 'returns': 'DumpQueryResult' }
> -
> -##
> -# @DUMP_COMPLETED:
> -#
> -# Emitted when background dump has completed
> -#
> -# @result: DumpQueryResult type described in qapi-schema.json.
> -#
> -# @error: human-readable error string that provides
> -#         hint on why dump failed. Only presents on failure. The
> -#         user should not try to interpret the error string.
> -#
> -# Since: 2.6
> -#
> -# Example:
> -#
> -# { "event": "DUMP_COMPLETED",
> -#   "data": {"result": {"total": 1090650112, "status": "completed",
> -#                       "completed": 1090650112} } }
> -#
> -##
> -{ 'event': 'DUMP_COMPLETED' ,
> -  'data': { 'result': 'DumpQueryResult', '*error': 'str' } }
> -
> -##
> -# @DumpGuestMemoryCapability:
> -#
> -# A list of the available formats for dump-guest-memory
> -#
> -# Since: 2.0
> -##
> -{ 'struct': 'DumpGuestMemoryCapability',
> -  'data': {
> -      'formats': ['DumpGuestMemoryFormat'] } }
> -
> -##
> -# @query-dump-guest-memory-capability:
> -#
> -# Returns the available formats for dump-guest-memory
> -#
> -# Returns:  A @DumpGuestMemoryCapability object listing available formats for
> -#           dump-guest-memory
> -#
> -# Since: 2.0
> -#
> -# Example:
> -#
> -# -> { "execute": "query-dump-guest-memory-capability" }
> -# <- { "return": { "formats":
> -#                  ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
> -#
> -##
> -{ 'command': 'query-dump-guest-memory-capability',
> -  'returns': 'DumpGuestMemoryCapability' }
> -
> -##
> -# @dump-skeys:
> -#
> -# Dump guest's storage keys
> -#
> -# @filename: the path to the file to dump to
> -#
> -# This command is only supported on s390 architecture.
> -#
> -# Since: 2.5
> -#
> -# Example:
> -#
> -# -> { "execute": "dump-skeys",
> -#      "arguments": { "filename": "/tmp/skeys" } }
> -# <- { "return": {} }
> -#
> -##
> -{ 'command': 'dump-skeys',
> -  'data': { 'filename': 'str' } }
> -
> -##
> -# @object-add:
> -#
> -# Create a QOM object.
> -#
> -# @qom-type: the class name for the object to be created
> -#
> -# @id: the name of the new object
> -#
> -# @props: a dictionary of properties to be passed to the backend
> -#
> -# Returns: Nothing on success
> -#          Error if @qom-type is not a valid class name
> -#
> -# Since: 2.0
> -#
> -# Example:
> -#
> -# -> { "execute": "object-add",
> -#      "arguments": { "qom-type": "rng-random", "id": "rng1",
> -#                     "props": { "filename": "/dev/hwrng" } } }
> -# <- { "return": {} }
> -#
> -##
> -{ 'command': 'object-add',
> -  'data': {'qom-type': 'str', 'id': 'str', '*props': 'any'} }
> -
> -##
> -# @object-del:
> -#
> -# Remove a QOM object.
> -#
> -# @id: the name of the QOM object to remove
> -#
> -# Returns: Nothing on success
> -#          Error if @id is not a valid id for a QOM object
> -#
> -# Since: 2.0
> -#
> -# Example:
> -#
> -# -> { "execute": "object-del", "arguments": { "id": "rng1" } }
> -# <- { "return": {} }
> -#
> -##
> -{ 'command': 'object-del', 'data': {'id': 'str'} }
> -
> -##
> -# @getfd:
> -#
> -# Receive a file descriptor via SCM rights and assign it a name
> -#
> -# @fdname: file descriptor name
> -#
> -# Returns: Nothing on success
> -#
> -# Since: 0.14.0
> -#
> -# Notes: If @fdname already exists, the file descriptor assigned to
> -#        it will be closed and replaced by the received file
> -#        descriptor.
> -#
> -#        The 'closefd' command can be used to explicitly close the
> -#        file descriptor when it is no longer needed.
> -#
> -# Example:
> -#
> -# -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
> -# <- { "return": {} }
> -#
> -##
> -{ 'command': 'getfd', 'data': {'fdname': 'str'} }
> -
> -##
> -# @closefd:
> -#
> -# Close a file descriptor previously passed via SCM rights
> -#
> -# @fdname: file descriptor name
> -#
> -# Returns: Nothing on success
> -#
> -# Since: 0.14.0
> -#
> -# Example:
> -#
> -# -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
> -# <- { "return": {} }
> -#
> -##
> -{ 'command': 'closefd', 'data': {'fdname': 'str'} }
> -
> -##
> -# @MachineInfo:
> -#
> -# Information describing a machine.
> -#
> -# @name: the name of the machine
> -#
> -# @alias: an alias for the machine name
> -#
> -# @is-default: whether the machine is default
> -#
> -# @cpu-max: maximum number of CPUs supported by the machine type
> -#           (since 1.5.0)
> -#
> -# @hotpluggable-cpus: cpu hotplug via -device is supported (since 2.7.0)
> -#
> -# Since: 1.2.0
> -##
> -{ 'struct': 'MachineInfo',
> -  'data': { 'name': 'str', '*alias': 'str',
> -            '*is-default': 'bool', 'cpu-max': 'int',
> -            'hotpluggable-cpus': 'bool'} }
> -
> -##
> -# @query-machines:
> -#
> -# Return a list of supported machines
> -#
> -# Returns: a list of MachineInfo
> -#
> -# Since: 1.2.0
> -##
> -{ 'command': 'query-machines', 'returns': ['MachineInfo'] }
> -
> -##
> -# @CpuDefinitionInfo:
> -#
> -# Virtual CPU definition.
> -#
> -# @name: the name of the CPU definition
> -#
> -# @migration-safe: whether a CPU definition can be safely used for
> -#                  migration in combination with a QEMU compatibility machine
> -#                  when migrating between different QMU versions and between
> -#                  hosts with different sets of (hardware or software)
> -#                  capabilities. If not provided, information is not available
> -#                  and callers should not assume the CPU definition to be
> -#                  migration-safe. (since 2.8)
> -#
> -# @static: whether a CPU definition is static and will not change depending on
> -#          QEMU version, machine type, machine options and accelerator options.
> -#          A static model is always migration-safe. (since 2.8)
> -#
> -# @unavailable-features: List of properties that prevent
> -#                        the CPU model from running in the current
> -#                        host. (since 2.8)
> -# @typename: Type name that can be used as argument to @device-list-properties,
> -#            to introspect properties configurable using -cpu or -global.
> -#            (since 2.9)
> -#
> -# @unavailable-features is a list of QOM property names that
> -# represent CPU model attributes that prevent the CPU from running.
> -# If the QOM property is read-only, that means there's no known
> -# way to make the CPU model run in the current host. Implementations
> -# that choose not to provide specific information return the
> -# property name "type".
> -# If the property is read-write, it means that it MAY be possible
> -# to run the CPU model in the current host if that property is
> -# changed. Management software can use it as hints to suggest or
> -# choose an alternative for the user, or just to generate meaningful
> -# error messages explaining why the CPU model can't be used.
> -# If @unavailable-features is an empty list, the CPU model is
> -# runnable using the current host and machine-type.
> -# If @unavailable-features is not present, runnability
> -# information for the CPU is not available.
> -#
> -# Since: 1.2.0
> -##
> -{ 'struct': 'CpuDefinitionInfo',
> -  'data': { 'name': 'str', '*migration-safe': 'bool', 'static': 'bool',
> -            '*unavailable-features': [ 'str' ], 'typename': 'str' } }
> -
> -##
> -# @MemoryInfo:
> -#
> -# Actual memory information in bytes.
> -#
> -# @base-memory: size of "base" memory specified with command line
> -#               option -m.
> -#
> -# @plugged-memory: size of memory that can be hot-unplugged. This field
> -#                  is omitted if target doesn't support memory hotplug
> -#                  (i.e. CONFIG_MEM_HOTPLUG not defined on build time).
> -#
> -# Since: 2.11.0
> -##
> -{ 'struct': 'MemoryInfo',
> -  'data'  : { 'base-memory': 'size', '*plugged-memory': 'size' } }
> -
> -##
> -# @query-memory-size-summary:
> -#
> -# Return the amount of initially allocated and present hotpluggable (if
> -# enabled) memory in bytes.
> -#
> -# Example:
> -#
> -# -> { "execute": "query-memory-size-summary" }
> -# <- { "return": { "base-memory": 4294967296, "plugged-memory": 0 } }
> -#
> -# Since: 2.11.0
> -##
> -{ 'command': 'query-memory-size-summary', 'returns': 'MemoryInfo' }
> -
> -##
> -# @query-cpu-definitions:
> -#
> -# Return a list of supported virtual CPU definitions
> -#
> -# Returns: a list of CpuDefInfo
> -#
> -# Since: 1.2.0
> -##
> -{ 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'] }
> -
> -##
> -# @CpuModelInfo:
> -#
> -# Virtual CPU model.
> -#
> -# A CPU model consists of the name of a CPU definition, to which
> -# delta changes are applied (e.g. features added/removed). Most magic values
> -# that an architecture might require should be hidden behind the name.
> -# However, if required, architectures can expose relevant properties.
> -#
> -# @name: the name of the CPU definition the model is based on
> -# @props: a dictionary of QOM properties to be applied
> -#
> -# Since: 2.8.0
> -##
> -{ 'struct': 'CpuModelInfo',
> -  'data': { 'name': 'str',
> -            '*props': 'any' } }
> -
> -##
> -# @CpuModelExpansionType:
> -#
> -# An enumeration of CPU model expansion types.
> -#
> -# @static: Expand to a static CPU model, a combination of a static base
> -#          model name and property delta changes. As the static base model will
> -#          never change, the expanded CPU model will be the same, independant of
> -#          independent of QEMU version, machine type, machine options, and
> -#          accelerator options. Therefore, the resulting model can be used by
> -#          tooling without having to specify a compatibility machine - e.g. when
> -#          displaying the "host" model. static CPU models are migration-safe.
> -#
> -# @full: Expand all properties. The produced model is not guaranteed to be
> -#        migration-safe, but allows tooling to get an insight and work with
> -#        model details.
> -#
> -# Note: When a non-migration-safe CPU model is expanded in static mode, some
> -# features enabled by the CPU model may be omitted, because they can't be
> -# implemented by a static CPU model definition (e.g. cache info passthrough and
> -# PMU passthrough in x86). If you need an accurate representation of the
> -# features enabled by a non-migration-safe CPU model, use @full. If you need a
> -# static representation that will keep ABI compatibility even when changing QEMU
> -# version or machine-type, use @static (but keep in mind that some features may
> -# be omitted).
> -#
> -# Since: 2.8.0
> -##
> -{ 'enum': 'CpuModelExpansionType',
> -  'data': [ 'static', 'full' ] }
> -
> -
> -##
> -# @CpuModelExpansionInfo:
> -#
> -# The result of a cpu model expansion.
> -#
> -# @model: the expanded CpuModelInfo.
> -#
> -# Since: 2.8.0
> -##
> -{ 'struct': 'CpuModelExpansionInfo',
> -  'data': { 'model': 'CpuModelInfo' } }
> -
> -
> -##
> -# @query-cpu-model-expansion:
> -#
> -# Expands a given CPU model (or a combination of CPU model + additional options)
> -# to different granularities, allowing tooling to get an understanding what a
> -# specific CPU model looks like in QEMU under a certain configuration.
> -#
> -# This interface can be used to query the "host" CPU model.
> -#
> -# The data returned by this command may be affected by:
> -#
> -# * QEMU version: CPU models may look different depending on the QEMU version.
> -#   (Except for CPU models reported as "static" in query-cpu-definitions.)
> -# * machine-type: CPU model  may look different depending on the machine-type.
> -#   (Except for CPU models reported as "static" in query-cpu-definitions.)
> -# * machine options (including accelerator): in some architectures, CPU models
> -#   may look different depending on machine and accelerator options. (Except for
> -#   CPU models reported as "static" in query-cpu-definitions.)
> -# * "-cpu" arguments and global properties: arguments to the -cpu option and
> -#   global properties may affect expansion of CPU models. Using
> -#   query-cpu-model-expansion while using these is not advised.
> -#
> -# Some architectures may not support all expansion types. s390x supports
> -# "full" and "static".
> -#
> -# Returns: a CpuModelExpansionInfo. Returns an error if expanding CPU models is
> -#          not supported, if the model cannot be expanded, if the model contains
> -#          an unknown CPU definition name, unknown properties or properties
> -#          with a wrong type. Also returns an error if an expansion type is
> -#          not supported.
> -#
> -# Since: 2.8.0
> -##
> -{ 'command': 'query-cpu-model-expansion',
> -  'data': { 'type': 'CpuModelExpansionType',
> -            'model': 'CpuModelInfo' },
> -  'returns': 'CpuModelExpansionInfo' }
> -
> -##
> -# @CpuModelCompareResult:
> -#
> -# An enumeration of CPU model comparation results. The result is usually
> -# calculated using e.g. CPU features or CPU generations.
> -#
> -# @incompatible: If model A is incompatible to model B, model A is not
> -#                guaranteed to run where model B runs and the other way around.
> -#
> -# @identical: If model A is identical to model B, model A is guaranteed to run
> -#             where model B runs and the other way around.
> -#
> -# @superset: If model A is a superset of model B, model B is guaranteed to run
> -#            where model A runs. There are no guarantees about the other way.
> -#
> -# @subset: If model A is a subset of model B, model A is guaranteed to run
> -#          where model B runs. There are no guarantees about the other way.
> -#
> -# Since: 2.8.0
> -##
> -{ 'enum': 'CpuModelCompareResult',
> -  'data': [ 'incompatible', 'identical', 'superset', 'subset' ] }
> -
> -##
> -# @CpuModelCompareInfo:
> -#
> -# The result of a CPU model comparison.
> -#
> -# @result: The result of the compare operation.
> -# @responsible-properties: List of properties that led to the comparison result
> -#                          not being identical.
> -#
> -# @responsible-properties is a list of QOM property names that led to
> -# both CPUs not being detected as identical. For identical models, this
> -# list is empty.
> -# If a QOM property is read-only, that means there's no known way to make the
> -# CPU models identical. If the special property name "type" is included, the
> -# models are by definition not identical and cannot be made identical.
> -#
> -# Since: 2.8.0
> -##
> -{ 'struct': 'CpuModelCompareInfo',
> -  'data': {'result': 'CpuModelCompareResult',
> -           'responsible-properties': ['str']
> -          }
> -}
> -
> -##
> -# @query-cpu-model-comparison:
> -#
> -# Compares two CPU models, returning how they compare in a specific
> -# configuration. The results indicates how both models compare regarding
> -# runnability. This result can be used by tooling to make decisions if a
> -# certain CPU model will run in a certain configuration or if a compatible
> -# CPU model has to be created by baselining.
> -#
> -# Usually, a CPU model is compared against the maximum possible CPU model
> -# of a certain configuration (e.g. the "host" model for KVM). If that CPU
> -# model is identical or a subset, it will run in that configuration.
> -#
> -# The result returned by this command may be affected by:
> -#
> -# * QEMU version: CPU models may look different depending on the QEMU version.
> -#   (Except for CPU models reported as "static" in query-cpu-definitions.)
> -# * machine-type: CPU model may look different depending on the machine-type.
> -#   (Except for CPU models reported as "static" in query-cpu-definitions.)
> -# * machine options (including accelerator): in some architectures, CPU models
> -#   may look different depending on machine and accelerator options. (Except for
> -#   CPU models reported as "static" in query-cpu-definitions.)
> -# * "-cpu" arguments and global properties: arguments to the -cpu option and
> -#   global properties may affect expansion of CPU models. Using
> -#   query-cpu-model-expansion while using these is not advised.
> -#
> -# Some architectures may not support comparing CPU models. s390x supports
> -# comparing CPU models.
> -#
> -# Returns: a CpuModelBaselineInfo. Returns an error if comparing CPU models is
> -#          not supported, if a model cannot be used, if a model contains
> -#          an unknown cpu definition name, unknown properties or properties
> -#          with wrong types.
> -#
> -# Since: 2.8.0
> -##
> -{ 'command': 'query-cpu-model-comparison',
> -  'data': { 'modela': 'CpuModelInfo', 'modelb': 'CpuModelInfo' },
> -  'returns': 'CpuModelCompareInfo' }
> -
> -##
> -# @CpuModelBaselineInfo:
> -#
> -# The result of a CPU model baseline.
> -#
> -# @model: the baselined CpuModelInfo.
> -#
> -# Since: 2.8.0
> -##
> -{ 'struct': 'CpuModelBaselineInfo',
> -  'data': { 'model': 'CpuModelInfo' } }
> -
> -##
> -# @query-cpu-model-baseline:
> -#
> -# Baseline two CPU models, creating a compatible third model. The created
> -# model will always be a static, migration-safe CPU model (see "static"
> -# CPU model expansion for details).
> -#
> -# This interface can be used by tooling to create a compatible CPU model out
> -# two CPU models. The created CPU model will be identical to or a subset of
> -# both CPU models when comparing them. Therefore, the created CPU model is
> -# guaranteed to run where the given CPU models run.
> -#
> -# The result returned by this command may be affected by:
> -#
> -# * QEMU version: CPU models may look different depending on the QEMU version.
> -#   (Except for CPU models reported as "static" in query-cpu-definitions.)
> -# * machine-type: CPU model may look different depending on the machine-type.
> -#   (Except for CPU models reported as "static" in query-cpu-definitions.)
> -# * machine options (including accelerator): in some architectures, CPU models
> -#   may look different depending on machine and accelerator options. (Except for
> -#   CPU models reported as "static" in query-cpu-definitions.)
> -# * "-cpu" arguments and global properties: arguments to the -cpu option and
> -#   global properties may affect expansion of CPU models. Using
> -#   query-cpu-model-expansion while using these is not advised.
> -#
> -# Some architectures may not support baselining CPU models. s390x supports
> -# baselining CPU models.
> -#
> -# Returns: a CpuModelBaselineInfo. Returns an error if baselining CPU models is
> -#          not supported, if a model cannot be used, if a model contains
> -#          an unknown cpu definition name, unknown properties or properties
> -#          with wrong types.
> -#
> -# Since: 2.8.0
> -##
> -{ 'command': 'query-cpu-model-baseline',
> -  'data': { 'modela': 'CpuModelInfo',
> -            'modelb': 'CpuModelInfo' },
> -  'returns': 'CpuModelBaselineInfo' }
> -
> -##
> -# @AddfdInfo:
> -#
> -# Information about a file descriptor that was added to an fd set.
> -#
> -# @fdset-id: The ID of the fd set that @fd was added to.
> -#
> -# @fd: The file descriptor that was received via SCM rights and
> -#      added to the fd set.
> -#
> -# Since: 1.2.0
> -##
> -{ 'struct': 'AddfdInfo', 'data': {'fdset-id': 'int', 'fd': 'int'} }
> -
> -##
> -# @add-fd:
> -#
> -# Add a file descriptor, that was passed via SCM rights, to an fd set.
> -#
> -# @fdset-id: The ID of the fd set to add the file descriptor to.
> -#
> -# @opaque: A free-form string that can be used to describe the fd.
> -#
> -# Returns: @AddfdInfo on success
> -#
> -#          If file descriptor was not received, FdNotSupplied
> -#
> -#          If @fdset-id is a negative value, InvalidParameterValue
> -#
> -# Notes: The list of fd sets is shared by all monitor connections.
> -#
> -#        If @fdset-id is not specified, a new fd set will be created.
> -#
> -# Since: 1.2.0
> -#
> -# Example:
> -#
> -# -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
> -# <- { "return": { "fdset-id": 1, "fd": 3 } }
> -#
> -##
> -{ 'command': 'add-fd', 'data': {'*fdset-id': 'int', '*opaque': 'str'},
> -  'returns': 'AddfdInfo' }
> -
> -##
> -# @remove-fd:
> -#
> -# Remove a file descriptor from an fd set.
> -#
> -# @fdset-id: The ID of the fd set that the file descriptor belongs to.
> -#
> -# @fd: The file descriptor that is to be removed.
> -#
> -# Returns: Nothing on success
> -#          If @fdset-id or @fd is not found, FdNotFound
> -#
> -# Since: 1.2.0
> -#
> -# Notes: The list of fd sets is shared by all monitor connections.
> -#
> -#        If @fd is not specified, all file descriptors in @fdset-id
> -#        will be removed.
> -#
> -# Example:
> -#
> -# -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
> -# <- { "return": {} }
> -#
> -##
> -{ 'command': 'remove-fd', 'data': {'fdset-id': 'int', '*fd': 'int'} }
> -
> -##
> -# @FdsetFdInfo:
> -#
> -# Information about a file descriptor that belongs to an fd set.
> -#
> -# @fd: The file descriptor value.
> -#
> -# @opaque: A free-form string that can be used to describe the fd.
> -#
> -# Since: 1.2.0
> -##
> -{ 'struct': 'FdsetFdInfo',
> -  'data': {'fd': 'int', '*opaque': 'str'} }
> -
> -##
> -# @FdsetInfo:
> -#
> -# Information about an fd set.
> -#
> -# @fdset-id: The ID of the fd set.
> -#
> -# @fds: A list of file descriptors that belong to this fd set.
> -#
> -# Since: 1.2.0
> -##
> -{ 'struct': 'FdsetInfo',
> -  'data': {'fdset-id': 'int', 'fds': ['FdsetFdInfo']} }
> -
> -##
> -# @query-fdsets:
> -#
> -# Return information describing all fd sets.
> -#
> -# Returns: A list of @FdsetInfo
> -#
> -# Since: 1.2.0
> -#
> -# Note: The list of fd sets is shared by all monitor connections.
> -#
> -# Example:
> -#
> -# -> { "execute": "query-fdsets" }
> -# <- { "return": [
> -#        {
> -#          "fds": [
> -#            {
> -#              "fd": 30,
> -#              "opaque": "rdonly:/path/to/file"
> -#            },
> -#            {
> -#              "fd": 24,
> -#              "opaque": "rdwr:/path/to/file"
> -#            }
> -#          ],
> -#          "fdset-id": 1
> -#        },
> -#        {
> -#          "fds": [
> -#            {
> -#              "fd": 28
> -#            },
> -#            {
> -#              "fd": 29
> -#            }
> -#          ],
> -#          "fdset-id": 0
> -#        }
> -#      ]
> -#    }
> -#
> -##
> -{ 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
> -
> -##
> -# @TargetInfo:
> -#
> -# Information describing the QEMU target.
> -#
> -# @arch: the target architecture (eg "x86_64", "i386", etc)
> -#
> -# Since: 1.2.0
> -##
> -{ 'struct': 'TargetInfo',
> -  'data': { 'arch': 'str' } }
> -
> -##
> -# @query-target:
> -#
> -# Return information about the target for this QEMU
> -#
> -# Returns: TargetInfo
> -#
> -# Since: 1.2.0
> -##
> -{ 'command': 'query-target', 'returns': 'TargetInfo' }
> -
> -##
> -# @AcpiTableOptions:
> -#
> -# Specify an ACPI table on the command line to load.
> -#
> -# At most one of @file and @data can be specified. The list of files specified
> -# by any one of them is loaded and concatenated in order. If both are omitted,
> -# @data is implied.
> -#
> -# Other fields / optargs can be used to override fields of the generic ACPI
> -# table header; refer to the ACPI specification 5.0, section 5.2.6 System
> -# Description Table Header. If a header field is not overridden, then the
> -# corresponding value from the concatenated blob is used (in case of @file), or
> -# it is filled in with a hard-coded value (in case of @data).
> -#
> -# String fields are copied into the matching ACPI member from lowest address
> -# upwards, and silently truncated / NUL-padded to length.
> -#
> -# @sig: table signature / identifier (4 bytes)
> -#
> -# @rev: table revision number (dependent on signature, 1 byte)
> -#
> -# @oem_id: OEM identifier (6 bytes)
> -#
> -# @oem_table_id: OEM table identifier (8 bytes)
> -#
> -# @oem_rev: OEM-supplied revision number (4 bytes)
> -#
> -# @asl_compiler_id: identifier of the utility that created the table
> -#                   (4 bytes)
> -#
> -# @asl_compiler_rev: revision number of the utility that created the
> -#                    table (4 bytes)
> -#
> -# @file: colon (:) separated list of pathnames to load and
> -#        concatenate as table data. The resultant binary blob is expected to
> -#        have an ACPI table header. At least one file is required. This field
> -#        excludes @data.
> -#
> -# @data: colon (:) separated list of pathnames to load and
> -#        concatenate as table data. The resultant binary blob must not have an
> -#        ACPI table header. At least one file is required. This field excludes
> -#        @file.
> -#
> -# Since: 1.5
> -##
> -{ 'struct': 'AcpiTableOptions',
> -  'data': {
> -    '*sig':               'str',
> -    '*rev':               'uint8',
> -    '*oem_id':            'str',
> -    '*oem_table_id':      'str',
> -    '*oem_rev':           'uint32',
> -    '*asl_compiler_id':   'str',
> -    '*asl_compiler_rev':  'uint32',
> -    '*file':              'str',
> -    '*data':              'str' }}
> -
> -##
> -# @CommandLineParameterType:
> -#
> -# Possible types for an option parameter.
> -#
> -# @string: accepts a character string
> -#
> -# @boolean: accepts "on" or "off"
> -#
> -# @number: accepts a number
> -#
> -# @size: accepts a number followed by an optional suffix (K)ilo,
> -#        (M)ega, (G)iga, (T)era
> -#
> -# Since: 1.5
> -##
> -{ 'enum': 'CommandLineParameterType',
> -  'data': ['string', 'boolean', 'number', 'size'] }
> -
> -##
> -# @CommandLineParameterInfo:
> -#
> -# Details about a single parameter of a command line option.
> -#
> -# @name: parameter name
> -#
> -# @type: parameter @CommandLineParameterType
> -#
> -# @help: human readable text string, not suitable for parsing.
> -#
> -# @default: default value string (since 2.1)
> -#
> -# Since: 1.5
> -##
> -{ 'struct': 'CommandLineParameterInfo',
> -  'data': { 'name': 'str',
> -            'type': 'CommandLineParameterType',
> -            '*help': 'str',
> -            '*default': 'str' } }
> -
> -##
> -# @CommandLineOptionInfo:
> -#
> -# Details about a command line option, including its list of parameter details
> -#
> -# @option: option name
> -#
> -# @parameters: an array of @CommandLineParameterInfo
> -#
> -# Since: 1.5
> -##
> -{ 'struct': 'CommandLineOptionInfo',
> -  'data': { 'option': 'str', 'parameters': ['CommandLineParameterInfo'] } }
> -
> -##
> -# @query-command-line-options:
> -#
> -# Query command line option schema.
> -#
> -# @option: option name
> -#
> -# Returns: list of @CommandLineOptionInfo for all options (or for the given
> -#          @option).  Returns an error if the given @option doesn't exist.
> -#
> -# Since: 1.5
> -#
> -# Example:
> -#
> -# -> { "execute": "query-command-line-options",
> -#      "arguments": { "option": "option-rom" } }
> -# <- { "return": [
> -#         {
> -#             "parameters": [
> -#                 {
> -#                     "name": "romfile",
> -#                     "type": "string"
> -#                 },
> -#                 {
> -#                     "name": "bootindex",
> -#                     "type": "number"
> -#                 }
> -#             ],
> -#             "option": "option-rom"
> -#         }
> -#      ]
> -#    }
> -#
> -##
> -{'command': 'query-command-line-options', 'data': { '*option': 'str' },
> - 'returns': ['CommandLineOptionInfo'] }
> -
> -##
> -# @X86CPURegister32:
> -#
> -# A X86 32-bit register
> -#
> -# Since: 1.5
> -##
> -{ 'enum': 'X86CPURegister32',
> -  'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
> -
> -##
> -# @X86CPUFeatureWordInfo:
> -#
> -# Information about a X86 CPU feature word
> -#
> -# @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word
> -#
> -# @cpuid-input-ecx: Input ECX value for CPUID instruction for that
> -#                   feature word
> -#
> -# @cpuid-register: Output register containing the feature bits
> -#
> -# @features: value of output register, containing the feature bits
> -#
> -# Since: 1.5
> -##
> -{ 'struct': 'X86CPUFeatureWordInfo',
> -  'data': { 'cpuid-input-eax': 'int',
> -            '*cpuid-input-ecx': 'int',
> -            'cpuid-register': 'X86CPURegister32',
> -            'features': 'int' } }
> -
> -##
> -# @DummyForceArrays:
> -#
> -# Not used by QMP; hack to let us use X86CPUFeatureWordInfoList internally
> -#
> -# Since: 2.5
> -##
> -{ 'struct': 'DummyForceArrays',
> -  'data': { 'unused': ['X86CPUFeatureWordInfo'] } }
> -
> -
> -##
> -# @NumaOptionsType:
> -#
> -# @node: NUMA nodes configuration
> -#
> -# @dist: NUMA distance configuration (since 2.10)
> -#
> -# @cpu: property based CPU(s) to node mapping (Since: 2.10)
> -#
> -# Since: 2.1
> -##
> -{ 'enum': 'NumaOptionsType',
> -  'data': [ 'node', 'dist', 'cpu' ] }
> -
> -##
> -# @NumaOptions:
> -#
> -# A discriminated record of NUMA options. (for OptsVisitor)
> -#
> -# Since: 2.1
> -##
> -{ 'union': 'NumaOptions',
> -  'base': { 'type': 'NumaOptionsType' },
> -  'discriminator': 'type',
> -  'data': {
> -    'node': 'NumaNodeOptions',
> -    'dist': 'NumaDistOptions',
> -    'cpu': 'NumaCpuOptions' }}
> -
> -##
> -# @NumaNodeOptions:
> -#
> -# Create a guest NUMA node. (for OptsVisitor)
> -#
> -# @nodeid: NUMA node ID (increase by 1 from 0 if omitted)
> -#
> -# @cpus: VCPUs belonging to this node (assign VCPUS round-robin
> -#         if omitted)
> -#
> -# @mem: memory size of this node; mutually exclusive with @memdev.
> -#       Equally divide total memory among nodes if both @mem and @memdev are
> -#       omitted.
> -#
> -# @memdev: memory backend object.  If specified for one node,
> -#          it must be specified for all nodes.
> -#
> -# Since: 2.1
> -##
> -{ 'struct': 'NumaNodeOptions',
> -  'data': {
> -   '*nodeid': 'uint16',
> -   '*cpus':   ['uint16'],
> -   '*mem':    'size',
> -   '*memdev': 'str' }}
> -
> -##
> -# @NumaDistOptions:
> -#
> -# Set the distance between 2 NUMA nodes.
> -#
> -# @src: source NUMA node.
> -#
> -# @dst: destination NUMA node.
> -#
> -# @val: NUMA distance from source node to destination node.
> -#       When a node is unreachable from another node, set the distance
> -#       between them to 255.
> -#
> -# Since: 2.10
> -##
> -{ 'struct': 'NumaDistOptions',
> -  'data': {
> -   'src': 'uint16',
> -   'dst': 'uint16',
> -   'val': 'uint8' }}
> -
> -##
> -# @NumaCpuOptions:
> -#
> -# Option "-numa cpu" overrides default cpu to node mapping.
> -# It accepts the same set of cpu properties as returned by
> -# query-hotpluggable-cpus[].props, where node-id could be used to
> -# override default node mapping.
> -#
> -# Since: 2.10
> -##
> -{ 'struct': 'NumaCpuOptions',
> -   'base': 'CpuInstanceProperties',
> -   'data' : {} }
> -
> -##
> -# @HostMemPolicy:
> -#
> -# Host memory policy types
> -#
> -# @default: restore default policy, remove any nondefault policy
> -#
> -# @preferred: set the preferred host nodes for allocation
> -#
> -# @bind: a strict policy that restricts memory allocation to the
> -#        host nodes specified
> -#
> -# @interleave: memory allocations are interleaved across the set
> -#              of host nodes specified
> -#
> -# Since: 2.1
> -##
> -{ 'enum': 'HostMemPolicy',
> -  'data': [ 'default', 'preferred', 'bind', 'interleave' ] }
> -
> -##
> -# @Memdev:
> -#
> -# Information about memory backend
> -#
> -# @id: backend's ID if backend has 'id' property (since 2.9)
> -#
> -# @size: memory backend size
> -#
> -# @merge: enables or disables memory merge support
> -#
> -# @dump: includes memory backend's memory in a core dump or not
> -#
> -# @prealloc: enables or disables memory preallocation
> -#
> -# @host-nodes: host nodes for its memory policy
> -#
> -# @policy: memory policy of memory backend
> -#
> -# Since: 2.1
> -##
> -{ 'struct': 'Memdev',
> -  'data': {
> -    '*id':        'str',
> -    'size':       'size',
> -    'merge':      'bool',
> -    'dump':       'bool',
> -    'prealloc':   'bool',
> -    'host-nodes': ['uint16'],
> -    'policy':     'HostMemPolicy' }}
> -
> -##
> -# @query-memdev:
> -#
> -# Returns information for all memory backends.
> -#
> -# Returns: a list of @Memdev.
> -#
> -# Since: 2.1
> -#
> -# Example:
> -#
> -# -> { "execute": "query-memdev" }
> -# <- { "return": [
> -#        {
> -#          "id": "mem1",
> -#          "size": 536870912,
> -#          "merge": false,
> -#          "dump": true,
> -#          "prealloc": false,
> -#          "host-nodes": [0, 1],
> -#          "policy": "bind"
> -#        },
> -#        {
> -#          "size": 536870912,
> -#          "merge": false,
> -#          "dump": true,
> -#          "prealloc": true,
> -#          "host-nodes": [2, 3],
> -#          "policy": "preferred"
> -#        }
> -#      ]
> -#    }
> -#
> -##
> -{ 'command': 'query-memdev', 'returns': ['Memdev'] }
> -
> -##
> -# @PCDIMMDeviceInfo:
> -#
> -# PCDIMMDevice state information
> -#
> -# @id: device's ID
> -#
> -# @addr: physical address, where device is mapped
> -#
> -# @size: size of memory that the device provides
> -#
> -# @slot: slot number at which device is plugged in
> -#
> -# @node: NUMA node number where device is plugged in
> -#
> -# @memdev: memory backend linked with device
> -#
> -# @hotplugged: true if device was hotplugged
> -#
> -# @hotpluggable: true if device if could be added/removed while machine is running
> -#
> -# Since: 2.1
> -##
> -{ 'struct': 'PCDIMMDeviceInfo',
> -  'data': { '*id': 'str',
> -            'addr': 'int',
> -            'size': 'int',
> -            'slot': 'int',
> -            'node': 'int',
> -            'memdev': 'str',
> -            'hotplugged': 'bool',
> -            'hotpluggable': 'bool'
> -          }
> -}
> -
> -##
> -# @MemoryDeviceInfo:
> -#
> -# Union containing information about a memory device
> -#
> -# Since: 2.1
> -##
> -{ 'union': 'MemoryDeviceInfo', 'data': {'dimm': 'PCDIMMDeviceInfo'} }
> -
> -##
> -# @query-memory-devices:
> -#
> -# Lists available memory devices and their state
> -#
> -# Since: 2.1
> -#
> -# Example:
> -#
> -# -> { "execute": "query-memory-devices" }
> -# <- { "return": [ { "data":
> -#                       { "addr": 5368709120,
> -#                         "hotpluggable": true,
> -#                         "hotplugged": true,
> -#                         "id": "d1",
> -#                         "memdev": "/objects/memX",
> -#                         "node": 0,
> -#                         "size": 1073741824,
> -#                         "slot": 0},
> -#                    "type": "dimm"
> -#                  } ] }
> -#
> -##
> -{ 'command': 'query-memory-devices', 'returns': ['MemoryDeviceInfo'] }
> -
> -##
> -# @MEM_UNPLUG_ERROR:
> -#
> -# Emitted when memory hot unplug error occurs.
> -#
> -# @device: device name
> -#
> -# @msg: Informative message
> -#
> -# Since: 2.4
> -#
> -# Example:
> -#
> -# <- { "event": "MEM_UNPLUG_ERROR"
> -#      "data": { "device": "dimm1",
> -#                "msg": "acpi: device unplug for unsupported device"
> -#      },
> -#      "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
> -#
> -##
> -{ 'event': 'MEM_UNPLUG_ERROR',
> -  'data': { 'device': 'str', 'msg': 'str' } }
> -
> -##
> -# @ACPISlotType:
> -#
> -# @DIMM: memory slot
> -# @CPU: logical CPU slot (since 2.7)
> -##
> -{ 'enum': 'ACPISlotType', 'data': [ 'DIMM', 'CPU' ] }
> -
> -##
> -# @ACPIOSTInfo:
> -#
> -# OSPM Status Indication for a device
> -# For description of possible values of @source and @status fields
> -# see "_OST (OSPM Status Indication)" chapter of ACPI5.0 spec.
> -#
> -# @device: device ID associated with slot
> -#
> -# @slot: slot ID, unique per slot of a given @slot-type
> -#
> -# @slot-type: type of the slot
> -#
> -# @source: an integer containing the source event
> -#
> -# @status: an integer containing the status code
> -#
> -# Since: 2.1
> -##
> -{ 'struct': 'ACPIOSTInfo',
> -  'data'  : { '*device': 'str',
> -              'slot': 'str',
> -              'slot-type': 'ACPISlotType',
> -              'source': 'int',
> -              'status': 'int' } }
> -
> -##
> -# @query-acpi-ospm-status:
> -#
> -# Return a list of ACPIOSTInfo for devices that support status
> -# reporting via ACPI _OST method.
> -#
> -# Since: 2.1
> -#
> -# Example:
> -#
> -# -> { "execute": "query-acpi-ospm-status" }
> -# <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
> -#                  { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
> -#                  { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
> -#                  { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
> -#    ]}
> -#
> -##
> -{ 'command': 'query-acpi-ospm-status', 'returns': ['ACPIOSTInfo'] }
> -
> -##
> -# @ACPI_DEVICE_OST:
> -#
> -# Emitted when guest executes ACPI _OST method.
> -#
> -# @info: ACPIOSTInfo type as described in qapi-schema.json
> -#
> -# Since: 2.1
> -#
> -# Example:
> -#
> -# <- { "event": "ACPI_DEVICE_OST",
> -#      "data": { "device": "d1", "slot": "0",
> -#                "slot-type": "DIMM", "source": 1, "status": 0 } }
> -#
> -##
> -{ 'event': 'ACPI_DEVICE_OST',
> -     'data': { 'info': 'ACPIOSTInfo' } }
> -
> -##
> -# @rtc-reset-reinjection:
> -#
> -# This command will reset the RTC interrupt reinjection backlog.
> -# Can be used if another mechanism to synchronize guest time
> -# is in effect, for example QEMU guest agent's guest-set-time
> -# command.
> -#
> -# Since: 2.1
> -#
> -# Example:
> -#
> -# -> { "execute": "rtc-reset-reinjection" }
> -# <- { "return": {} }
> -#
> -##
> -{ 'command': 'rtc-reset-reinjection' }
> -
> -##
> -# @RTC_CHANGE:
> -#
> -# Emitted when the guest changes the RTC time.
> -#
> -# @offset: offset between base RTC clock (as specified by -rtc base), and
> -#          new RTC clock value
> -#
> -# Note: This event is rate-limited.
> -#
> -# Since: 0.13.0
> -#
> -# Example:
> -#
> -# <-   { "event": "RTC_CHANGE",
> -#        "data": { "offset": 78 },
> -#        "timestamp": { "seconds": 1267020223, "microseconds": 435656 } }
> -#
> -##
> -{ 'event': 'RTC_CHANGE',
> -  'data': { 'offset': 'int' } }
> -
> -##
> -# @ReplayMode:
> -#
> -# Mode of the replay subsystem.
> -#
> -# @none: normal execution mode. Replay or record are not enabled.
> -#
> -# @record: record mode. All non-deterministic data is written into the
> -#          replay log.
> -#
> -# @play: replay mode. Non-deterministic data required for system execution
> -#        is read from the log.
> -#
> -# Since: 2.5
> -##
> -{ 'enum': 'ReplayMode',
> -  'data': [ 'none', 'record', 'play' ] }
> -
> -##
> -# @xen-load-devices-state:
> -#
> -# Load the state of all devices from file. The RAM and the block devices
> -# of the VM are not loaded by this command.
> -#
> -# @filename: the file to load the state of the devices from as binary
> -# data. See xen-save-devices-state.txt for a description of the binary
> -# format.
> -#
> -# Since: 2.7
> -#
> -# Example:
> -#
> -# -> { "execute": "xen-load-devices-state",
> -#      "arguments": { "filename": "/tmp/resume" } }
> -# <- { "return": {} }
> -#
> -##
> -{ 'command': 'xen-load-devices-state', 'data': {'filename': 'str'} }
> -
> -##
> -# @GICCapability:
> -#
> -# The struct describes capability for a specific GIC (Generic
> -# Interrupt Controller) version. These bits are not only decided by
> -# QEMU/KVM software version, but also decided by the hardware that
> -# the program is running upon.
> -#
> -# @version:  version of GIC to be described. Currently, only 2 and 3
> -#            are supported.
> -#
> -# @emulated: whether current QEMU/hardware supports emulated GIC
> -#            device in user space.
> -#
> -# @kernel:   whether current QEMU/hardware supports hardware
> -#            accelerated GIC device in kernel.
> -#
> -# Since: 2.6
> -##
> -{ 'struct': 'GICCapability',
> -  'data': { 'version': 'int',
> -            'emulated': 'bool',
> -            'kernel': 'bool' } }
> -
> -##
> -# @query-gic-capabilities:
> -#
> -# This command is ARM-only. It will return a list of GICCapability
> -# objects that describe its capability bits.
> -#
> -# Returns: a list of GICCapability objects.
> -#
> -# Since: 2.6
> -#
> -# Example:
> -#
> -# -> { "execute": "query-gic-capabilities" }
> -# <- { "return": [{ "version": 2, "emulated": true, "kernel": false },
> -#                 { "version": 3, "emulated": false, "kernel": true } ] }
> -#
> -##
> -{ 'command': 'query-gic-capabilities', 'returns': ['GICCapability'] }
> -
> -##
> -# @CpuInstanceProperties:
> -#
> -# List of properties to be used for hotplugging a CPU instance,
> -# it should be passed by management with device_add command when
> -# a CPU is being hotplugged.
> -#
> -# @node-id: NUMA node ID the CPU belongs to
> -# @socket-id: socket number within node/board the CPU belongs to
> -# @core-id: core number within socket the CPU belongs to
> -# @thread-id: thread number within core the CPU belongs to
> -#
> -# Note: currently there are 4 properties that could be present
> -# but management should be prepared to pass through other
> -# properties with device_add command to allow for future
> -# interface extension. This also requires the filed names to be kept in
> -# sync with the properties passed to -device/device_add.
> -#
> -# Since: 2.7
> -##
> -{ 'struct': 'CpuInstanceProperties',
> -  'data': { '*node-id': 'int',
> -            '*socket-id': 'int',
> -            '*core-id': 'int',
> -            '*thread-id': 'int'
> -  }
> -}
> -
> -##
> -# @HotpluggableCPU:
> -#
> -# @type: CPU object type for usage with device_add command
> -# @props: list of properties to be used for hotplugging CPU
> -# @vcpus-count: number of logical VCPU threads @HotpluggableCPU provides
> -# @qom-path: link to existing CPU object if CPU is present or
> -#            omitted if CPU is not present.
> -#
> -# Since: 2.7
> -##
> -{ 'struct': 'HotpluggableCPU',
> -  'data': { 'type': 'str',
> -            'vcpus-count': 'int',
> -            'props': 'CpuInstanceProperties',
> -            '*qom-path': 'str'
> -          }
> -}
> -
> -##
> -# @query-hotpluggable-cpus:
> -#
> -# Returns: a list of HotpluggableCPU objects.
> -#
> -# Since: 2.7
> -#
> -# Example:
> -#
> -# For pseries machine type started with -smp 2,cores=2,maxcpus=4 -cpu POWER8:
> -#
> -# -> { "execute": "query-hotpluggable-cpus" }
> -# <- {"return": [
> -#      { "props": { "core": 8 }, "type": "POWER8-spapr-cpu-core",
> -#        "vcpus-count": 1 },
> -#      { "props": { "core": 0 }, "type": "POWER8-spapr-cpu-core",
> -#        "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
> -#    ]}'
> -#
> -# For pc machine type started with -smp 1,maxcpus=2:
> -#
> -# -> { "execute": "query-hotpluggable-cpus" }
> -# <- {"return": [
> -#      {
> -#         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
> -#         "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
> -#      },
> -#      {
> -#         "qom-path": "/machine/unattached/device[0]",
> -#         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
> -#         "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}
> -#      }
> -#    ]}
> -#
> -# For s390x-virtio-ccw machine type started with -smp 1,maxcpus=2 -cpu qemu
> -# (Since: 2.11):
> -#
> -# -> { "execute": "query-hotpluggable-cpus" }
> -# <- {"return": [
> -#      {
> -#         "type": "qemu-s390x-cpu", "vcpus-count": 1,
> -#         "props": { "core-id": 1 }
> -#      },
> -#      {
> -#         "qom-path": "/machine/unattached/device[0]",
> -#         "type": "qemu-s390x-cpu", "vcpus-count": 1,
> -#         "props": { "core-id": 0 }
> -#      }
> -#    ]}
> -#
> -##
> -{ 'command': 'query-hotpluggable-cpus', 'returns': ['HotpluggableCPU'] }
> -
> -##
> -# @GuidInfo:
> -#
> -# GUID information.
> -#
> -# @guid: the globally unique identifier
> -#
> -# Since: 2.9
> -##
> -{ 'struct': 'GuidInfo', 'data': {'guid': 'str'} }
> -
> -##
> -# @query-vm-generation-id:
> -#
> -# Show Virtual Machine Generation ID
> -#
> -# Since: 2.9
> -##
> -{ 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' }
> -
> -##
> -# @watchdog-set-action:
> -#
> -# Set watchdog action
> -#
> -# Since: 2.11
> -##
> -{ 'command': 'watchdog-set-action', 'data' : {'action': 'WatchdogAction'} }
> +{ 'include': 'qapi/misc.json' }
> diff --git a/qapi/misc.json b/qapi/misc.json
> new file mode 100644
> index 0000000000..225631bf7d
> --- /dev/null
> +++ b/qapi/misc.json
> @@ -0,0 +1,3090 @@
> +# -*- Mode: Python -*-
> +#
> +
> +##
> +# = Miscellanea
> +##
> +
> +##
> +# @qmp_capabilities:
> +#
> +# Enable QMP capabilities.
> +#
> +# Arguments: None.
> +#
> +# Example:
> +#
> +# -> { "execute": "qmp_capabilities" }
> +# <- { "return": {} }
> +#
> +# Notes: This command is valid exactly when first connecting: it must be
> +# issued before any other command will be accepted, and will fail once the
> +# monitor is accepting other commands. (see qemu docs/interop/qmp-spec.txt)
> +#
> +# Since: 0.13
> +#
> +##
> +{ 'command': 'qmp_capabilities' }
> +
> +##
> +# @VersionTriple:
> +#
> +# A three-part version number.
> +#
> +# @major:  The major version number.
> +#
> +# @minor:  The minor version number.
> +#
> +# @micro:  The micro version number.
> +#
> +# Since: 2.4
> +##
> +{ 'struct': 'VersionTriple',
> +  'data': {'major': 'int', 'minor': 'int', 'micro': 'int'} }
> +
> +
> +##
> +# @VersionInfo:
> +#
> +# A description of QEMU's version.
> +#
> +# @qemu:        The version of QEMU.  By current convention, a micro
> +#               version of 50 signifies a development branch.  A micro version
> +#               greater than or equal to 90 signifies a release candidate for
> +#               the next minor version.  A micro version of less than 50
> +#               signifies a stable release.
> +#
> +# @package:     QEMU will always set this field to an empty string.  Downstream
> +#               versions of QEMU should set this to a non-empty string.  The
> +#               exact format depends on the downstream however it highly
> +#               recommended that a unique name is used.
> +#
> +# Since: 0.14.0
> +##
> +{ 'struct': 'VersionInfo',
> +  'data': {'qemu': 'VersionTriple', 'package': 'str'} }
> +
> +##
> +# @query-version:
> +#
> +# Returns the current version of QEMU.
> +#
> +# Returns:  A @VersionInfo object describing the current version of QEMU.
> +#
> +# Since: 0.14.0
> +#
> +# Example:
> +#
> +# -> { "execute": "query-version" }
> +# <- {
> +#       "return":{
> +#          "qemu":{
> +#             "major":0,
> +#             "minor":11,
> +#             "micro":5
> +#          },
> +#          "package":""
> +#       }
> +#    }
> +#
> +##
> +{ 'command': 'query-version', 'returns': 'VersionInfo' }
> +
> +##
> +# @CommandInfo:
> +#
> +# Information about a QMP command
> +#
> +# @name: The command name
> +#
> +# Since: 0.14.0
> +##
> +{ 'struct': 'CommandInfo', 'data': {'name': 'str'} }
> +
> +##
> +# @query-commands:
> +#
> +# Return a list of supported QMP commands by this server
> +#
> +# Returns: A list of @CommandInfo for all supported commands
> +#
> +# Since: 0.14.0
> +#
> +# Example:
> +#
> +# -> { "execute": "query-commands" }
> +# <- {
> +#      "return":[
> +#         {
> +#            "name":"query-balloon"
> +#         },
> +#         {
> +#            "name":"system_powerdown"
> +#         }
> +#      ]
> +#    }
> +#
> +# Note: This example has been shortened as the real response is too long.
> +#
> +##
> +{ 'command': 'query-commands', 'returns': ['CommandInfo'] }
> +
> +##
> +# @LostTickPolicy:
> +#
> +# Policy for handling lost ticks in timer devices.
> +#
> +# @discard: throw away the missed tick(s) and continue with future injection
> +#           normally.  Guest time may be delayed, unless the OS has explicit
> +#           handling of lost ticks
> +#
> +# @delay: continue to deliver ticks at the normal rate.  Guest time will be
> +#         delayed due to the late tick
> +#
> +# @merge: merge the missed tick(s) into one tick and inject.  Guest time
> +#         may be delayed, depending on how the OS reacts to the merging
> +#         of ticks
> +#
> +# @slew: deliver ticks at a higher rate to catch up with the missed tick. The
> +#        guest time should not be delayed once catchup is complete.
> +#
> +# Since: 2.0
> +##
> +{ 'enum': 'LostTickPolicy',
> +  'data': ['discard', 'delay', 'merge', 'slew' ] }
> +
> +##
> +# @add_client:
> +#
> +# Allow client connections for VNC, Spice and socket based
> +# character devices to be passed in to QEMU via SCM_RIGHTS.
> +#
> +# @protocol: protocol name. Valid names are "vnc", "spice" or the
> +#            name of a character device (eg. from -chardev id=XXXX)
> +#
> +# @fdname: file descriptor name previously passed via 'getfd' command
> +#
> +# @skipauth: whether to skip authentication. Only applies
> +#            to "vnc" and "spice" protocols
> +#
> +# @tls: whether to perform TLS. Only applies to the "spice"
> +#       protocol
> +#
> +# Returns: nothing on success.
> +#
> +# Since: 0.14.0
> +#
> +# Example:
> +#
> +# -> { "execute": "add_client", "arguments": { "protocol": "vnc",
> +#                                              "fdname": "myclient" } }
> +# <- { "return": {} }
> +#
> +##
> +{ 'command': 'add_client',
> +  'data': { 'protocol': 'str', 'fdname': 'str', '*skipauth': 'bool',
> +            '*tls': 'bool' } }
> +
> +##
> +# @NameInfo:
> +#
> +# Guest name information.
> +#
> +# @name: The name of the guest
> +#
> +# Since: 0.14.0
> +##
> +{ 'struct': 'NameInfo', 'data': {'*name': 'str'} }
> +
> +##
> +# @query-name:
> +#
> +# Return the name information of a guest.
> +#
> +# Returns: @NameInfo of the guest
> +#
> +# Since: 0.14.0
> +#
> +# Example:
> +#
> +# -> { "execute": "query-name" }
> +# <- { "return": { "name": "qemu-name" } }
> +#
> +##
> +{ 'command': 'query-name', 'returns': 'NameInfo' }
> +
> +##
> +# @KvmInfo:
> +#
> +# Information about support for KVM acceleration
> +#
> +# @enabled: true if KVM acceleration is active
> +#
> +# @present: true if KVM acceleration is built into this executable
> +#
> +# Since: 0.14.0
> +##
> +{ 'struct': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool'} }
> +
> +##
> +# @query-kvm:
> +#
> +# Returns information about KVM acceleration
> +#
> +# Returns: @KvmInfo
> +#
> +# Since: 0.14.0
> +#
> +# Example:
> +#
> +# -> { "execute": "query-kvm" }
> +# <- { "return": { "enabled": true, "present": true } }
> +#
> +##
> +{ 'command': 'query-kvm', 'returns': 'KvmInfo' }
> +
> +##
> +# @UuidInfo:
> +#
> +# Guest UUID information (Universally Unique Identifier).
> +#
> +# @UUID: the UUID of the guest
> +#
> +# Since: 0.14.0
> +#
> +# Notes: If no UUID was specified for the guest, a null UUID is returned.
> +##
> +{ 'struct': 'UuidInfo', 'data': {'UUID': 'str'} }
> +
> +##
> +# @query-uuid:
> +#
> +# Query the guest UUID information.
> +#
> +# Returns: The @UuidInfo for the guest
> +#
> +# Since: 0.14.0
> +#
> +# Example:
> +#
> +# -> { "execute": "query-uuid" }
> +# <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
> +#
> +##
> +{ 'command': 'query-uuid', 'returns': 'UuidInfo' }
> +
> +##
> +# @EventInfo:
> +#
> +# Information about a QMP event
> +#
> +# @name: The event name
> +#
> +# Since: 1.2.0
> +##
> +{ 'struct': 'EventInfo', 'data': {'name': 'str'} }
> +
> +##
> +# @query-events:
> +#
> +# Return a list of supported QMP events by this server
> +#
> +# Returns: A list of @EventInfo for all supported events
> +#
> +# Since: 1.2.0
> +#
> +# Example:
> +#
> +# -> { "execute": "query-events" }
> +# <- {
> +#      "return": [
> +#          {
> +#             "name":"SHUTDOWN"
> +#          },
> +#          {
> +#             "name":"RESET"
> +#          }
> +#       ]
> +#    }
> +#
> +# Note: This example has been shortened as the real response is too long.
> +#
> +##
> +{ 'command': 'query-events', 'returns': ['EventInfo'] }
> +
> +##
> +# @CpuInfoArch:
> +#
> +# An enumeration of cpu types that enable additional information during
> +# @query-cpus.
> +#
> +# Since: 2.6
> +##
> +{ 'enum': 'CpuInfoArch',
> +  'data': ['x86', 'sparc', 'ppc', 'mips', 'tricore', 'other' ] }
> +
> +##
> +# @CpuInfo:
> +#
> +# Information about a virtual CPU
> +#
> +# @CPU: the index of the virtual CPU
> +#
> +# @current: this only exists for backwards compatibility and should be ignored
> +#
> +# @halted: true if the virtual CPU is in the halt state.  Halt usually refers
> +#          to a processor specific low power mode.
> +#
> +# @qom_path: path to the CPU object in the QOM tree (since 2.4)
> +#
> +# @thread_id: ID of the underlying host thread
> +#
> +# @props: properties describing to which node/socket/core/thread
> +#         virtual CPU belongs to, provided if supported by board (since 2.10)
> +#
> +# @arch: architecture of the cpu, which determines which additional fields
> +#        will be listed (since 2.6)
> +#
> +# Since: 0.14.0
> +#
> +# Notes: @halted is a transient state that changes frequently.  By the time the
> +#        data is sent to the client, the guest may no longer be halted.
> +##
> +{ 'union': 'CpuInfo',
> +  'base': {'CPU': 'int', 'current': 'bool', 'halted': 'bool',
> +           'qom_path': 'str', 'thread_id': 'int',
> +           '*props': 'CpuInstanceProperties', 'arch': 'CpuInfoArch' },
> +  'discriminator': 'arch',
> +  'data': { 'x86': 'CpuInfoX86',
> +            'sparc': 'CpuInfoSPARC',
> +            'ppc': 'CpuInfoPPC',
> +            'mips': 'CpuInfoMIPS',
> +            'tricore': 'CpuInfoTricore',
> +            'other': 'CpuInfoOther' } }
> +
> +##
> +# @CpuInfoX86:
> +#
> +# Additional information about a virtual i386 or x86_64 CPU
> +#
> +# @pc: the 64-bit instruction pointer
> +#
> +# Since: 2.6
> +##
> +{ 'struct': 'CpuInfoX86', 'data': { 'pc': 'int' } }
> +
> +##
> +# @CpuInfoSPARC:
> +#
> +# Additional information about a virtual SPARC CPU
> +#
> +# @pc: the PC component of the instruction pointer
> +#
> +# @npc: the NPC component of the instruction pointer
> +#
> +# Since: 2.6
> +##
> +{ 'struct': 'CpuInfoSPARC', 'data': { 'pc': 'int', 'npc': 'int' } }
> +
> +##
> +# @CpuInfoPPC:
> +#
> +# Additional information about a virtual PPC CPU
> +#
> +# @nip: the instruction pointer
> +#
> +# Since: 2.6
> +##
> +{ 'struct': 'CpuInfoPPC', 'data': { 'nip': 'int' } }
> +
> +##
> +# @CpuInfoMIPS:
> +#
> +# Additional information about a virtual MIPS CPU
> +#
> +# @PC: the instruction pointer
> +#
> +# Since: 2.6
> +##
> +{ 'struct': 'CpuInfoMIPS', 'data': { 'PC': 'int' } }
> +
> +##
> +# @CpuInfoTricore:
> +#
> +# Additional information about a virtual Tricore CPU
> +#
> +# @PC: the instruction pointer
> +#
> +# Since: 2.6
> +##
> +{ 'struct': 'CpuInfoTricore', 'data': { 'PC': 'int' } }
> +
> +##
> +# @CpuInfoOther:
> +#
> +# No additional information is available about the virtual CPU
> +#
> +# Since: 2.6
> +#
> +##
> +{ 'struct': 'CpuInfoOther', 'data': { } }
> +
> +##
> +# @query-cpus:
> +#
> +# Returns a list of information about each virtual CPU.
> +#
> +# Returns: a list of @CpuInfo for each virtual CPU
> +#
> +# Since: 0.14.0
> +#
> +# Example:
> +#
> +# -> { "execute": "query-cpus" }
> +# <- { "return": [
> +#          {
> +#             "CPU":0,
> +#             "current":true,
> +#             "halted":false,
> +#             "qom_path":"/machine/unattached/device[0]",
> +#             "arch":"x86",
> +#             "pc":3227107138,
> +#             "thread_id":3134
> +#          },
> +#          {
> +#             "CPU":1,
> +#             "current":false,
> +#             "halted":true,
> +#             "qom_path":"/machine/unattached/device[2]",
> +#             "arch":"x86",
> +#             "pc":7108165,
> +#             "thread_id":3135
> +#          }
> +#       ]
> +#    }
> +#
> +##
> +{ 'command': 'query-cpus', 'returns': ['CpuInfo'] }
> +
> +##
> +# @IOThreadInfo:
> +#
> +# Information about an iothread
> +#
> +# @id: the identifier of the iothread
> +#
> +# @thread-id: ID of the underlying host thread
> +#
> +# @poll-max-ns: maximum polling time in ns, 0 means polling is disabled
> +#               (since 2.9)
> +#
> +# @poll-grow: how many ns will be added to polling time, 0 means that it's not
> +#             configured (since 2.9)
> +#
> +# @poll-shrink: how many ns will be removed from polling time, 0 means that
> +#               it's not configured (since 2.9)
> +#
> +# Since: 2.0
> +##
> +{ 'struct': 'IOThreadInfo',
> +  'data': {'id': 'str',
> +           'thread-id': 'int',
> +           'poll-max-ns': 'int',
> +           'poll-grow': 'int',
> +           'poll-shrink': 'int' } }
> +
> +##
> +# @query-iothreads:
> +#
> +# Returns a list of information about each iothread.
> +#
> +# Note: this list excludes the QEMU main loop thread, which is not declared
> +# using the -object iothread command-line option.  It is always the main thread
> +# of the process.
> +#
> +# Returns: a list of @IOThreadInfo for each iothread
> +#
> +# Since: 2.0
> +#
> +# Example:
> +#
> +# -> { "execute": "query-iothreads" }
> +# <- { "return": [
> +#          {
> +#             "id":"iothread0",
> +#             "thread-id":3134
> +#          },
> +#          {
> +#             "id":"iothread1",
> +#             "thread-id":3135
> +#          }
> +#       ]
> +#    }
> +#
> +##
> +{ 'command': 'query-iothreads', 'returns': ['IOThreadInfo'] }
> +
> +##
> +# @BalloonInfo:
> +#
> +# Information about the guest balloon device.
> +#
> +# @actual: the number of bytes the balloon currently contains
> +#
> +# Since: 0.14.0
> +#
> +##
> +{ 'struct': 'BalloonInfo', 'data': {'actual': 'int' } }
> +
> +##
> +# @query-balloon:
> +#
> +# Return information about the balloon device.
> +#
> +# Returns: @BalloonInfo on success
> +#
> +#          If the balloon driver is enabled but not functional because the KVM
> +#          kernel module cannot support it, KvmMissingCap
> +#
> +#          If no balloon device is present, DeviceNotActive
> +#
> +# Since: 0.14.0
> +#
> +# Example:
> +#
> +# -> { "execute": "query-balloon" }
> +# <- { "return": {
> +#          "actual": 1073741824,
> +#       }
> +#    }
> +#
> +##
> +{ 'command': 'query-balloon', 'returns': 'BalloonInfo' }
> +
> +##
> +# @BALLOON_CHANGE:
> +#
> +# Emitted when the guest changes the actual BALLOON level. This value is
> +# equivalent to the @actual field return by the 'query-balloon' command
> +#
> +# @actual: actual level of the guest memory balloon in bytes
> +#
> +# Note: this event is rate-limited.
> +#
> +# Since: 1.2
> +#
> +# Example:
> +#
> +# <- { "event": "BALLOON_CHANGE",
> +#      "data": { "actual": 944766976 },
> +#      "timestamp": { "seconds": 1267020223, "microseconds": 435656 } }
> +#
> +##
> +{ 'event': 'BALLOON_CHANGE',
> +  'data': { 'actual': 'int' } }
> +
> +##
> +# @PciMemoryRange:
> +#
> +# A PCI device memory region
> +#
> +# @base: the starting address (guest physical)
> +#
> +# @limit: the ending address (guest physical)
> +#
> +# Since: 0.14.0
> +##
> +{ 'struct': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} }
> +
> +##
> +# @PciMemoryRegion:
> +#
> +# Information about a PCI device I/O region.
> +#
> +# @bar: the index of the Base Address Register for this region
> +#
> +# @type: 'io' if the region is a PIO region
> +#        'memory' if the region is a MMIO region
> +#
> +# @size: memory size
> +#
> +# @prefetch: if @type is 'memory', true if the memory is prefetchable
> +#
> +# @mem_type_64: if @type is 'memory', true if the BAR is 64-bit
> +#
> +# Since: 0.14.0
> +##
> +{ 'struct': 'PciMemoryRegion',
> +  'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int',
> +           '*prefetch': 'bool', '*mem_type_64': 'bool' } }
> +
> +##
> +# @PciBusInfo:
> +#
> +# Information about a bus of a PCI Bridge device
> +#
> +# @number: primary bus interface number.  This should be the number of the
> +#          bus the device resides on.
> +#
> +# @secondary: secondary bus interface number.  This is the number of the
> +#             main bus for the bridge
> +#
> +# @subordinate: This is the highest number bus that resides below the
> +#               bridge.
> +#
> +# @io_range: The PIO range for all devices on this bridge
> +#
> +# @memory_range: The MMIO range for all devices on this bridge
> +#
> +# @prefetchable_range: The range of prefetchable MMIO for all devices on
> +#                      this bridge
> +#
> +# Since: 2.4
> +##
> +{ 'struct': 'PciBusInfo',
> +  'data': {'number': 'int', 'secondary': 'int', 'subordinate': 'int',
> +           'io_range': 'PciMemoryRange',
> +           'memory_range': 'PciMemoryRange',
> +           'prefetchable_range': 'PciMemoryRange' } }
> +
> +##
> +# @PciBridgeInfo:
> +#
> +# Information about a PCI Bridge device
> +#
> +# @bus: information about the bus the device resides on
> +#
> +# @devices: a list of @PciDeviceInfo for each device on this bridge
> +#
> +# Since: 0.14.0
> +##
> +{ 'struct': 'PciBridgeInfo',
> +  'data': {'bus': 'PciBusInfo', '*devices': ['PciDeviceInfo']} }
> +
> +##
> +# @PciDeviceClass:
> +#
> +# Information about the Class of a PCI device
> +#
> +# @desc: a string description of the device's class
> +#
> +# @class: the class code of the device
> +#
> +# Since: 2.4
> +##
> +{ 'struct': 'PciDeviceClass',
> +  'data': {'*desc': 'str', 'class': 'int'} }
> +
> +##
> +# @PciDeviceId:
> +#
> +# Information about the Id of a PCI device
> +#
> +# @device: the PCI device id
> +#
> +# @vendor: the PCI vendor id
> +#
> +# Since: 2.4
> +##
> +{ 'struct': 'PciDeviceId',
> +  'data': {'device': 'int', 'vendor': 'int'} }
> +
> +##
> +# @PciDeviceInfo:
> +#
> +# Information about a PCI device
> +#
> +# @bus: the bus number of the device
> +#
> +# @slot: the slot the device is located in
> +#
> +# @function: the function of the slot used by the device
> +#
> +# @class_info: the class of the device
> +#
> +# @id: the PCI device id
> +#
> +# @irq: if an IRQ is assigned to the device, the IRQ number
> +#
> +# @qdev_id: the device name of the PCI device
> +#
> +# @pci_bridge: if the device is a PCI bridge, the bridge information
> +#
> +# @regions: a list of the PCI I/O regions associated with the device
> +#
> +# Notes: the contents of @class_info.desc are not stable and should only be
> +#        treated as informational.
> +#
> +# Since: 0.14.0
> +##
> +{ 'struct': 'PciDeviceInfo',
> +  'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
> +           'class_info': 'PciDeviceClass', 'id': 'PciDeviceId',
> +           '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo',
> +           'regions': ['PciMemoryRegion']} }
> +
> +##
> +# @PciInfo:
> +#
> +# Information about a PCI bus
> +#
> +# @bus: the bus index
> +#
> +# @devices: a list of devices on this bus
> +#
> +# Since: 0.14.0
> +##
> +{ 'struct': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
> +
> +##
> +# @query-pci:
> +#
> +# Return information about the PCI bus topology of the guest.
> +#
> +# Returns: a list of @PciInfo for each PCI bus. Each bus is
> +# represented by a json-object, which has a key with a json-array of
> +# all PCI devices attached to it. Each device is represented by a
> +# json-object.
> +#
> +# Since: 0.14.0
> +#
> +# Example:
> +#
> +# -> { "execute": "query-pci" }
> +# <- { "return": [
> +#          {
> +#             "bus": 0,
> +#             "devices": [
> +#                {
> +#                   "bus": 0,
> +#                   "qdev_id": "",
> +#                   "slot": 0,
> +#                   "class_info": {
> +#                      "class": 1536,
> +#                      "desc": "Host bridge"
> +#                   },
> +#                   "id": {
> +#                      "device": 32902,
> +#                      "vendor": 4663
> +#                   },
> +#                   "function": 0,
> +#                   "regions": [
> +#                   ]
> +#                },
> +#                {
> +#                   "bus": 0,
> +#                   "qdev_id": "",
> +#                   "slot": 1,
> +#                   "class_info": {
> +#                      "class": 1537,
> +#                      "desc": "ISA bridge"
> +#                   },
> +#                   "id": {
> +#                      "device": 32902,
> +#                      "vendor": 28672
> +#                   },
> +#                   "function": 0,
> +#                   "regions": [
> +#                   ]
> +#                },
> +#                {
> +#                   "bus": 0,
> +#                   "qdev_id": "",
> +#                   "slot": 1,
> +#                   "class_info": {
> +#                      "class": 257,
> +#                      "desc": "IDE controller"
> +#                   },
> +#                   "id": {
> +#                      "device": 32902,
> +#                      "vendor": 28688
> +#                   },
> +#                   "function": 1,
> +#                   "regions": [
> +#                      {
> +#                         "bar": 4,
> +#                         "size": 16,
> +#                         "address": 49152,
> +#                         "type": "io"
> +#                      }
> +#                   ]
> +#                },
> +#                {
> +#                   "bus": 0,
> +#                   "qdev_id": "",
> +#                   "slot": 2,
> +#                   "class_info": {
> +#                      "class": 768,
> +#                      "desc": "VGA controller"
> +#                   },
> +#                   "id": {
> +#                      "device": 4115,
> +#                      "vendor": 184
> +#                   },
> +#                   "function": 0,
> +#                   "regions": [
> +#                      {
> +#                         "prefetch": true,
> +#                         "mem_type_64": false,
> +#                         "bar": 0,
> +#                         "size": 33554432,
> +#                         "address": 4026531840,
> +#                         "type": "memory"
> +#                      },
> +#                      {
> +#                         "prefetch": false,
> +#                         "mem_type_64": false,
> +#                         "bar": 1,
> +#                         "size": 4096,
> +#                         "address": 4060086272,
> +#                         "type": "memory"
> +#                      },
> +#                      {
> +#                         "prefetch": false,
> +#                         "mem_type_64": false,
> +#                         "bar": 6,
> +#                         "size": 65536,
> +#                         "address": -1,
> +#                         "type": "memory"
> +#                      }
> +#                   ]
> +#                },
> +#                {
> +#                   "bus": 0,
> +#                   "qdev_id": "",
> +#                   "irq": 11,
> +#                   "slot": 4,
> +#                   "class_info": {
> +#                      "class": 1280,
> +#                      "desc": "RAM controller"
> +#                   },
> +#                   "id": {
> +#                      "device": 6900,
> +#                      "vendor": 4098
> +#                   },
> +#                   "function": 0,
> +#                   "regions": [
> +#                      {
> +#                         "bar": 0,
> +#                         "size": 32,
> +#                         "address": 49280,
> +#                         "type": "io"
> +#                      }
> +#                   ]
> +#                }
> +#             ]
> +#          }
> +#       ]
> +#    }
> +#
> +# Note: This example has been shortened as the real response is too long.
> +#
> +##
> +{ 'command': 'query-pci', 'returns': ['PciInfo'] }
> +
> +##
> +# @quit:
> +#
> +# This command will cause the QEMU process to exit gracefully.  While every
> +# attempt is made to send the QMP response before terminating, this is not
> +# guaranteed.  When using this interface, a premature EOF would not be
> +# unexpected.
> +#
> +# Since: 0.14.0
> +#
> +# Example:
> +#
> +# -> { "execute": "quit" }
> +# <- { "return": {} }
> +##
> +{ 'command': 'quit' }
> +
> +##
> +# @stop:
> +#
> +# Stop all guest VCPU execution.
> +#
> +# Since:  0.14.0
> +#
> +# Notes:  This function will succeed even if the guest is already in the stopped
> +#         state.  In "inmigrate" state, it will ensure that the guest
> +#         remains paused once migration finishes, as if the -S option was
> +#         passed on the command line.
> +#
> +# Example:
> +#
> +# -> { "execute": "stop" }
> +# <- { "return": {} }
> +#
> +##
> +{ 'command': 'stop' }
> +
> +##
> +# @system_reset:
> +#
> +# Performs a hard reset of a guest.
> +#
> +# Since: 0.14.0
> +#
> +# Example:
> +#
> +# -> { "execute": "system_reset" }
> +# <- { "return": {} }
> +#
> +##
> +{ 'command': 'system_reset' }
> +
> +##
> +# @system_powerdown:
> +#
> +# Requests that a guest perform a powerdown operation.
> +#
> +# Since: 0.14.0
> +#
> +# Notes: A guest may or may not respond to this command.  This command
> +#        returning does not indicate that a guest has accepted the request or
> +#        that it has shut down.  Many guests will respond to this command by
> +#        prompting the user in some way.
> +# Example:
> +#
> +# -> { "execute": "system_powerdown" }
> +# <- { "return": {} }
> +#
> +##
> +{ 'command': 'system_powerdown' }
> +
> +##
> +# @cpu-add:
> +#
> +# Adds CPU with specified ID
> +#
> +# @id: ID of CPU to be created, valid values [0..max_cpus)
> +#
> +# Returns: Nothing on success
> +#
> +# Since: 1.5
> +#
> +# Example:
> +#
> +# -> { "execute": "cpu-add", "arguments": { "id": 2 } }
> +# <- { "return": {} }
> +#
> +##
> +{ 'command': 'cpu-add', 'data': {'id': 'int'} }
> +
> +##
> +# @memsave:
> +#
> +# Save a portion of guest memory to a file.
> +#
> +# @val: the virtual address of the guest to start from
> +#
> +# @size: the size of memory region to save
> +#
> +# @filename: the file to save the memory to as binary data
> +#
> +# @cpu-index: the index of the virtual CPU to use for translating the
> +#                       virtual address (defaults to CPU 0)
> +#
> +# Returns: Nothing on success
> +#
> +# Since: 0.14.0
> +#
> +# Notes: Errors were not reliably returned until 1.1
> +#
> +# Example:
> +#
> +# -> { "execute": "memsave",
> +#      "arguments": { "val": 10,
> +#                     "size": 100,
> +#                     "filename": "/tmp/virtual-mem-dump" } }
> +# <- { "return": {} }
> +#
> +##
> +{ 'command': 'memsave',
> +  'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
> +
> +##
> +# @pmemsave:
> +#
> +# Save a portion of guest physical memory to a file.
> +#
> +# @val: the physical address of the guest to start from
> +#
> +# @size: the size of memory region to save
> +#
> +# @filename: the file to save the memory to as binary data
> +#
> +# Returns: Nothing on success
> +#
> +# Since: 0.14.0
> +#
> +# Notes: Errors were not reliably returned until 1.1
> +#
> +# Example:
> +#
> +# -> { "execute": "pmemsave",
> +#      "arguments": { "val": 10,
> +#                     "size": 100,
> +#                     "filename": "/tmp/physical-mem-dump" } }
> +# <- { "return": {} }
> +#
> +##
> +{ 'command': 'pmemsave',
> +  'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
> +
> +##
> +# @cont:
> +#
> +# Resume guest VCPU execution.
> +#
> +# Since:  0.14.0
> +#
> +# Returns:  If successful, nothing
> +#
> +# Notes:  This command will succeed if the guest is currently running.  It
> +#         will also succeed if the guest is in the "inmigrate" state; in
> +#         this case, the effect of the command is to make sure the guest
> +#         starts once migration finishes, removing the effect of the -S
> +#         command line option if it was passed.
> +#
> +# Example:
> +#
> +# -> { "execute": "cont" }
> +# <- { "return": {} }
> +#
> +##
> +{ 'command': 'cont' }
> +
> +##
> +# @system_wakeup:
> +#
> +# Wakeup guest from suspend.  Does nothing in case the guest isn't suspended.
> +#
> +# Since:  1.1
> +#
> +# Returns:  nothing.
> +#
> +# Example:
> +#
> +# -> { "execute": "system_wakeup" }
> +# <- { "return": {} }
> +#
> +##
> +{ 'command': 'system_wakeup' }
> +
> +##
> +# @inject-nmi:
> +#
> +# Injects a Non-Maskable Interrupt into the default CPU (x86/s390) or all CPUs (ppc64).
> +# The command fails when the guest doesn't support injecting.
> +#
> +# Returns:  If successful, nothing
> +#
> +# Since:  0.14.0
> +#
> +# Note: prior to 2.1, this command was only supported for x86 and s390 VMs
> +#
> +# Example:
> +#
> +# -> { "execute": "inject-nmi" }
> +# <- { "return": {} }
> +#
> +##
> +{ 'command': 'inject-nmi' }
> +
> +##
> +# @balloon:
> +#
> +# Request the balloon driver to change its balloon size.
> +#
> +# @value: the target size of the balloon in bytes
> +#
> +# Returns: Nothing on success
> +#          If the balloon driver is enabled but not functional because the KVM
> +#            kernel module cannot support it, KvmMissingCap
> +#          If no balloon device is present, DeviceNotActive
> +#
> +# Notes: This command just issues a request to the guest.  When it returns,
> +#        the balloon size may not have changed.  A guest can change the balloon
> +#        size independent of this command.
> +#
> +# Since: 0.14.0
> +#
> +# Example:
> +#
> +# -> { "execute": "balloon", "arguments": { "value": 536870912 } }
> +# <- { "return": {} }
> +#
> +##
> +{ 'command': 'balloon', 'data': {'value': 'int'} }
> +
> +##
> +# @human-monitor-command:
> +#
> +# Execute a command on the human monitor and return the output.
> +#
> +# @command-line: the command to execute in the human monitor
> +#
> +# @cpu-index: The CPU to use for commands that require an implicit CPU
> +#
> +# Returns: the output of the command as a string
> +#
> +# Since: 0.14.0
> +#
> +# Notes: This command only exists as a stop-gap.  Its use is highly
> +#        discouraged.  The semantics of this command are not
> +#        guaranteed: this means that command names, arguments and
> +#        responses can change or be removed at ANY time.  Applications
> +#        that rely on long term stability guarantees should NOT
> +#        use this command.
> +#
> +#        Known limitations:
> +#
> +#        * This command is stateless, this means that commands that depend
> +#          on state information (such as getfd) might not work
> +#
> +#        * Commands that prompt the user for data don't currently work
> +#
> +# Example:
> +#
> +# -> { "execute": "human-monitor-command",
> +#      "arguments": { "command-line": "info kvm" } }
> +# <- { "return": "kvm support: enabled\r\n" }
> +#
> +##
> +{ 'command': 'human-monitor-command',
> +  'data': {'command-line': 'str', '*cpu-index': 'int'},
> +  'returns': 'str' }
> +
> +##
> +# @ObjectPropertyInfo:
> +#
> +# @name: the name of the property
> +#
> +# @type: the type of the property.  This will typically come in one of four
> +#        forms:
> +#
> +#        1) A primitive type such as 'u8', 'u16', 'bool', 'str', or 'double'.
> +#           These types are mapped to the appropriate JSON type.
> +#
> +#        2) A child type in the form 'child<subtype>' where subtype is a qdev
> +#           device type name.  Child properties create the composition tree.
> +#
> +#        3) A link type in the form 'link<subtype>' where subtype is a qdev
> +#           device type name.  Link properties form the device model graph.
> +#
> +# Since: 1.2
> +##
> +{ 'struct': 'ObjectPropertyInfo',
> +  'data': { 'name': 'str', 'type': 'str' } }
> +
> +##
> +# @qom-list:
> +#
> +# This command will list any properties of a object given a path in the object
> +# model.
> +#
> +# @path: the path within the object model.  See @qom-get for a description of
> +#        this parameter.
> +#
> +# Returns: a list of @ObjectPropertyInfo that describe the properties of the
> +#          object.
> +#
> +# Since: 1.2
> +##
> +{ 'command': 'qom-list',
> +  'data': { 'path': 'str' },
> +  'returns': [ 'ObjectPropertyInfo' ] }
> +
> +##
> +# @qom-get:
> +#
> +# This command will get a property from a object model path and return the
> +# value.
> +#
> +# @path: The path within the object model.  There are two forms of supported
> +#        paths--absolute and partial paths.
> +#
> +#        Absolute paths are derived from the root object and can follow child<>
> +#        or link<> properties.  Since they can follow link<> properties, they
> +#        can be arbitrarily long.  Absolute paths look like absolute filenames
> +#        and are prefixed  with a leading slash.
> +#
> +#        Partial paths look like relative filenames.  They do not begin
> +#        with a prefix.  The matching rules for partial paths are subtle but
> +#        designed to make specifying objects easy.  At each level of the
> +#        composition tree, the partial path is matched as an absolute path.
> +#        The first match is not returned.  At least two matches are searched
> +#        for.  A successful result is only returned if only one match is
> +#        found.  If more than one match is found, a flag is return to
> +#        indicate that the match was ambiguous.
> +#
> +# @property: The property name to read
> +#
> +# Returns: The property value.  The type depends on the property
> +#          type. child<> and link<> properties are returned as #str
> +#          pathnames.  All integer property types (u8, u16, etc) are
> +#          returned as #int.
> +#
> +# Since: 1.2
> +##
> +{ 'command': 'qom-get',
> +  'data': { 'path': 'str', 'property': 'str' },
> +  'returns': 'any' }
> +
> +##
> +# @qom-set:
> +#
> +# This command will set a property from a object model path.
> +#
> +# @path: see @qom-get for a description of this parameter
> +#
> +# @property: the property name to set
> +#
> +# @value: a value who's type is appropriate for the property type.  See @qom-get
> +#         for a description of type mapping.
> +#
> +# Since: 1.2
> +##
> +{ 'command': 'qom-set',
> +  'data': { 'path': 'str', 'property': 'str', 'value': 'any' } }
> +
> +##
> +# @change:
> +#
> +# This command is multiple commands multiplexed together.
> +#
> +# @device: This is normally the name of a block device but it may also be 'vnc'.
> +#          when it's 'vnc', then sub command depends on @target
> +#
> +# @target: If @device is a block device, then this is the new filename.
> +#          If @device is 'vnc', then if the value 'password' selects the vnc
> +#          change password command.   Otherwise, this specifies a new server URI
> +#          address to listen to for VNC connections.
> +#
> +# @arg:    If @device is a block device, then this is an optional format to open
> +#          the device with.
> +#          If @device is 'vnc' and @target is 'password', this is the new VNC
> +#          password to set.  See change-vnc-password for additional notes.
> +#
> +# Returns: Nothing on success.
> +#          If @device is not a valid block device, DeviceNotFound
> +#
> +# Notes:  This interface is deprecated, and it is strongly recommended that you
> +#         avoid using it.  For changing block devices, use
> +#         blockdev-change-medium; for changing VNC parameters, use
> +#         change-vnc-password.
> +#
> +# Since: 0.14.0
> +#
> +# Example:
> +#
> +# 1. Change a removable medium
> +#
> +# -> { "execute": "change",
> +#      "arguments": { "device": "ide1-cd0",
> +#                     "target": "/srv/images/Fedora-12-x86_64-DVD.iso" } }
> +# <- { "return": {} }
> +#
> +# 2. Change VNC password
> +#
> +# -> { "execute": "change",
> +#      "arguments": { "device": "vnc", "target": "password",
> +#                     "arg": "foobar1" } }
> +# <- { "return": {} }
> +#
> +##
> +{ 'command': 'change',
> +  'data': {'device': 'str', 'target': 'str', '*arg': 'str'} }
> +
> +##
> +# @ObjectTypeInfo:
> +#
> +# This structure describes a search result from @qom-list-types
> +#
> +# @name: the type name found in the search
> +#
> +# @abstract: the type is abstract and can't be directly instantiated.
> +#            Omitted if false. (since 2.10)
> +#
> +# @parent: Name of parent type, if any (since 2.10)
> +#
> +# Since: 1.1
> +##
> +{ 'struct': 'ObjectTypeInfo',
> +  'data': { 'name': 'str', '*abstract': 'bool', '*parent': 'str' } }
> +
> +##
> +# @qom-list-types:
> +#
> +# This command will return a list of types given search parameters
> +#
> +# @implements: if specified, only return types that implement this type name
> +#
> +# @abstract: if true, include abstract types in the results
> +#
> +# Returns: a list of @ObjectTypeInfo or an empty list if no results are found
> +#
> +# Since: 1.1
> +##
> +{ 'command': 'qom-list-types',
> +  'data': { '*implements': 'str', '*abstract': 'bool' },
> +  'returns': [ 'ObjectTypeInfo' ] }
> +
> +##
> +# @DevicePropertyInfo:
> +#
> +# Information about device properties.
> +#
> +# @name: the name of the property
> +# @type: the typename of the property
> +# @description: if specified, the description of the property.
> +#               (since 2.2)
> +#
> +# Since: 1.2
> +##
> +{ 'struct': 'DevicePropertyInfo',
> +  'data': { 'name': 'str', 'type': 'str', '*description': 'str' } }
> +
> +##
> +# @device-list-properties:
> +#
> +# List properties associated with a device.
> +#
> +# @typename: the type name of a device
> +#
> +# Returns: a list of DevicePropertyInfo describing a devices properties
> +#
> +# Since: 1.2
> +##
> +{ 'command': 'device-list-properties',
> +  'data': { 'typename': 'str'},
> +  'returns': [ 'DevicePropertyInfo' ] }
> +
> +##
> +# @xen-set-global-dirty-log:
> +#
> +# Enable or disable the global dirty log mode.
> +#
> +# @enable: true to enable, false to disable.
> +#
> +# Returns: nothing
> +#
> +# Since: 1.3
> +#
> +# Example:
> +#
> +# -> { "execute": "xen-set-global-dirty-log",
> +#      "arguments": { "enable": true } }
> +# <- { "return": {} }
> +#
> +##
> +{ 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
> +
> +##
> +# @device_add:
> +#
> +# @driver: the name of the new device's driver
> +#
> +# @bus: the device's parent bus (device tree path)
> +#
> +# @id: the device's ID, must be unique
> +#
> +# Additional arguments depend on the type.
> +#
> +# Add a device.
> +#
> +# Notes:
> +# 1. For detailed information about this command, please refer to the
> +#    'docs/qdev-device-use.txt' file.
> +#
> +# 2. It's possible to list device properties by running QEMU with the
> +#    "-device DEVICE,help" command-line argument, where DEVICE is the
> +#    device's name
> +#
> +# Example:
> +#
> +# -> { "execute": "device_add",
> +#      "arguments": { "driver": "e1000", "id": "net1",
> +#                     "bus": "pci.0",
> +#                     "mac": "52:54:00:12:34:56" } }
> +# <- { "return": {} }
> +#
> +# TODO: This command effectively bypasses QAPI completely due to its
> +# "additional arguments" business.  It shouldn't have been added to
> +# the schema in this form.  It should be qapified properly, or
> +# replaced by a properly qapified command.
> +#
> +# Since: 0.13
> +##
> +{ 'command': 'device_add',
> +  'data': {'driver': 'str', '*bus': 'str', '*id': 'str'},
> +  'gen': false } # so we can get the additional arguments
> +
> +##
> +# @device_del:
> +#
> +# Remove a device from a guest
> +#
> +# @id: the device's ID or QOM path
> +#
> +# Returns: Nothing on success
> +#          If @id is not a valid device, DeviceNotFound
> +#
> +# Notes: When this command completes, the device may not be removed from the
> +#        guest.  Hot removal is an operation that requires guest cooperation.
> +#        This command merely requests that the guest begin the hot removal
> +#        process.  Completion of the device removal process is signaled with a
> +#        DEVICE_DELETED event. Guest reset will automatically complete removal
> +#        for all devices.
> +#
> +# Since: 0.14.0
> +#
> +# Example:
> +#
> +# -> { "execute": "device_del",
> +#      "arguments": { "id": "net1" } }
> +# <- { "return": {} }
> +#
> +# -> { "execute": "device_del",
> +#      "arguments": { "id": "/machine/peripheral-anon/device[0]" } }
> +# <- { "return": {} }
> +#
> +##
> +{ 'command': 'device_del', 'data': {'id': 'str'} }
> +
> +##
> +# @DEVICE_DELETED:
> +#
> +# Emitted whenever the device removal completion is acknowledged by the guest.
> +# At this point, it's safe to reuse the specified device ID. Device removal can
> +# be initiated by the guest or by HMP/QMP commands.
> +#
> +# @device: device name
> +#
> +# @path: device path
> +#
> +# Since: 1.5
> +#
> +# Example:
> +#
> +# <- { "event": "DEVICE_DELETED",
> +#      "data": { "device": "virtio-net-pci-0",
> +#                "path": "/machine/peripheral/virtio-net-pci-0" },
> +#      "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
> +#
> +##
> +{ 'event': 'DEVICE_DELETED',
> +  'data': { '*device': 'str', 'path': 'str' } }
> +
> +##
> +# @DumpGuestMemoryFormat:
> +#
> +# An enumeration of guest-memory-dump's format.
> +#
> +# @elf: elf format
> +#
> +# @kdump-zlib: kdump-compressed format with zlib-compressed
> +#
> +# @kdump-lzo: kdump-compressed format with lzo-compressed
> +#
> +# @kdump-snappy: kdump-compressed format with snappy-compressed
> +#
> +# Since: 2.0
> +##
> +{ 'enum': 'DumpGuestMemoryFormat',
> +  'data': [ 'elf', 'kdump-zlib', 'kdump-lzo', 'kdump-snappy' ] }
> +
> +##
> +# @dump-guest-memory:
> +#
> +# Dump guest's memory to vmcore. It is a synchronous operation that can take
> +# very long depending on the amount of guest memory.
> +#
> +# @paging: if true, do paging to get guest's memory mapping. This allows
> +#          using gdb to process the core file.
> +#
> +#          IMPORTANT: this option can make QEMU allocate several gigabytes
> +#                     of RAM. This can happen for a large guest, or a
> +#                     malicious guest pretending to be large.
> +#
> +#          Also, paging=true has the following limitations:
> +#
> +#             1. The guest may be in a catastrophic state or can have corrupted
> +#                memory, which cannot be trusted
> +#             2. The guest can be in real-mode even if paging is enabled. For
> +#                example, the guest uses ACPI to sleep, and ACPI sleep state
> +#                goes in real-mode
> +#             3. Currently only supported on i386 and x86_64.
> +#
> +# @protocol: the filename or file descriptor of the vmcore. The supported
> +#            protocols are:
> +#
> +#            1. file: the protocol starts with "file:", and the following
> +#               string is the file's path.
> +#            2. fd: the protocol starts with "fd:", and the following string
> +#               is the fd's name.
> +#
> +# @detach: if true, QMP will return immediately rather than
> +#          waiting for the dump to finish. The user can track progress
> +#          using "query-dump". (since 2.6).
> +#
> +# @begin: if specified, the starting physical address.
> +#
> +# @length: if specified, the memory size, in bytes. If you don't
> +#          want to dump all guest's memory, please specify the start @begin
> +#          and @length
> +#
> +# @format: if specified, the format of guest memory dump. But non-elf
> +#          format is conflict with paging and filter, ie. @paging, @begin and
> +#          @length is not allowed to be specified with non-elf @format at the
> +#          same time (since 2.0)
> +#
> +# Note: All boolean arguments default to false
> +#
> +# Returns: nothing on success
> +#
> +# Since: 1.2
> +#
> +# Example:
> +#
> +# -> { "execute": "dump-guest-memory",
> +#      "arguments": { "protocol": "fd:dump" } }
> +# <- { "return": {} }
> +#
> +##
> +{ 'command': 'dump-guest-memory',
> +  'data': { 'paging': 'bool', 'protocol': 'str', '*detach': 'bool',
> +            '*begin': 'int', '*length': 'int',
> +            '*format': 'DumpGuestMemoryFormat'} }
> +
> +##
> +# @DumpStatus:
> +#
> +# Describe the status of a long-running background guest memory dump.
> +#
> +# @none: no dump-guest-memory has started yet.
> +#
> +# @active: there is one dump running in background.
> +#
> +# @completed: the last dump has finished successfully.
> +#
> +# @failed: the last dump has failed.
> +#
> +# Since: 2.6
> +##
> +{ 'enum': 'DumpStatus',
> +  'data': [ 'none', 'active', 'completed', 'failed' ] }
> +
> +##
> +# @DumpQueryResult:
> +#
> +# The result format for 'query-dump'.
> +#
> +# @status: enum of @DumpStatus, which shows current dump status
> +#
> +# @completed: bytes written in latest dump (uncompressed)
> +#
> +# @total: total bytes to be written in latest dump (uncompressed)
> +#
> +# Since: 2.6
> +##
> +{ 'struct': 'DumpQueryResult',
> +  'data': { 'status': 'DumpStatus',
> +            'completed': 'int',
> +            'total': 'int' } }
> +
> +##
> +# @query-dump:
> +#
> +# Query latest dump status.
> +#
> +# Returns: A @DumpStatus object showing the dump status.
> +#
> +# Since: 2.6
> +#
> +# Example:
> +#
> +# -> { "execute": "query-dump" }
> +# <- { "return": { "status": "active", "completed": 1024000,
> +#                  "total": 2048000 } }
> +#
> +##
> +{ 'command': 'query-dump', 'returns': 'DumpQueryResult' }
> +
> +##
> +# @DUMP_COMPLETED:
> +#
> +# Emitted when background dump has completed
> +#
> +# @result: DumpQueryResult type described in qapi-schema.json.
> +#
> +# @error: human-readable error string that provides
> +#         hint on why dump failed. Only presents on failure. The
> +#         user should not try to interpret the error string.
> +#
> +# Since: 2.6
> +#
> +# Example:
> +#
> +# { "event": "DUMP_COMPLETED",
> +#   "data": {"result": {"total": 1090650112, "status": "completed",
> +#                       "completed": 1090650112} } }
> +#
> +##
> +{ 'event': 'DUMP_COMPLETED' ,
> +  'data': { 'result': 'DumpQueryResult', '*error': 'str' } }
> +
> +##
> +# @DumpGuestMemoryCapability:
> +#
> +# A list of the available formats for dump-guest-memory
> +#
> +# Since: 2.0
> +##
> +{ 'struct': 'DumpGuestMemoryCapability',
> +  'data': {
> +      'formats': ['DumpGuestMemoryFormat'] } }
> +
> +##
> +# @query-dump-guest-memory-capability:
> +#
> +# Returns the available formats for dump-guest-memory
> +#
> +# Returns:  A @DumpGuestMemoryCapability object listing available formats for
> +#           dump-guest-memory
> +#
> +# Since: 2.0
> +#
> +# Example:
> +#
> +# -> { "execute": "query-dump-guest-memory-capability" }
> +# <- { "return": { "formats":
> +#                  ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
> +#
> +##
> +{ 'command': 'query-dump-guest-memory-capability',
> +  'returns': 'DumpGuestMemoryCapability' }
> +
> +##
> +# @dump-skeys:
> +#
> +# Dump guest's storage keys
> +#
> +# @filename: the path to the file to dump to
> +#
> +# This command is only supported on s390 architecture.
> +#
> +# Since: 2.5
> +#
> +# Example:
> +#
> +# -> { "execute": "dump-skeys",
> +#      "arguments": { "filename": "/tmp/skeys" } }
> +# <- { "return": {} }
> +#
> +##
> +{ 'command': 'dump-skeys',
> +  'data': { 'filename': 'str' } }
> +
> +##
> +# @object-add:
> +#
> +# Create a QOM object.
> +#
> +# @qom-type: the class name for the object to be created
> +#
> +# @id: the name of the new object
> +#
> +# @props: a dictionary of properties to be passed to the backend
> +#
> +# Returns: Nothing on success
> +#          Error if @qom-type is not a valid class name
> +#
> +# Since: 2.0
> +#
> +# Example:
> +#
> +# -> { "execute": "object-add",
> +#      "arguments": { "qom-type": "rng-random", "id": "rng1",
> +#                     "props": { "filename": "/dev/hwrng" } } }
> +# <- { "return": {} }
> +#
> +##
> +{ 'command': 'object-add',
> +  'data': {'qom-type': 'str', 'id': 'str', '*props': 'any'} }
> +
> +##
> +# @object-del:
> +#
> +# Remove a QOM object.
> +#
> +# @id: the name of the QOM object to remove
> +#
> +# Returns: Nothing on success
> +#          Error if @id is not a valid id for a QOM object
> +#
> +# Since: 2.0
> +#
> +# Example:
> +#
> +# -> { "execute": "object-del", "arguments": { "id": "rng1" } }
> +# <- { "return": {} }
> +#
> +##
> +{ 'command': 'object-del', 'data': {'id': 'str'} }
> +
> +##
> +# @getfd:
> +#
> +# Receive a file descriptor via SCM rights and assign it a name
> +#
> +# @fdname: file descriptor name
> +#
> +# Returns: Nothing on success
> +#
> +# Since: 0.14.0
> +#
> +# Notes: If @fdname already exists, the file descriptor assigned to
> +#        it will be closed and replaced by the received file
> +#        descriptor.
> +#
> +#        The 'closefd' command can be used to explicitly close the
> +#        file descriptor when it is no longer needed.
> +#
> +# Example:
> +#
> +# -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
> +# <- { "return": {} }
> +#
> +##
> +{ 'command': 'getfd', 'data': {'fdname': 'str'} }
> +
> +##
> +# @closefd:
> +#
> +# Close a file descriptor previously passed via SCM rights
> +#
> +# @fdname: file descriptor name
> +#
> +# Returns: Nothing on success
> +#
> +# Since: 0.14.0
> +#
> +# Example:
> +#
> +# -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
> +# <- { "return": {} }
> +#
> +##
> +{ 'command': 'closefd', 'data': {'fdname': 'str'} }
> +
> +##
> +# @MachineInfo:
> +#
> +# Information describing a machine.
> +#
> +# @name: the name of the machine
> +#
> +# @alias: an alias for the machine name
> +#
> +# @is-default: whether the machine is default
> +#
> +# @cpu-max: maximum number of CPUs supported by the machine type
> +#           (since 1.5.0)
> +#
> +# @hotpluggable-cpus: cpu hotplug via -device is supported (since 2.7.0)
> +#
> +# Since: 1.2.0
> +##
> +{ 'struct': 'MachineInfo',
> +  'data': { 'name': 'str', '*alias': 'str',
> +            '*is-default': 'bool', 'cpu-max': 'int',
> +            'hotpluggable-cpus': 'bool'} }
> +
> +##
> +# @query-machines:
> +#
> +# Return a list of supported machines
> +#
> +# Returns: a list of MachineInfo
> +#
> +# Since: 1.2.0
> +##
> +{ 'command': 'query-machines', 'returns': ['MachineInfo'] }
> +
> +##
> +# @CpuDefinitionInfo:
> +#
> +# Virtual CPU definition.
> +#
> +# @name: the name of the CPU definition
> +#
> +# @migration-safe: whether a CPU definition can be safely used for
> +#                  migration in combination with a QEMU compatibility machine
> +#                  when migrating between different QMU versions and between
> +#                  hosts with different sets of (hardware or software)
> +#                  capabilities. If not provided, information is not available
> +#                  and callers should not assume the CPU definition to be
> +#                  migration-safe. (since 2.8)
> +#
> +# @static: whether a CPU definition is static and will not change depending on
> +#          QEMU version, machine type, machine options and accelerator options.
> +#          A static model is always migration-safe. (since 2.8)
> +#
> +# @unavailable-features: List of properties that prevent
> +#                        the CPU model from running in the current
> +#                        host. (since 2.8)
> +# @typename: Type name that can be used as argument to @device-list-properties,
> +#            to introspect properties configurable using -cpu or -global.
> +#            (since 2.9)
> +#
> +# @unavailable-features is a list of QOM property names that
> +# represent CPU model attributes that prevent the CPU from running.
> +# If the QOM property is read-only, that means there's no known
> +# way to make the CPU model run in the current host. Implementations
> +# that choose not to provide specific information return the
> +# property name "type".
> +# If the property is read-write, it means that it MAY be possible
> +# to run the CPU model in the current host if that property is
> +# changed. Management software can use it as hints to suggest or
> +# choose an alternative for the user, or just to generate meaningful
> +# error messages explaining why the CPU model can't be used.
> +# If @unavailable-features is an empty list, the CPU model is
> +# runnable using the current host and machine-type.
> +# If @unavailable-features is not present, runnability
> +# information for the CPU is not available.
> +#
> +# Since: 1.2.0
> +##
> +{ 'struct': 'CpuDefinitionInfo',
> +  'data': { 'name': 'str', '*migration-safe': 'bool', 'static': 'bool',
> +            '*unavailable-features': [ 'str' ], 'typename': 'str' } }
> +
> +##
> +# @MemoryInfo:
> +#
> +# Actual memory information in bytes.
> +#
> +# @base-memory: size of "base" memory specified with command line
> +#               option -m.
> +#
> +# @plugged-memory: size of memory that can be hot-unplugged. This field
> +#                  is omitted if target doesn't support memory hotplug
> +#                  (i.e. CONFIG_MEM_HOTPLUG not defined on build time).
> +#
> +# Since: 2.11.0
> +##
> +{ 'struct': 'MemoryInfo',
> +  'data'  : { 'base-memory': 'size', '*plugged-memory': 'size' } }
> +
> +##
> +# @query-memory-size-summary:
> +#
> +# Return the amount of initially allocated and present hotpluggable (if
> +# enabled) memory in bytes.
> +#
> +# Example:
> +#
> +# -> { "execute": "query-memory-size-summary" }
> +# <- { "return": { "base-memory": 4294967296, "plugged-memory": 0 } }
> +#
> +# Since: 2.11.0
> +##
> +{ 'command': 'query-memory-size-summary', 'returns': 'MemoryInfo' }
> +
> +##
> +# @query-cpu-definitions:
> +#
> +# Return a list of supported virtual CPU definitions
> +#
> +# Returns: a list of CpuDefInfo
> +#
> +# Since: 1.2.0
> +##
> +{ 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'] }
> +
> +##
> +# @CpuModelInfo:
> +#
> +# Virtual CPU model.
> +#
> +# A CPU model consists of the name of a CPU definition, to which
> +# delta changes are applied (e.g. features added/removed). Most magic values
> +# that an architecture might require should be hidden behind the name.
> +# However, if required, architectures can expose relevant properties.
> +#
> +# @name: the name of the CPU definition the model is based on
> +# @props: a dictionary of QOM properties to be applied
> +#
> +# Since: 2.8.0
> +##
> +{ 'struct': 'CpuModelInfo',
> +  'data': { 'name': 'str',
> +            '*props': 'any' } }
> +
> +##
> +# @CpuModelExpansionType:
> +#
> +# An enumeration of CPU model expansion types.
> +#
> +# @static: Expand to a static CPU model, a combination of a static base
> +#          model name and property delta changes. As the static base model will
> +#          never change, the expanded CPU model will be the same, independant of
> +#          independent of QEMU version, machine type, machine options, and
> +#          accelerator options. Therefore, the resulting model can be used by
> +#          tooling without having to specify a compatibility machine - e.g. when
> +#          displaying the "host" model. static CPU models are migration-safe.
> +#
> +# @full: Expand all properties. The produced model is not guaranteed to be
> +#        migration-safe, but allows tooling to get an insight and work with
> +#        model details.
> +#
> +# Note: When a non-migration-safe CPU model is expanded in static mode, some
> +# features enabled by the CPU model may be omitted, because they can't be
> +# implemented by a static CPU model definition (e.g. cache info passthrough and
> +# PMU passthrough in x86). If you need an accurate representation of the
> +# features enabled by a non-migration-safe CPU model, use @full. If you need a
> +# static representation that will keep ABI compatibility even when changing QEMU
> +# version or machine-type, use @static (but keep in mind that some features may
> +# be omitted).
> +#
> +# Since: 2.8.0
> +##
> +{ 'enum': 'CpuModelExpansionType',
> +  'data': [ 'static', 'full' ] }
> +
> +
> +##
> +# @CpuModelExpansionInfo:
> +#
> +# The result of a cpu model expansion.
> +#
> +# @model: the expanded CpuModelInfo.
> +#
> +# Since: 2.8.0
> +##
> +{ 'struct': 'CpuModelExpansionInfo',
> +  'data': { 'model': 'CpuModelInfo' } }
> +
> +
> +##
> +# @query-cpu-model-expansion:
> +#
> +# Expands a given CPU model (or a combination of CPU model + additional options)
> +# to different granularities, allowing tooling to get an understanding what a
> +# specific CPU model looks like in QEMU under a certain configuration.
> +#
> +# This interface can be used to query the "host" CPU model.
> +#
> +# The data returned by this command may be affected by:
> +#
> +# * QEMU version: CPU models may look different depending on the QEMU version.
> +#   (Except for CPU models reported as "static" in query-cpu-definitions.)
> +# * machine-type: CPU model  may look different depending on the machine-type.
> +#   (Except for CPU models reported as "static" in query-cpu-definitions.)
> +# * machine options (including accelerator): in some architectures, CPU models
> +#   may look different depending on machine and accelerator options. (Except for
> +#   CPU models reported as "static" in query-cpu-definitions.)
> +# * "-cpu" arguments and global properties: arguments to the -cpu option and
> +#   global properties may affect expansion of CPU models. Using
> +#   query-cpu-model-expansion while using these is not advised.
> +#
> +# Some architectures may not support all expansion types. s390x supports
> +# "full" and "static".
> +#
> +# Returns: a CpuModelExpansionInfo. Returns an error if expanding CPU models is
> +#          not supported, if the model cannot be expanded, if the model contains
> +#          an unknown CPU definition name, unknown properties or properties
> +#          with a wrong type. Also returns an error if an expansion type is
> +#          not supported.
> +#
> +# Since: 2.8.0
> +##
> +{ 'command': 'query-cpu-model-expansion',
> +  'data': { 'type': 'CpuModelExpansionType',
> +            'model': 'CpuModelInfo' },
> +  'returns': 'CpuModelExpansionInfo' }
> +
> +##
> +# @CpuModelCompareResult:
> +#
> +# An enumeration of CPU model comparation results. The result is usually
> +# calculated using e.g. CPU features or CPU generations.
> +#
> +# @incompatible: If model A is incompatible to model B, model A is not
> +#                guaranteed to run where model B runs and the other way around.
> +#
> +# @identical: If model A is identical to model B, model A is guaranteed to run
> +#             where model B runs and the other way around.
> +#
> +# @superset: If model A is a superset of model B, model B is guaranteed to run
> +#            where model A runs. There are no guarantees about the other way.
> +#
> +# @subset: If model A is a subset of model B, model A is guaranteed to run
> +#          where model B runs. There are no guarantees about the other way.
> +#
> +# Since: 2.8.0
> +##
> +{ 'enum': 'CpuModelCompareResult',
> +  'data': [ 'incompatible', 'identical', 'superset', 'subset' ] }
> +
> +##
> +# @CpuModelCompareInfo:
> +#
> +# The result of a CPU model comparison.
> +#
> +# @result: The result of the compare operation.
> +# @responsible-properties: List of properties that led to the comparison result
> +#                          not being identical.
> +#
> +# @responsible-properties is a list of QOM property names that led to
> +# both CPUs not being detected as identical. For identical models, this
> +# list is empty.
> +# If a QOM property is read-only, that means there's no known way to make the
> +# CPU models identical. If the special property name "type" is included, the
> +# models are by definition not identical and cannot be made identical.
> +#
> +# Since: 2.8.0
> +##
> +{ 'struct': 'CpuModelCompareInfo',
> +  'data': {'result': 'CpuModelCompareResult',
> +           'responsible-properties': ['str']
> +          }
> +}
> +
> +##
> +# @query-cpu-model-comparison:
> +#
> +# Compares two CPU models, returning how they compare in a specific
> +# configuration. The results indicates how both models compare regarding
> +# runnability. This result can be used by tooling to make decisions if a
> +# certain CPU model will run in a certain configuration or if a compatible
> +# CPU model has to be created by baselining.
> +#
> +# Usually, a CPU model is compared against the maximum possible CPU model
> +# of a certain configuration (e.g. the "host" model for KVM). If that CPU
> +# model is identical or a subset, it will run in that configuration.
> +#
> +# The result returned by this command may be affected by:
> +#
> +# * QEMU version: CPU models may look different depending on the QEMU version.
> +#   (Except for CPU models reported as "static" in query-cpu-definitions.)
> +# * machine-type: CPU model may look different depending on the machine-type.
> +#   (Except for CPU models reported as "static" in query-cpu-definitions.)
> +# * machine options (including accelerator): in some architectures, CPU models
> +#   may look different depending on machine and accelerator options. (Except for
> +#   CPU models reported as "static" in query-cpu-definitions.)
> +# * "-cpu" arguments and global properties: arguments to the -cpu option and
> +#   global properties may affect expansion of CPU models. Using
> +#   query-cpu-model-expansion while using these is not advised.
> +#
> +# Some architectures may not support comparing CPU models. s390x supports
> +# comparing CPU models.
> +#
> +# Returns: a CpuModelBaselineInfo. Returns an error if comparing CPU models is
> +#          not supported, if a model cannot be used, if a model contains
> +#          an unknown cpu definition name, unknown properties or properties
> +#          with wrong types.
> +#
> +# Since: 2.8.0
> +##
> +{ 'command': 'query-cpu-model-comparison',
> +  'data': { 'modela': 'CpuModelInfo', 'modelb': 'CpuModelInfo' },
> +  'returns': 'CpuModelCompareInfo' }
> +
> +##
> +# @CpuModelBaselineInfo:
> +#
> +# The result of a CPU model baseline.
> +#
> +# @model: the baselined CpuModelInfo.
> +#
> +# Since: 2.8.0
> +##
> +{ 'struct': 'CpuModelBaselineInfo',
> +  'data': { 'model': 'CpuModelInfo' } }
> +
> +##
> +# @query-cpu-model-baseline:
> +#
> +# Baseline two CPU models, creating a compatible third model. The created
> +# model will always be a static, migration-safe CPU model (see "static"
> +# CPU model expansion for details).
> +#
> +# This interface can be used by tooling to create a compatible CPU model out
> +# two CPU models. The created CPU model will be identical to or a subset of
> +# both CPU models when comparing them. Therefore, the created CPU model is
> +# guaranteed to run where the given CPU models run.
> +#
> +# The result returned by this command may be affected by:
> +#
> +# * QEMU version: CPU models may look different depending on the QEMU version.
> +#   (Except for CPU models reported as "static" in query-cpu-definitions.)
> +# * machine-type: CPU model may look different depending on the machine-type.
> +#   (Except for CPU models reported as "static" in query-cpu-definitions.)
> +# * machine options (including accelerator): in some architectures, CPU models
> +#   may look different depending on machine and accelerator options. (Except for
> +#   CPU models reported as "static" in query-cpu-definitions.)
> +# * "-cpu" arguments and global properties: arguments to the -cpu option and
> +#   global properties may affect expansion of CPU models. Using
> +#   query-cpu-model-expansion while using these is not advised.
> +#
> +# Some architectures may not support baselining CPU models. s390x supports
> +# baselining CPU models.
> +#
> +# Returns: a CpuModelBaselineInfo. Returns an error if baselining CPU models is
> +#          not supported, if a model cannot be used, if a model contains
> +#          an unknown cpu definition name, unknown properties or properties
> +#          with wrong types.
> +#
> +# Since: 2.8.0
> +##
> +{ 'command': 'query-cpu-model-baseline',
> +  'data': { 'modela': 'CpuModelInfo',
> +            'modelb': 'CpuModelInfo' },
> +  'returns': 'CpuModelBaselineInfo' }
> +
> +##
> +# @AddfdInfo:
> +#
> +# Information about a file descriptor that was added to an fd set.
> +#
> +# @fdset-id: The ID of the fd set that @fd was added to.
> +#
> +# @fd: The file descriptor that was received via SCM rights and
> +#      added to the fd set.
> +#
> +# Since: 1.2.0
> +##
> +{ 'struct': 'AddfdInfo', 'data': {'fdset-id': 'int', 'fd': 'int'} }
> +
> +##
> +# @add-fd:
> +#
> +# Add a file descriptor, that was passed via SCM rights, to an fd set.
> +#
> +# @fdset-id: The ID of the fd set to add the file descriptor to.
> +#
> +# @opaque: A free-form string that can be used to describe the fd.
> +#
> +# Returns: @AddfdInfo on success
> +#
> +#          If file descriptor was not received, FdNotSupplied
> +#
> +#          If @fdset-id is a negative value, InvalidParameterValue
> +#
> +# Notes: The list of fd sets is shared by all monitor connections.
> +#
> +#        If @fdset-id is not specified, a new fd set will be created.
> +#
> +# Since: 1.2.0
> +#
> +# Example:
> +#
> +# -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
> +# <- { "return": { "fdset-id": 1, "fd": 3 } }
> +#
> +##
> +{ 'command': 'add-fd', 'data': {'*fdset-id': 'int', '*opaque': 'str'},
> +  'returns': 'AddfdInfo' }
> +
> +##
> +# @remove-fd:
> +#
> +# Remove a file descriptor from an fd set.
> +#
> +# @fdset-id: The ID of the fd set that the file descriptor belongs to.
> +#
> +# @fd: The file descriptor that is to be removed.
> +#
> +# Returns: Nothing on success
> +#          If @fdset-id or @fd is not found, FdNotFound
> +#
> +# Since: 1.2.0
> +#
> +# Notes: The list of fd sets is shared by all monitor connections.
> +#
> +#        If @fd is not specified, all file descriptors in @fdset-id
> +#        will be removed.
> +#
> +# Example:
> +#
> +# -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
> +# <- { "return": {} }
> +#
> +##
> +{ 'command': 'remove-fd', 'data': {'fdset-id': 'int', '*fd': 'int'} }
> +
> +##
> +# @FdsetFdInfo:
> +#
> +# Information about a file descriptor that belongs to an fd set.
> +#
> +# @fd: The file descriptor value.
> +#
> +# @opaque: A free-form string that can be used to describe the fd.
> +#
> +# Since: 1.2.0
> +##
> +{ 'struct': 'FdsetFdInfo',
> +  'data': {'fd': 'int', '*opaque': 'str'} }
> +
> +##
> +# @FdsetInfo:
> +#
> +# Information about an fd set.
> +#
> +# @fdset-id: The ID of the fd set.
> +#
> +# @fds: A list of file descriptors that belong to this fd set.
> +#
> +# Since: 1.2.0
> +##
> +{ 'struct': 'FdsetInfo',
> +  'data': {'fdset-id': 'int', 'fds': ['FdsetFdInfo']} }
> +
> +##
> +# @query-fdsets:
> +#
> +# Return information describing all fd sets.
> +#
> +# Returns: A list of @FdsetInfo
> +#
> +# Since: 1.2.0
> +#
> +# Note: The list of fd sets is shared by all monitor connections.
> +#
> +# Example:
> +#
> +# -> { "execute": "query-fdsets" }
> +# <- { "return": [
> +#        {
> +#          "fds": [
> +#            {
> +#              "fd": 30,
> +#              "opaque": "rdonly:/path/to/file"
> +#            },
> +#            {
> +#              "fd": 24,
> +#              "opaque": "rdwr:/path/to/file"
> +#            }
> +#          ],
> +#          "fdset-id": 1
> +#        },
> +#        {
> +#          "fds": [
> +#            {
> +#              "fd": 28
> +#            },
> +#            {
> +#              "fd": 29
> +#            }
> +#          ],
> +#          "fdset-id": 0
> +#        }
> +#      ]
> +#    }
> +#
> +##
> +{ 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
> +
> +##
> +# @TargetInfo:
> +#
> +# Information describing the QEMU target.
> +#
> +# @arch: the target architecture (eg "x86_64", "i386", etc)
> +#
> +# Since: 1.2.0
> +##
> +{ 'struct': 'TargetInfo',
> +  'data': { 'arch': 'str' } }
> +
> +##
> +# @query-target:
> +#
> +# Return information about the target for this QEMU
> +#
> +# Returns: TargetInfo
> +#
> +# Since: 1.2.0
> +##
> +{ 'command': 'query-target', 'returns': 'TargetInfo' }
> +
> +##
> +# @AcpiTableOptions:
> +#
> +# Specify an ACPI table on the command line to load.
> +#
> +# At most one of @file and @data can be specified. The list of files specified
> +# by any one of them is loaded and concatenated in order. If both are omitted,
> +# @data is implied.
> +#
> +# Other fields / optargs can be used to override fields of the generic ACPI
> +# table header; refer to the ACPI specification 5.0, section 5.2.6 System
> +# Description Table Header. If a header field is not overridden, then the
> +# corresponding value from the concatenated blob is used (in case of @file), or
> +# it is filled in with a hard-coded value (in case of @data).
> +#
> +# String fields are copied into the matching ACPI member from lowest address
> +# upwards, and silently truncated / NUL-padded to length.
> +#
> +# @sig: table signature / identifier (4 bytes)
> +#
> +# @rev: table revision number (dependent on signature, 1 byte)
> +#
> +# @oem_id: OEM identifier (6 bytes)
> +#
> +# @oem_table_id: OEM table identifier (8 bytes)
> +#
> +# @oem_rev: OEM-supplied revision number (4 bytes)
> +#
> +# @asl_compiler_id: identifier of the utility that created the table
> +#                   (4 bytes)
> +#
> +# @asl_compiler_rev: revision number of the utility that created the
> +#                    table (4 bytes)
> +#
> +# @file: colon (:) separated list of pathnames to load and
> +#        concatenate as table data. The resultant binary blob is expected to
> +#        have an ACPI table header. At least one file is required. This field
> +#        excludes @data.
> +#
> +# @data: colon (:) separated list of pathnames to load and
> +#        concatenate as table data. The resultant binary blob must not have an
> +#        ACPI table header. At least one file is required. This field excludes
> +#        @file.
> +#
> +# Since: 1.5
> +##
> +{ 'struct': 'AcpiTableOptions',
> +  'data': {
> +    '*sig':               'str',
> +    '*rev':               'uint8',
> +    '*oem_id':            'str',
> +    '*oem_table_id':      'str',
> +    '*oem_rev':           'uint32',
> +    '*asl_compiler_id':   'str',
> +    '*asl_compiler_rev':  'uint32',
> +    '*file':              'str',
> +    '*data':              'str' }}
> +
> +##
> +# @CommandLineParameterType:
> +#
> +# Possible types for an option parameter.
> +#
> +# @string: accepts a character string
> +#
> +# @boolean: accepts "on" or "off"
> +#
> +# @number: accepts a number
> +#
> +# @size: accepts a number followed by an optional suffix (K)ilo,
> +#        (M)ega, (G)iga, (T)era
> +#
> +# Since: 1.5
> +##
> +{ 'enum': 'CommandLineParameterType',
> +  'data': ['string', 'boolean', 'number', 'size'] }
> +
> +##
> +# @CommandLineParameterInfo:
> +#
> +# Details about a single parameter of a command line option.
> +#
> +# @name: parameter name
> +#
> +# @type: parameter @CommandLineParameterType
> +#
> +# @help: human readable text string, not suitable for parsing.
> +#
> +# @default: default value string (since 2.1)
> +#
> +# Since: 1.5
> +##
> +{ 'struct': 'CommandLineParameterInfo',
> +  'data': { 'name': 'str',
> +            'type': 'CommandLineParameterType',
> +            '*help': 'str',
> +            '*default': 'str' } }
> +
> +##
> +# @CommandLineOptionInfo:
> +#
> +# Details about a command line option, including its list of parameter details
> +#
> +# @option: option name
> +#
> +# @parameters: an array of @CommandLineParameterInfo
> +#
> +# Since: 1.5
> +##
> +{ 'struct': 'CommandLineOptionInfo',
> +  'data': { 'option': 'str', 'parameters': ['CommandLineParameterInfo'] } }
> +
> +##
> +# @query-command-line-options:
> +#
> +# Query command line option schema.
> +#
> +# @option: option name
> +#
> +# Returns: list of @CommandLineOptionInfo for all options (or for the given
> +#          @option).  Returns an error if the given @option doesn't exist.
> +#
> +# Since: 1.5
> +#
> +# Example:
> +#
> +# -> { "execute": "query-command-line-options",
> +#      "arguments": { "option": "option-rom" } }
> +# <- { "return": [
> +#         {
> +#             "parameters": [
> +#                 {
> +#                     "name": "romfile",
> +#                     "type": "string"
> +#                 },
> +#                 {
> +#                     "name": "bootindex",
> +#                     "type": "number"
> +#                 }
> +#             ],
> +#             "option": "option-rom"
> +#         }
> +#      ]
> +#    }
> +#
> +##
> +{'command': 'query-command-line-options', 'data': { '*option': 'str' },
> + 'returns': ['CommandLineOptionInfo'] }
> +
> +##
> +# @X86CPURegister32:
> +#
> +# A X86 32-bit register
> +#
> +# Since: 1.5
> +##
> +{ 'enum': 'X86CPURegister32',
> +  'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
> +
> +##
> +# @X86CPUFeatureWordInfo:
> +#
> +# Information about a X86 CPU feature word
> +#
> +# @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word
> +#
> +# @cpuid-input-ecx: Input ECX value for CPUID instruction for that
> +#                   feature word
> +#
> +# @cpuid-register: Output register containing the feature bits
> +#
> +# @features: value of output register, containing the feature bits
> +#
> +# Since: 1.5
> +##
> +{ 'struct': 'X86CPUFeatureWordInfo',
> +  'data': { 'cpuid-input-eax': 'int',
> +            '*cpuid-input-ecx': 'int',
> +            'cpuid-register': 'X86CPURegister32',
> +            'features': 'int' } }
> +
> +##
> +# @DummyForceArrays:
> +#
> +# Not used by QMP; hack to let us use X86CPUFeatureWordInfoList internally
> +#
> +# Since: 2.5
> +##
> +{ 'struct': 'DummyForceArrays',
> +  'data': { 'unused': ['X86CPUFeatureWordInfo'] } }
> +
> +
> +##
> +# @NumaOptionsType:
> +#
> +# @node: NUMA nodes configuration
> +#
> +# @dist: NUMA distance configuration (since 2.10)
> +#
> +# @cpu: property based CPU(s) to node mapping (Since: 2.10)
> +#
> +# Since: 2.1
> +##
> +{ 'enum': 'NumaOptionsType',
> +  'data': [ 'node', 'dist', 'cpu' ] }
> +
> +##
> +# @NumaOptions:
> +#
> +# A discriminated record of NUMA options. (for OptsVisitor)
> +#
> +# Since: 2.1
> +##
> +{ 'union': 'NumaOptions',
> +  'base': { 'type': 'NumaOptionsType' },
> +  'discriminator': 'type',
> +  'data': {
> +    'node': 'NumaNodeOptions',
> +    'dist': 'NumaDistOptions',
> +    'cpu': 'NumaCpuOptions' }}
> +
> +##
> +# @NumaNodeOptions:
> +#
> +# Create a guest NUMA node. (for OptsVisitor)
> +#
> +# @nodeid: NUMA node ID (increase by 1 from 0 if omitted)
> +#
> +# @cpus: VCPUs belonging to this node (assign VCPUS round-robin
> +#         if omitted)
> +#
> +# @mem: memory size of this node; mutually exclusive with @memdev.
> +#       Equally divide total memory among nodes if both @mem and @memdev are
> +#       omitted.
> +#
> +# @memdev: memory backend object.  If specified for one node,
> +#          it must be specified for all nodes.
> +#
> +# Since: 2.1
> +##
> +{ 'struct': 'NumaNodeOptions',
> +  'data': {
> +   '*nodeid': 'uint16',
> +   '*cpus':   ['uint16'],
> +   '*mem':    'size',
> +   '*memdev': 'str' }}
> +
> +##
> +# @NumaDistOptions:
> +#
> +# Set the distance between 2 NUMA nodes.
> +#
> +# @src: source NUMA node.
> +#
> +# @dst: destination NUMA node.
> +#
> +# @val: NUMA distance from source node to destination node.
> +#       When a node is unreachable from another node, set the distance
> +#       between them to 255.
> +#
> +# Since: 2.10
> +##
> +{ 'struct': 'NumaDistOptions',
> +  'data': {
> +   'src': 'uint16',
> +   'dst': 'uint16',
> +   'val': 'uint8' }}
> +
> +##
> +# @NumaCpuOptions:
> +#
> +# Option "-numa cpu" overrides default cpu to node mapping.
> +# It accepts the same set of cpu properties as returned by
> +# query-hotpluggable-cpus[].props, where node-id could be used to
> +# override default node mapping.
> +#
> +# Since: 2.10
> +##
> +{ 'struct': 'NumaCpuOptions',
> +   'base': 'CpuInstanceProperties',
> +   'data' : {} }
> +
> +##
> +# @HostMemPolicy:
> +#
> +# Host memory policy types
> +#
> +# @default: restore default policy, remove any nondefault policy
> +#
> +# @preferred: set the preferred host nodes for allocation
> +#
> +# @bind: a strict policy that restricts memory allocation to the
> +#        host nodes specified
> +#
> +# @interleave: memory allocations are interleaved across the set
> +#              of host nodes specified
> +#
> +# Since: 2.1
> +##
> +{ 'enum': 'HostMemPolicy',
> +  'data': [ 'default', 'preferred', 'bind', 'interleave' ] }
> +
> +##
> +# @Memdev:
> +#
> +# Information about memory backend
> +#
> +# @id: backend's ID if backend has 'id' property (since 2.9)
> +#
> +# @size: memory backend size
> +#
> +# @merge: enables or disables memory merge support
> +#
> +# @dump: includes memory backend's memory in a core dump or not
> +#
> +# @prealloc: enables or disables memory preallocation
> +#
> +# @host-nodes: host nodes for its memory policy
> +#
> +# @policy: memory policy of memory backend
> +#
> +# Since: 2.1
> +##
> +{ 'struct': 'Memdev',
> +  'data': {
> +    '*id':        'str',
> +    'size':       'size',
> +    'merge':      'bool',
> +    'dump':       'bool',
> +    'prealloc':   'bool',
> +    'host-nodes': ['uint16'],
> +    'policy':     'HostMemPolicy' }}
> +
> +##
> +# @query-memdev:
> +#
> +# Returns information for all memory backends.
> +#
> +# Returns: a list of @Memdev.
> +#
> +# Since: 2.1
> +#
> +# Example:
> +#
> +# -> { "execute": "query-memdev" }
> +# <- { "return": [
> +#        {
> +#          "id": "mem1",
> +#          "size": 536870912,
> +#          "merge": false,
> +#          "dump": true,
> +#          "prealloc": false,
> +#          "host-nodes": [0, 1],
> +#          "policy": "bind"
> +#        },
> +#        {
> +#          "size": 536870912,
> +#          "merge": false,
> +#          "dump": true,
> +#          "prealloc": true,
> +#          "host-nodes": [2, 3],
> +#          "policy": "preferred"
> +#        }
> +#      ]
> +#    }
> +#
> +##
> +{ 'command': 'query-memdev', 'returns': ['Memdev'] }
> +
> +##
> +# @PCDIMMDeviceInfo:
> +#
> +# PCDIMMDevice state information
> +#
> +# @id: device's ID
> +#
> +# @addr: physical address, where device is mapped
> +#
> +# @size: size of memory that the device provides
> +#
> +# @slot: slot number at which device is plugged in
> +#
> +# @node: NUMA node number where device is plugged in
> +#
> +# @memdev: memory backend linked with device
> +#
> +# @hotplugged: true if device was hotplugged
> +#
> +# @hotpluggable: true if device if could be added/removed while machine is running
> +#
> +# Since: 2.1
> +##
> +{ 'struct': 'PCDIMMDeviceInfo',
> +  'data': { '*id': 'str',
> +            'addr': 'int',
> +            'size': 'int',
> +            'slot': 'int',
> +            'node': 'int',
> +            'memdev': 'str',
> +            'hotplugged': 'bool',
> +            'hotpluggable': 'bool'
> +          }
> +}
> +
> +##
> +# @MemoryDeviceInfo:
> +#
> +# Union containing information about a memory device
> +#
> +# Since: 2.1
> +##
> +{ 'union': 'MemoryDeviceInfo', 'data': {'dimm': 'PCDIMMDeviceInfo'} }
> +
> +##
> +# @query-memory-devices:
> +#
> +# Lists available memory devices and their state
> +#
> +# Since: 2.1
> +#
> +# Example:
> +#
> +# -> { "execute": "query-memory-devices" }
> +# <- { "return": [ { "data":
> +#                       { "addr": 5368709120,
> +#                         "hotpluggable": true,
> +#                         "hotplugged": true,
> +#                         "id": "d1",
> +#                         "memdev": "/objects/memX",
> +#                         "node": 0,
> +#                         "size": 1073741824,
> +#                         "slot": 0},
> +#                    "type": "dimm"
> +#                  } ] }
> +#
> +##
> +{ 'command': 'query-memory-devices', 'returns': ['MemoryDeviceInfo'] }
> +
> +##
> +# @MEM_UNPLUG_ERROR:
> +#
> +# Emitted when memory hot unplug error occurs.
> +#
> +# @device: device name
> +#
> +# @msg: Informative message
> +#
> +# Since: 2.4
> +#
> +# Example:
> +#
> +# <- { "event": "MEM_UNPLUG_ERROR"
> +#      "data": { "device": "dimm1",
> +#                "msg": "acpi: device unplug for unsupported device"
> +#      },
> +#      "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
> +#
> +##
> +{ 'event': 'MEM_UNPLUG_ERROR',
> +  'data': { 'device': 'str', 'msg': 'str' } }
> +
> +##
> +# @ACPISlotType:
> +#
> +# @DIMM: memory slot
> +# @CPU: logical CPU slot (since 2.7)
> +##
> +{ 'enum': 'ACPISlotType', 'data': [ 'DIMM', 'CPU' ] }
> +
> +##
> +# @ACPIOSTInfo:
> +#
> +# OSPM Status Indication for a device
> +# For description of possible values of @source and @status fields
> +# see "_OST (OSPM Status Indication)" chapter of ACPI5.0 spec.
> +#
> +# @device: device ID associated with slot
> +#
> +# @slot: slot ID, unique per slot of a given @slot-type
> +#
> +# @slot-type: type of the slot
> +#
> +# @source: an integer containing the source event
> +#
> +# @status: an integer containing the status code
> +#
> +# Since: 2.1
> +##
> +{ 'struct': 'ACPIOSTInfo',
> +  'data'  : { '*device': 'str',
> +              'slot': 'str',
> +              'slot-type': 'ACPISlotType',
> +              'source': 'int',
> +              'status': 'int' } }
> +
> +##
> +# @query-acpi-ospm-status:
> +#
> +# Return a list of ACPIOSTInfo for devices that support status
> +# reporting via ACPI _OST method.
> +#
> +# Since: 2.1
> +#
> +# Example:
> +#
> +# -> { "execute": "query-acpi-ospm-status" }
> +# <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
> +#                  { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
> +#                  { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
> +#                  { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
> +#    ]}
> +#
> +##
> +{ 'command': 'query-acpi-ospm-status', 'returns': ['ACPIOSTInfo'] }
> +
> +##
> +# @ACPI_DEVICE_OST:
> +#
> +# Emitted when guest executes ACPI _OST method.
> +#
> +# @info: ACPIOSTInfo type as described in qapi-schema.json
> +#
> +# Since: 2.1
> +#
> +# Example:
> +#
> +# <- { "event": "ACPI_DEVICE_OST",
> +#      "data": { "device": "d1", "slot": "0",
> +#                "slot-type": "DIMM", "source": 1, "status": 0 } }
> +#
> +##
> +{ 'event': 'ACPI_DEVICE_OST',
> +     'data': { 'info': 'ACPIOSTInfo' } }
> +
> +##
> +# @rtc-reset-reinjection:
> +#
> +# This command will reset the RTC interrupt reinjection backlog.
> +# Can be used if another mechanism to synchronize guest time
> +# is in effect, for example QEMU guest agent's guest-set-time
> +# command.
> +#
> +# Since: 2.1
> +#
> +# Example:
> +#
> +# -> { "execute": "rtc-reset-reinjection" }
> +# <- { "return": {} }
> +#
> +##
> +{ 'command': 'rtc-reset-reinjection' }
> +
> +##
> +# @RTC_CHANGE:
> +#
> +# Emitted when the guest changes the RTC time.
> +#
> +# @offset: offset between base RTC clock (as specified by -rtc base), and
> +#          new RTC clock value
> +#
> +# Note: This event is rate-limited.
> +#
> +# Since: 0.13.0
> +#
> +# Example:
> +#
> +# <-   { "event": "RTC_CHANGE",
> +#        "data": { "offset": 78 },
> +#        "timestamp": { "seconds": 1267020223, "microseconds": 435656 } }
> +#
> +##
> +{ 'event': 'RTC_CHANGE',
> +  'data': { 'offset': 'int' } }
> +
> +##
> +# @ReplayMode:
> +#
> +# Mode of the replay subsystem.
> +#
> +# @none: normal execution mode. Replay or record are not enabled.
> +#
> +# @record: record mode. All non-deterministic data is written into the
> +#          replay log.
> +#
> +# @play: replay mode. Non-deterministic data required for system execution
> +#        is read from the log.
> +#
> +# Since: 2.5
> +##
> +{ 'enum': 'ReplayMode',
> +  'data': [ 'none', 'record', 'play' ] }
> +
> +##
> +# @xen-load-devices-state:
> +#
> +# Load the state of all devices from file. The RAM and the block devices
> +# of the VM are not loaded by this command.
> +#
> +# @filename: the file to load the state of the devices from as binary
> +# data. See xen-save-devices-state.txt for a description of the binary
> +# format.
> +#
> +# Since: 2.7
> +#
> +# Example:
> +#
> +# -> { "execute": "xen-load-devices-state",
> +#      "arguments": { "filename": "/tmp/resume" } }
> +# <- { "return": {} }
> +#
> +##
> +{ 'command': 'xen-load-devices-state', 'data': {'filename': 'str'} }
> +
> +##
> +# @GICCapability:
> +#
> +# The struct describes capability for a specific GIC (Generic
> +# Interrupt Controller) version. These bits are not only decided by
> +# QEMU/KVM software version, but also decided by the hardware that
> +# the program is running upon.
> +#
> +# @version:  version of GIC to be described. Currently, only 2 and 3
> +#            are supported.
> +#
> +# @emulated: whether current QEMU/hardware supports emulated GIC
> +#            device in user space.
> +#
> +# @kernel:   whether current QEMU/hardware supports hardware
> +#            accelerated GIC device in kernel.
> +#
> +# Since: 2.6
> +##
> +{ 'struct': 'GICCapability',
> +  'data': { 'version': 'int',
> +            'emulated': 'bool',
> +            'kernel': 'bool' } }
> +
> +##
> +# @query-gic-capabilities:
> +#
> +# This command is ARM-only. It will return a list of GICCapability
> +# objects that describe its capability bits.
> +#
> +# Returns: a list of GICCapability objects.
> +#
> +# Since: 2.6
> +#
> +# Example:
> +#
> +# -> { "execute": "query-gic-capabilities" }
> +# <- { "return": [{ "version": 2, "emulated": true, "kernel": false },
> +#                 { "version": 3, "emulated": false, "kernel": true } ] }
> +#
> +##
> +{ 'command': 'query-gic-capabilities', 'returns': ['GICCapability'] }
> +
> +##
> +# @CpuInstanceProperties:
> +#
> +# List of properties to be used for hotplugging a CPU instance,
> +# it should be passed by management with device_add command when
> +# a CPU is being hotplugged.
> +#
> +# @node-id: NUMA node ID the CPU belongs to
> +# @socket-id: socket number within node/board the CPU belongs to
> +# @core-id: core number within socket the CPU belongs to
> +# @thread-id: thread number within core the CPU belongs to
> +#
> +# Note: currently there are 4 properties that could be present
> +# but management should be prepared to pass through other
> +# properties with device_add command to allow for future
> +# interface extension. This also requires the filed names to be kept in
> +# sync with the properties passed to -device/device_add.
> +#
> +# Since: 2.7
> +##
> +{ 'struct': 'CpuInstanceProperties',
> +  'data': { '*node-id': 'int',
> +            '*socket-id': 'int',
> +            '*core-id': 'int',
> +            '*thread-id': 'int'
> +  }
> +}
> +
> +##
> +# @HotpluggableCPU:
> +#
> +# @type: CPU object type for usage with device_add command
> +# @props: list of properties to be used for hotplugging CPU
> +# @vcpus-count: number of logical VCPU threads @HotpluggableCPU provides
> +# @qom-path: link to existing CPU object if CPU is present or
> +#            omitted if CPU is not present.
> +#
> +# Since: 2.7
> +##
> +{ 'struct': 'HotpluggableCPU',
> +  'data': { 'type': 'str',
> +            'vcpus-count': 'int',
> +            'props': 'CpuInstanceProperties',
> +            '*qom-path': 'str'
> +          }
> +}
> +
> +##
> +# @query-hotpluggable-cpus:
> +#
> +# Returns: a list of HotpluggableCPU objects.
> +#
> +# Since: 2.7
> +#
> +# Example:
> +#
> +# For pseries machine type started with -smp 2,cores=2,maxcpus=4 -cpu POWER8:
> +#
> +# -> { "execute": "query-hotpluggable-cpus" }
> +# <- {"return": [
> +#      { "props": { "core": 8 }, "type": "POWER8-spapr-cpu-core",
> +#        "vcpus-count": 1 },
> +#      { "props": { "core": 0 }, "type": "POWER8-spapr-cpu-core",
> +#        "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
> +#    ]}'
> +#
> +# For pc machine type started with -smp 1,maxcpus=2:
> +#
> +# -> { "execute": "query-hotpluggable-cpus" }
> +# <- {"return": [
> +#      {
> +#         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
> +#         "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
> +#      },
> +#      {
> +#         "qom-path": "/machine/unattached/device[0]",
> +#         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
> +#         "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}
> +#      }
> +#    ]}
> +#
> +# For s390x-virtio-ccw machine type started with -smp 1,maxcpus=2 -cpu qemu
> +# (Since: 2.11):
> +#
> +# -> { "execute": "query-hotpluggable-cpus" }
> +# <- {"return": [
> +#      {
> +#         "type": "qemu-s390x-cpu", "vcpus-count": 1,
> +#         "props": { "core-id": 1 }
> +#      },
> +#      {
> +#         "qom-path": "/machine/unattached/device[0]",
> +#         "type": "qemu-s390x-cpu", "vcpus-count": 1,
> +#         "props": { "core-id": 0 }
> +#      }
> +#    ]}
> +#
> +##
> +{ 'command': 'query-hotpluggable-cpus', 'returns': ['HotpluggableCPU'] }
> +
> +##
> +# @GuidInfo:
> +#
> +# GUID information.
> +#
> +# @guid: the globally unique identifier
> +#
> +# Since: 2.9
> +##
> +{ 'struct': 'GuidInfo', 'data': {'guid': 'str'} }
> +
> +##
> +# @query-vm-generation-id:
> +#
> +# Show Virtual Machine Generation ID
> +#
> +# Since: 2.9
> +##
> +{ 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' }
> diff --git a/qapi/run-state.json b/qapi/run-state.json
> index bca46a8785..a27c3c2a93 100644
> --- a/qapi/run-state.json
> +++ b/qapi/run-state.json
> @@ -283,6 +283,16 @@
>    'data': [ 'reset', 'shutdown', 'poweroff', 'pause', 'debug', 'none',
>              'inject-nmi' ] }
>
> +
> +##
> +# @watchdog-set-action:
> +#
> +# Set watchdog action
> +#
> +# Since: 2.11
> +##
> +{ 'command': 'watchdog-set-action', 'data' : {'action': 'WatchdogAction'} }
> +
>  ##
>  # @GUEST_PANICKED:
>  #
> --
> 2.13.6
>

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 20/21] Include less of qapi-types.h
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 20/21] Include less of qapi-types.h Markus Armbruster
@ 2018-02-05 13:46   ` Marc-Andre Lureau
  2018-02-05 14:53     ` Markus Armbruster
  0 siblings, 1 reply; 87+ messages in thread
From: Marc-Andre Lureau @ 2018-02-05 13:46 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: qemu-devel, marcandre, Blake, Eric, mdroth

On Fri, Feb 2, 2018 at 2:03 PM, Markus Armbruster <armbru@redhat.com> wrote:
> In my "build everything" tree, a change to the types in
> qapi-schema.json triggers a recompile of about 4500 out of 4800
> objects.
>
> The previous commit split up the generated qapi-types.h.  Replace
> includes of qapi-types.h (i.e. all types) by includes of parts where
> possible.
>
> To illustrate the benefits: adding a type to qapi/migration.json now
> recompiles some 2300 instead of 4500 objects.  The next commit will
> improve it further.
>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

for the record, what was your methodology?
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>



> ---
>  crypto/cipherpriv.h              | 2 +-
>  hw/block/block.c                 | 1 +
>  hw/block/hd-geometry.c           | 1 +
>  hw/net/rocker/rocker_fp.c        | 2 +-
>  include/block/block.h            | 2 +-
>  include/block/dirty-bitmap.h     | 2 +-
>  include/chardev/char.h           | 1 +
>  include/crypto/cipher.h          | 2 +-
>  include/crypto/hash.h            | 2 +-
>  include/crypto/hmac.h            | 2 +-
>  include/crypto/secret.h          | 1 +
>  include/crypto/tlscreds.h        | 1 +
>  include/hw/block/block.h         | 2 +-
>  include/hw/block/fdc.h           | 2 +-
>  include/hw/ppc/spapr_drc.h       | 1 +
>  include/hw/qdev-properties.h     | 1 +
>  include/io/dns-resolver.h        | 1 +
>  include/migration/colo.h         | 2 +-
>  include/migration/failover.h     | 2 +-
>  include/migration/global_state.h | 1 +
>  include/monitor/monitor.h        | 1 +
>  include/net/filter.h             | 1 +
>  include/net/net.h                | 2 +-
>  include/qapi/error.h             | 2 +-
>  include/qapi/qmp/qobject.h       | 2 +-
>  include/qapi/visitor.h           | 2 +-
>  include/qemu/sockets.h           | 2 +-
>  include/qemu/throttle.h          | 2 +-
>  include/qom/cpu.h                | 1 +
>  include/qom/object.h             | 2 +-
>  include/sysemu/dump.h            | 2 ++
>  include/sysemu/hostmem.h         | 1 +
>  include/sysemu/replay.h          | 1 +
>  include/sysemu/sysemu.h          | 1 +
>  include/sysemu/tpm.h             | 1 +
>  include/sysemu/watchdog.h        | 2 +-
>  include/ui/input.h               | 2 +-
>  migration/migration.h            | 1 +
>  migration/ram.h                  | 2 +-
>  net/tap_int.h                    | 2 +-
>  replication.h                    | 1 +
>  ui/vnc.h                         | 1 +
>  42 files changed, 43 insertions(+), 22 deletions(-)
>
> diff --git a/crypto/cipherpriv.h b/crypto/cipherpriv.h
> index 77da4c2f32..0823239f41 100644
> --- a/crypto/cipherpriv.h
> +++ b/crypto/cipherpriv.h
> @@ -15,7 +15,7 @@
>  #ifndef QCRYPTO_CIPHERPRIV_H
>  #define QCRYPTO_CIPHERPRIV_H
>
> -#include "qapi-types.h"
> +#include "qapi/qapi-types-crypto.h"
>
>  typedef struct QCryptoCipherDriver QCryptoCipherDriver;
>
> diff --git a/hw/block/block.c b/hw/block/block.c
> index b0269c857f..b91e2b6d7e 100644
> --- a/hw/block/block.c
> +++ b/hw/block/block.c
> @@ -12,6 +12,7 @@
>  #include "sysemu/block-backend.h"
>  #include "hw/block/block.h"
>  #include "qapi/error.h"
> +#include "qapi/qapi-types-block.h"
>  #include "qemu/error-report.h"
>
>  void blkconf_serial(BlockConf *conf, char **serial)
> diff --git a/hw/block/hd-geometry.c b/hw/block/hd-geometry.c
> index 57ad5012a7..79384a2b0a 100644
> --- a/hw/block/hd-geometry.c
> +++ b/hw/block/hd-geometry.c
> @@ -32,6 +32,7 @@
>
>  #include "qemu/osdep.h"
>  #include "sysemu/block-backend.h"
> +#include "qapi/qapi-types-block.h"
>  #include "qemu/bswap.h"
>  #include "hw/block/block.h"
>  #include "trace.h"
> diff --git a/hw/net/rocker/rocker_fp.c b/hw/net/rocker/rocker_fp.c
> index 4b3c9847db..27b17c890f 100644
> --- a/hw/net/rocker/rocker_fp.c
> +++ b/hw/net/rocker/rocker_fp.c
> @@ -16,7 +16,7 @@
>
>  #include "qemu/osdep.h"
>  #include "net/clients.h"
> -
> +#include "qapi/qapi-types-rocker.h"
>  #include "rocker.h"
>  #include "rocker_hw.h"
>  #include "rocker_fp.h"
> diff --git a/include/block/block.h b/include/block/block.h
> index ae1517f32d..70b90cd767 100644
> --- a/include/block/block.h
> +++ b/include/block/block.h
> @@ -2,7 +2,7 @@
>  #define BLOCK_H
>
>  #include "block/aio.h"
> -#include "qapi-types.h"
> +#include "qapi/qapi-types-block-core.h"
>  #include "qemu/iov.h"
>  #include "qemu/coroutine.h"
>  #include "block/accounting.h"
> diff --git a/include/block/dirty-bitmap.h b/include/block/dirty-bitmap.h
> index 3da8486ab1..1454be358d 100644
> --- a/include/block/dirty-bitmap.h
> +++ b/include/block/dirty-bitmap.h
> @@ -2,7 +2,7 @@
>  #define BLOCK_DIRTY_BITMAP_H
>
>  #include "qemu-common.h"
> -#include "qapi-types.h"
> +#include "qapi/qapi-types-block-core.h"
>  #include "qemu/hbitmap.h"
>
>  BdrvDirtyBitmap *bdrv_create_dirty_bitmap(BlockDriverState *bs,
> diff --git a/include/chardev/char.h b/include/chardev/char.h
> index a381dc3df8..ebf1e0ba04 100644
> --- a/include/chardev/char.h
> +++ b/include/chardev/char.h
> @@ -1,6 +1,7 @@
>  #ifndef QEMU_CHAR_H
>  #define QEMU_CHAR_H
>
> +#include "qapi/qapi-types-char.h"
>  #include "qemu/main-loop.h"
>  #include "qemu/bitmap.h"
>  #include "qom/object.h"
> diff --git a/include/crypto/cipher.h b/include/crypto/cipher.h
> index 984fb8243f..bce2d4c8e4 100644
> --- a/include/crypto/cipher.h
> +++ b/include/crypto/cipher.h
> @@ -21,7 +21,7 @@
>  #ifndef QCRYPTO_CIPHER_H
>  #define QCRYPTO_CIPHER_H
>
> -#include "qapi-types.h"
> +#include "qapi/qapi-types-crypto.h"
>
>  typedef struct QCryptoCipher QCryptoCipher;
>
> diff --git a/include/crypto/hash.h b/include/crypto/hash.h
> index ca3267f3df..077ac7bea0 100644
> --- a/include/crypto/hash.h
> +++ b/include/crypto/hash.h
> @@ -21,7 +21,7 @@
>  #ifndef QCRYPTO_HASH_H
>  #define QCRYPTO_HASH_H
>
> -#include "qapi-types.h"
> +#include "qapi/qapi-types-crypto.h"
>
>  /* See also "QCryptoHashAlgorithm" defined in qapi/crypto.json */
>
> diff --git a/include/crypto/hmac.h b/include/crypto/hmac.h
> index 5e88905989..aa3c97a2ff 100644
> --- a/include/crypto/hmac.h
> +++ b/include/crypto/hmac.h
> @@ -12,7 +12,7 @@
>  #ifndef QCRYPTO_HMAC_H
>  #define QCRYPTO_HMAC_H
>
> -#include "qapi-types.h"
> +#include "qapi/qapi-types-crypto.h"
>
>  typedef struct QCryptoHmac QCryptoHmac;
>  struct QCryptoHmac {
> diff --git a/include/crypto/secret.h b/include/crypto/secret.h
> index 07a963e794..edd0e13236 100644
> --- a/include/crypto/secret.h
> +++ b/include/crypto/secret.h
> @@ -21,6 +21,7 @@
>  #ifndef QCRYPTO_SECRET_H
>  #define QCRYPTO_SECRET_H
>
> +#include "qapi/qapi-types-crypto.h"
>  #include "qom/object.h"
>
>  #define TYPE_QCRYPTO_SECRET "secret"
> diff --git a/include/crypto/tlscreds.h b/include/crypto/tlscreds.h
> index ad47d88be7..6b011e1dbc 100644
> --- a/include/crypto/tlscreds.h
> +++ b/include/crypto/tlscreds.h
> @@ -21,6 +21,7 @@
>  #ifndef QCRYPTO_TLSCREDS_H
>  #define QCRYPTO_TLSCREDS_H
>
> +#include "qapi/qapi-types-crypto.h"
>  #include "qom/object.h"
>
>  #ifdef CONFIG_GNUTLS
> diff --git a/include/hw/block/block.h b/include/hw/block/block.h
> index f532d10e35..d4f4dfffab 100644
> --- a/include/hw/block/block.h
> +++ b/include/hw/block/block.h
> @@ -12,7 +12,7 @@
>  #define HW_BLOCK_H
>
>  #include "qemu-common.h"
> -#include "qapi-types.h"
> +#include "qapi/qapi-types-block-core.h"
>
>  /* Configuration */
>
> diff --git a/include/hw/block/fdc.h b/include/hw/block/fdc.h
> index 68a0c904ea..3b813c7f7d 100644
> --- a/include/hw/block/fdc.h
> +++ b/include/hw/block/fdc.h
> @@ -2,7 +2,7 @@
>  #define HW_FDC_H
>
>  #include "qemu-common.h"
> -#include "qapi-types.h"
> +#include "qapi/qapi-types-block.h"
>
>  /* fdc.c */
>  #define MAX_FD 2
> diff --git a/include/hw/ppc/spapr_drc.h b/include/hw/ppc/spapr_drc.h
> index f8d9f5b231..f6ff32e7e2 100644
> --- a/include/hw/ppc/spapr_drc.h
> +++ b/include/hw/ppc/spapr_drc.h
> @@ -14,6 +14,7 @@
>  #define HW_SPAPR_DRC_H
>
>  #include <libfdt.h>
> +#include "qapi/qapi-types-run-state.h"
>  #include "qom/object.h"
>  #include "sysemu/sysemu.h"
>  #include "hw/qdev.h"
> diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h
> index 5bbfec634b..c5d1b1bd63 100644
> --- a/include/hw/qdev-properties.h
> +++ b/include/hw/qdev-properties.h
> @@ -1,6 +1,7 @@
>  #ifndef QEMU_QDEV_PROPERTIES_H
>  #define QEMU_QDEV_PROPERTIES_H
>
> +#include "qapi-types.h"
>  #include "hw/qdev-core.h"
>
>  /*** qdev-properties.c ***/
> diff --git a/include/io/dns-resolver.h b/include/io/dns-resolver.h
> index 2f69c08c13..1a162185cc 100644
> --- a/include/io/dns-resolver.h
> +++ b/include/io/dns-resolver.h
> @@ -22,6 +22,7 @@
>  #define QIO_DNS_RESOLVER_H
>
>  #include "qemu-common.h"
> +#include "qapi/qapi-types-sockets.h"
>  #include "qom/object.h"
>  #include "io/task.h"
>
> diff --git a/include/migration/colo.h b/include/migration/colo.h
> index 50ace16205..2fe48ad353 100644
> --- a/include/migration/colo.h
> +++ b/include/migration/colo.h
> @@ -14,7 +14,7 @@
>  #define QEMU_COLO_H
>
>  #include "qemu-common.h"
> -#include "qapi-types.h"
> +#include "qapi/qapi-types-migration.h"
>
>  void colo_info_init(void);
>
> diff --git a/include/migration/failover.h b/include/migration/failover.h
> index ad91ef2381..4c37218dcc 100644
> --- a/include/migration/failover.h
> +++ b/include/migration/failover.h
> @@ -14,7 +14,7 @@
>  #define QEMU_FAILOVER_H
>
>  #include "qemu-common.h"
> -#include "qapi-types.h"
> +#include "qapi/qapi-types-migration.h"
>
>  void failover_init_state(void);
>  FailoverStatus failover_set_state(FailoverStatus old_state,
> diff --git a/include/migration/global_state.h b/include/migration/global_state.h
> index d307de8350..fd22dd3034 100644
> --- a/include/migration/global_state.h
> +++ b/include/migration/global_state.h
> @@ -13,6 +13,7 @@
>  #ifndef QEMU_MIGRATION_GLOBAL_STATE_H
>  #define QEMU_MIGRATION_GLOBAL_STATE_H
>
> +#include "qapi/qapi-types-run-state.h"
>  #include "sysemu/sysemu.h"
>
>  void register_global_state(void);
> diff --git a/include/monitor/monitor.h b/include/monitor/monitor.h
> index ad64ad8e68..50f7cea057 100644
> --- a/include/monitor/monitor.h
> +++ b/include/monitor/monitor.h
> @@ -3,6 +3,7 @@
>
>  #include "qemu-common.h"
>  #include "block/block.h"
> +#include "qapi-types.h"
>  #include "qemu/readline.h"
>
>  extern Monitor *cur_mon;
> diff --git a/include/net/filter.h b/include/net/filter.h
> index 0c4a2ea6c9..435acd6f82 100644
> --- a/include/net/filter.h
> +++ b/include/net/filter.h
> @@ -9,6 +9,7 @@
>  #ifndef QEMU_NET_FILTER_H
>  #define QEMU_NET_FILTER_H
>
> +#include "qapi/qapi-types-net.h"
>  #include "qom/object.h"
>  #include "qemu-common.h"
>  #include "net/queue.h"
> diff --git a/include/net/net.h b/include/net/net.h
> index 3fc48e4f51..727643032c 100644
> --- a/include/net/net.h
> +++ b/include/net/net.h
> @@ -2,7 +2,7 @@
>  #define QEMU_NET_H
>
>  #include "qemu/queue.h"
> -#include "qapi-types.h"
> +#include "qapi/qapi-types-net.h"
>  #include "net/queue.h"
>  #include "migration/vmstate.h"
>
> diff --git a/include/qapi/error.h b/include/qapi/error.h
> index 341b229066..36065da35d 100644
> --- a/include/qapi/error.h
> +++ b/include/qapi/error.h
> @@ -115,7 +115,7 @@
>  #ifndef ERROR_H
>  #define ERROR_H
>
> -#include "qapi-types.h"
> +#include "qapi/qapi-types-common.h"
>
>  /*
>   * Overall category of an error.
> diff --git a/include/qapi/qmp/qobject.h b/include/qapi/qmp/qobject.h
> index 38ac68845c..a2964fbf25 100644
> --- a/include/qapi/qmp/qobject.h
> +++ b/include/qapi/qmp/qobject.h
> @@ -32,7 +32,7 @@
>  #ifndef QOBJECT_H
>  #define QOBJECT_H
>
> -#include "qapi-types.h"
> +#include "qapi-builtin-types.h"
>
>  struct QObject {
>      QType type;
> diff --git a/include/qapi/visitor.h b/include/qapi/visitor.h
> index ecff296c11..9e57508446 100644
> --- a/include/qapi/visitor.h
> +++ b/include/qapi/visitor.h
> @@ -15,7 +15,7 @@
>  #ifndef QAPI_VISITOR_H
>  #define QAPI_VISITOR_H
>
> -#include "qapi-types.h"
> +#include "qapi-builtin-types.h"
>
>  /*
>   * The QAPI schema defines both a set of C data types, and a QMP wire
> diff --git a/include/qemu/sockets.h b/include/qemu/sockets.h
> index 8889bcb1ec..e88d4c37ab 100644
> --- a/include/qemu/sockets.h
> +++ b/include/qemu/sockets.h
> @@ -9,7 +9,7 @@ int inet_aton(const char *cp, struct in_addr *ia);
>
>  #endif /* !_WIN32 */
>
> -#include "qapi-types.h"
> +#include "qapi/qapi-types-sockets.h"
>
>  /* misc helpers */
>  int qemu_socket(int domain, int type, int protocol);
> diff --git a/include/qemu/throttle.h b/include/qemu/throttle.h
> index 03d45f44f8..abeb886d93 100644
> --- a/include/qemu/throttle.h
> +++ b/include/qemu/throttle.h
> @@ -26,7 +26,7 @@
>  #define THROTTLE_H
>
>  #include "qemu-common.h"
> -#include "qapi-types.h"
> +#include "qapi/qapi-types-block-core.h"
>  #include "qemu/timer.h"
>
>  #define THROTTLE_VALUE_MAX 1000000000000000LL
> diff --git a/include/qom/cpu.h b/include/qom/cpu.h
> index aff88fa16f..dc6d4956a8 100644
> --- a/include/qom/cpu.h
> +++ b/include/qom/cpu.h
> @@ -24,6 +24,7 @@
>  #include "disas/bfd.h"
>  #include "exec/hwaddr.h"
>  #include "exec/memattrs.h"
> +#include "qapi/qapi-types-run-state.h"
>  #include "qemu/bitmap.h"
>  #include "qemu/queue.h"
>  #include "qemu/thread.h"
> diff --git a/include/qom/object.h b/include/qom/object.h
> index dc73d59660..5b5c016d8f 100644
> --- a/include/qom/object.h
> +++ b/include/qom/object.h
> @@ -14,7 +14,7 @@
>  #ifndef QEMU_OBJECT_H
>  #define QEMU_OBJECT_H
>
> -#include "qapi-types.h"
> +#include "qapi-builtin-types.h"
>  #include "qemu/queue.h"
>
>  struct TypeImpl;
> diff --git a/include/sysemu/dump.h b/include/sysemu/dump.h
> index c14bcfe8c6..2424e31425 100644
> --- a/include/sysemu/dump.h
> +++ b/include/sysemu/dump.h
> @@ -14,6 +14,8 @@
>  #ifndef DUMP_H
>  #define DUMP_H
>
> +#include "qapi-types.h"
> +
>  #define MAKEDUMPFILE_SIGNATURE      "makedumpfile"
>  #define MAX_SIZE_MDF_HEADER         (4096) /* max size of makedumpfile_header */
>  #define TYPE_FLAT_HEADER            (1)    /* type of flattened format */
> diff --git a/include/sysemu/hostmem.h b/include/sysemu/hostmem.h
> index 621a3f9d42..6424f96df9 100644
> --- a/include/sysemu/hostmem.h
> +++ b/include/sysemu/hostmem.h
> @@ -14,6 +14,7 @@
>  #define SYSEMU_HOSTMEM_H
>
>  #include "sysemu/sysemu.h" /* for MAX_NODES */
> +#include "qapi-types.h"
>  #include "qom/object.h"
>  #include "exec/memory.h"
>  #include "qemu/bitmap.h"
> diff --git a/include/sysemu/replay.h b/include/sysemu/replay.h
> index dc8ae7b6b1..fb533ed9b6 100644
> --- a/include/sysemu/replay.h
> +++ b/include/sysemu/replay.h
> @@ -13,6 +13,7 @@
>   */
>
>  #include "sysemu.h"
> +#include "qapi-types.h"
>
>  /* replay clock kinds */
>  enum ReplayClockKind {
> diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
> index 77bb3da582..bfbef9e69c 100644
> --- a/include/sysemu/sysemu.h
> +++ b/include/sysemu/sysemu.h
> @@ -2,6 +2,7 @@
>  #define SYSEMU_H
>  /* Misc. things related to the system emulator.  */
>
> +#include "qapi/qapi-types-run-state.h"
>  #include "qemu/queue.h"
>  #include "qemu/timer.h"
>  #include "qemu/notify.h"
> diff --git a/include/sysemu/tpm.h b/include/sysemu/tpm.h
> index 00be220248..20ac1b2993 100644
> --- a/include/sysemu/tpm.h
> +++ b/include/sysemu/tpm.h
> @@ -12,6 +12,7 @@
>  #ifndef QEMU_TPM_H
>  #define QEMU_TPM_H
>
> +#include "qapi/qapi-types-tpm.h"
>  #include "qom/object.h"
>
>  int tpm_config_parse(QemuOptsList *opts_list, const char *optarg);
> diff --git a/include/sysemu/watchdog.h b/include/sysemu/watchdog.h
> index 677ace3945..a08d16380d 100644
> --- a/include/sysemu/watchdog.h
> +++ b/include/sysemu/watchdog.h
> @@ -23,7 +23,7 @@
>  #define QEMU_WATCHDOG_H
>
>  #include "qemu/queue.h"
> -#include "qapi-types.h"
> +#include "qapi/qapi-types-run-state.h"
>
>  struct WatchdogTimerModel {
>      QLIST_ENTRY(WatchdogTimerModel) entry;
> diff --git a/include/ui/input.h b/include/ui/input.h
> index 05aab2db5c..fc70f503fb 100644
> --- a/include/ui/input.h
> +++ b/include/ui/input.h
> @@ -1,7 +1,7 @@
>  #ifndef INPUT_H
>  #define INPUT_H
>
> -#include "qapi-types.h"
> +#include "qapi/qapi-types-ui.h"
>
>  #define INPUT_EVENT_MASK_KEY   (1<<INPUT_EVENT_KIND_KEY)
>  #define INPUT_EVENT_MASK_BTN   (1<<INPUT_EVENT_KIND_BTN)
> diff --git a/migration/migration.h b/migration/migration.h
> index 7e3dbed057..87503f03bc 100644
> --- a/migration/migration.h
> +++ b/migration/migration.h
> @@ -15,6 +15,7 @@
>  #define QEMU_MIGRATION_H
>
>  #include "qemu-common.h"
> +#include "qapi/qapi-types-migration.h"
>  #include "qemu/thread.h"
>  #include "exec/cpu-common.h"
>  #include "qemu/coroutine_int.h"
> diff --git a/migration/ram.h b/migration/ram.h
> index f3a227b4fc..53f0021c51 100644
> --- a/migration/ram.h
> +++ b/migration/ram.h
> @@ -30,7 +30,7 @@
>  #define QEMU_MIGRATION_RAM_H
>
>  #include "qemu-common.h"
> -#include "qapi-types.h"
> +#include "qapi/qapi-types-migration.h"
>  #include "exec/cpu-common.h"
>
>  extern MigrationStats ram_counters;
> diff --git a/net/tap_int.h b/net/tap_int.h
> index ae6888f74a..9f931d52d6 100644
> --- a/net/tap_int.h
> +++ b/net/tap_int.h
> @@ -27,7 +27,7 @@
>  #define NET_TAP_INT_H
>
>  #include "qemu-common.h"
> -#include "qapi-types.h"
> +#include "qapi/qapi-types-net.h"
>
>  int tap_open(char *ifname, int ifname_size, int *vnet_hdr,
>               int vnet_hdr_required, int mq_required, Error **errp);
> diff --git a/replication.h b/replication.h
> index ece6ca6133..8faefe005f 100644
> --- a/replication.h
> +++ b/replication.h
> @@ -15,6 +15,7 @@
>  #ifndef REPLICATION_H
>  #define REPLICATION_H
>
> +#include "qapi/qapi-types-block-core.h"
>  #include "qemu/queue.h"
>
>  typedef struct ReplicationOps ReplicationOps;
> diff --git a/ui/vnc.h b/ui/vnc.h
> index cfc3d0a570..da8495c0c8 100644
> --- a/ui/vnc.h
> +++ b/ui/vnc.h
> @@ -28,6 +28,7 @@
>  #define QEMU_VNC_H
>
>  #include "qemu-common.h"
> +#include "qapi/qapi-types-ui.h"
>  #include "qemu/queue.h"
>  #include "qemu/thread.h"
>  #include "ui/console.h"
> --
> 2.13.6
>

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 09/21] qapi: Don't absolutize include file name in error messages
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 09/21] qapi: Don't absolutize include file name in error messages Markus Armbruster
  2018-02-02 20:22   ` Eric Blake
@ 2018-02-05 13:46   ` Marc-Andre Lureau
  1 sibling, 0 replies; 87+ messages in thread
From: Marc-Andre Lureau @ 2018-02-05 13:46 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: qemu-devel, marcandre, Blake, Eric, mdroth

On Fri, Feb 2, 2018 at 2:03 PM, Markus Armbruster <armbru@redhat.com> wrote:
> Error messages print absolute filenames of included files even gave a
> relative one on the command line:
>
>      PYTHONPATH=scripts python -B tests/qapi-schema/test-qapi.py tests/qapi-schema/include-cycle.json
>     In file included from tests/qapi-schema/include-cycle.json:1:
>     In file included from /work/armbru/qemu/tests/qapi-schema/include-cycle-b.json:1:
>     /work/armbru/qemu/tests/qapi-schema/include-cycle-c.json:1: Inclusion loop for include-cycle.json
>
> Improve this to
>
>     In file included from tests/qapi-schema/include-cycle.json:1:
>     In file included from tests/qapi-schema/include-cycle-b.json:1:
>     tests/qapi-schema/include-cycle-c.json:1: Inclusion loop for include-cycle.json
>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

most of the necessary refactoring/split is done in previous patch,

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>


> ---
>  scripts/qapi/common.py                | 12 ++++++------
>  tests/qapi-schema/include-no-file.err |  2 +-
>  2 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py
> index be0fcc548a..6c6962a364 100644
> --- a/scripts/qapi/common.py
> +++ b/scripts/qapi/common.py
> @@ -255,9 +255,8 @@ class QAPIDoc(object):
>  class QAPISchemaParser(object):
>
>      def __init__(self, fp, previously_included=[], incl_info=None):
> -        abs_fname = os.path.abspath(fp.name)
>          self.fname = fp.name
> -        previously_included.append(abs_fname)
> +        previously_included.append(os.path.abspath(fp.name))
>          self.incl_info = incl_info
>          self.src = fp.read()
>          if self.src == '' or self.src[-1] != '\n':
> @@ -288,7 +287,7 @@ class QAPISchemaParser(object):
>                  if not isinstance(include, str):
>                      raise QAPISemError(info,
>                                         "Value of 'include' must be a string")
> -                self._include(include, info, os.path.dirname(abs_fname),
> +                self._include(include, info, os.path.dirname(self.fname),
>                                previously_included)
>              elif "pragma" in expr:
>                  self.reject_expr_doc(cur_doc)
> @@ -321,7 +320,8 @@ class QAPISchemaParser(object):
>                  % doc.symbol)
>
>      def _include(self, include, info, base_dir, previously_included):
> -        incl_abs_fname = os.path.join(base_dir, include)
> +        incl_fname = os.path.join(base_dir, include)
> +        incl_abs_fname = os.path.abspath(incl_fname)
>          # catch inclusion cycle
>          inf = info
>          while inf:
> @@ -333,9 +333,9 @@ class QAPISchemaParser(object):
>          if incl_abs_fname in previously_included:
>              return
>          try:
> -            fobj = open(incl_abs_fname, 'r')
> +            fobj = open(incl_fname, 'r')
>          except IOError as e:
> -            raise QAPISemError(info, '%s: %s' % (e.strerror, include))
> +            raise QAPISemError(info, '%s: %s' % (e.strerror, incl_fname))
>          exprs_include = QAPISchemaParser(fobj, previously_included, info)
>          self.exprs.extend(exprs_include.exprs)
>          self.docs.extend(exprs_include.docs)
> diff --git a/tests/qapi-schema/include-no-file.err b/tests/qapi-schema/include-no-file.err
> index d5b9b22d85..e42bcf4bc1 100644
> --- a/tests/qapi-schema/include-no-file.err
> +++ b/tests/qapi-schema/include-no-file.err
> @@ -1 +1 @@
> -tests/qapi-schema/include-no-file.json:1: No such file or directory: include-no-file-sub.json
> +tests/qapi-schema/include-no-file.json:1: No such file or directory: tests/qapi-schema/include-no-file-sub.json
> --
> 2.13.6
>

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 16/21] qapi/types qapi/visit: Make visitors use QAPIGen more
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 16/21] qapi/types qapi/visit: Make visitors use QAPIGen more Markus Armbruster
@ 2018-02-05 13:46   ` Marc-Andre Lureau
  0 siblings, 0 replies; 87+ messages in thread
From: Marc-Andre Lureau @ 2018-02-05 13:46 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: qemu-devel, marcandre, Blake, Eric, mdroth

On Fri, Feb 2, 2018 at 2:03 PM, Markus Armbruster <armbru@redhat.com> wrote:
> The conversion is rather shallow so far: most of the output
> accumulation is not converted.  Take the next step: convert output
> accumulation in QAPISchemaGenTypeVisitor and
> QAPISchemaGenVisitVisitor.  Helper functions outside these classes are
> not converted.
>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>


> ---
>  scripts/qapi/types.py | 83 +++++++++++++++++++++++----------------------------
>  scripts/qapi/visit.py | 83 +++++++++++++++++++++++----------------------------
>  2 files changed, 74 insertions(+), 92 deletions(-)
>
> diff --git a/scripts/qapi/types.py b/scripts/qapi/types.py
> index b2095120e0..eeffcbf32c 100644
> --- a/scripts/qapi/types.py
> +++ b/scripts/qapi/types.py
> @@ -168,35 +168,44 @@ void qapi_free_%(c_name)s(%(c_name)s *obj)
>
>
>  class QAPISchemaGenTypeVisitor(QAPISchemaVisitor):
> -    def __init__(self, opt_builtins):
> +    def __init__(self, opt_builtins, prefix):
>          self._opt_builtins = opt_builtins
> -        self.decl = None
> -        self.defn = None
> -        self._fwdecl = None
> -        self._btin = None
> +        self._prefix = prefix
> +        blurb = ' * Schema-defined QAPI types'
> +        self._genc = QAPIGenC(blurb, __doc__)
> +        self._genh = QAPIGenH(blurb, __doc__)
> +        self._genc.preamble(mcgen('''
> +#include "qemu/osdep.h"
> +#include "qapi/dealloc-visitor.h"
> +#include "%(prefix)sqapi-types.h"
> +#include "%(prefix)sqapi-visit.h"
> +''',
> +                                  prefix=prefix))
> +        self._genh.preamble(mcgen('''
> +#include "qapi/util.h"
> +'''))
> +        self._btin = '\n' + guardstart('QAPI_TYPES_BUILTIN')
> +
> +    def write(self, output_dir):
> +        self._genc.write(output_dir, self._prefix + 'qapi-types.c')
> +        self._genh.write(output_dir, self._prefix + 'qapi-types.h')
>
>      def visit_begin(self, schema):
>          # gen_object() is recursive, ensure it doesn't visit the empty type
>          objects_seen.add(schema.the_empty_object_type.name)
> -        self.decl = ''
> -        self.defn = ''
> -        self._fwdecl = ''
> -        self._btin = '\n' + guardstart('QAPI_TYPES_BUILTIN')
>
>      def visit_end(self):
> -        self.decl = self._fwdecl + self.decl
> -        self._fwdecl = None
>          # To avoid header dependency hell, we always generate
>          # declarations for built-in types in our header files and
>          # simply guard them.  See also opt_builtins (command line
>          # option -b).
>          self._btin += guardend('QAPI_TYPES_BUILTIN')
> -        self.decl = self._btin + self.decl
> +        self._genh.preamble(self._btin)
>          self._btin = None
>
>      def _gen_type_cleanup(self, name):
> -        self.decl += gen_type_cleanup_decl(name)
> -        self.defn += gen_type_cleanup(name)
> +        self._genh.body(gen_type_cleanup_decl(name))
> +        self._genc.body(gen_type_cleanup(name))
>
>      def visit_enum_type(self, name, info, values, prefix):
>          # Special case for our lone builtin enum type
> @@ -204,10 +213,10 @@ class QAPISchemaGenTypeVisitor(QAPISchemaVisitor):
>          if not info:
>              self._btin += gen_enum(name, values, prefix)
>              if self._opt_builtins:
> -                self.defn += gen_enum_lookup(name, values, prefix)
> +                self._genc.body(gen_enum_lookup(name, values, prefix))
>          else:
> -            self._fwdecl += gen_enum(name, values, prefix)
> -            self.defn += gen_enum_lookup(name, values, prefix)
> +            self._genh.preamble(gen_enum(name, values, prefix))
> +            self._genc.body(gen_enum_lookup(name, values, prefix))
>
>      def visit_array_type(self, name, info, element_type):
>          if isinstance(element_type, QAPISchemaBuiltinType):
> @@ -215,20 +224,20 @@ class QAPISchemaGenTypeVisitor(QAPISchemaVisitor):
>              self._btin += gen_array(name, element_type)
>              self._btin += gen_type_cleanup_decl(name)
>              if self._opt_builtins:
> -                self.defn += gen_type_cleanup(name)
> +                self._genc.body(gen_type_cleanup(name))
>          else:
> -            self._fwdecl += gen_fwd_object_or_array(name)
> -            self.decl += gen_array(name, element_type)
> +            self._genh.preamble(gen_fwd_object_or_array(name))
> +            self._genh.body(gen_array(name, element_type))
>              self._gen_type_cleanup(name)
>
>      def visit_object_type(self, name, info, base, members, variants):
>          # Nothing to do for the special empty builtin
>          if name == 'q_empty':
>              return
> -        self._fwdecl += gen_fwd_object_or_array(name)
> -        self.decl += gen_object(name, base, members, variants)
> +        self._genh.preamble(gen_fwd_object_or_array(name))
> +        self._genh.body(gen_object(name, base, members, variants))
>          if base and not base.is_implicit():
> -            self.decl += gen_upcast(name, base)
> +            self._genh.body(gen_upcast(name, base))
>          # TODO Worth changing the visitor signature, so we could
>          # directly use rather than repeat type.is_implicit()?
>          if not name.startswith('q_'):
> @@ -236,31 +245,13 @@ class QAPISchemaGenTypeVisitor(QAPISchemaVisitor):
>              self._gen_type_cleanup(name)
>
>      def visit_alternate_type(self, name, info, variants):
> -        self._fwdecl += gen_fwd_object_or_array(name)
> -        self.decl += gen_object(name, None, [variants.tag_member], variants)
> +        self._genh.preamble(gen_fwd_object_or_array(name))
> +        self._genh.body(gen_object(name, None,
> +                                   [variants.tag_member], variants))
>          self._gen_type_cleanup(name)
>
>
>  def gen_types(schema, output_dir, prefix, opt_builtins):
> -    blurb = ' * Schema-defined QAPI types'
> -    genc = QAPIGenC(blurb, __doc__)
> -    genh = QAPIGenH(blurb, __doc__)
> -
> -    genc.body(mcgen('''
> -#include "qemu/osdep.h"
> -#include "qapi/dealloc-visitor.h"
> -#include "%(prefix)sqapi-types.h"
> -#include "%(prefix)sqapi-visit.h"
> -''',
> -                    prefix=prefix))
> -
> -    genh.body(mcgen('''
> -#include "qapi/util.h"
> -'''))
> -
> -    vis = QAPISchemaGenTypeVisitor(opt_builtins)
> +    vis = QAPISchemaGenTypeVisitor(opt_builtins, prefix)
>      schema.visit(vis)
> -    genc.body(vis.defn)
> -    genh.body(vis.decl)
> -    genc.write(output_dir, prefix + 'qapi-types.c')
> -    genh.write(output_dir, prefix + 'qapi-types.h')
> +    vis.write(output_dir)
> diff --git a/scripts/qapi/visit.py b/scripts/qapi/visit.py
> index 80c0b85f8c..ee1a849574 100644
> --- a/scripts/qapi/visit.py
> +++ b/scripts/qapi/visit.py
> @@ -264,24 +264,38 @@ out:
>
>
>  class QAPISchemaGenVisitVisitor(QAPISchemaVisitor):
> -    def __init__(self, opt_builtins):
> +    def __init__(self, opt_builtins, prefix):
>          self._opt_builtins = opt_builtins
> -        self.decl = None
> -        self.defn = None
> -        self._btin = None
> -
> -    def visit_begin(self, schema):
> -        self.decl = ''
> -        self.defn = ''
> +        self._prefix = prefix
> +        blurb = ' * Schema-defined QAPI visitors'
> +        self._genc = QAPIGenC(blurb, __doc__)
> +        self._genh = QAPIGenH(blurb, __doc__)
> +        self._genc.preamble(mcgen('''
> +#include "qemu/osdep.h"
> +#include "qemu-common.h"
> +#include "qapi/error.h"
> +#include "%(prefix)sqapi-visit.h"
> +''',
> +                                  prefix=prefix))
> +        self._genh.preamble(mcgen('''
> +#include "qapi/visitor.h"
> +#include "qapi/qmp/qerror.h"
> +#include "%(prefix)sqapi-types.h"
> +''',
> +                                  prefix=prefix))
>          self._btin = guardstart('QAPI_VISIT_BUILTIN')
>
> +    def write(self, output_dir):
> +        self._genc.write(output_dir, self._prefix + 'qapi-visit.c')
> +        self._genh.write(output_dir, self._prefix + 'qapi-visit.h')
> +
>      def visit_end(self):
>          # To avoid header dependency hell, we always generate
>          # declarations for built-in types in our header files and
>          # simply guard them.  See also opt_builtins (command line
>          # option -b).
>          self._btin += guardend('QAPI_VISIT_BUILTIN')
> -        self.decl = self._btin + self.decl
> +        self._genh.preamble(self._btin)
>          self._btin = None
>
>      def visit_enum_type(self, name, info, values, prefix):
> @@ -290,10 +304,10 @@ class QAPISchemaGenVisitVisitor(QAPISchemaVisitor):
>          if not info:
>              self._btin += gen_visit_decl(name, scalar=True)
>              if self._opt_builtins:
> -                self.defn += gen_visit_enum(name)
> +                self._genc.body(gen_visit_enum(name))
>          else:
> -            self.decl += gen_visit_decl(name, scalar=True)
> -            self.defn += gen_visit_enum(name)
> +            self._genh.body(gen_visit_decl(name, scalar=True))
> +            self._genc.body(gen_visit_enum(name))
>
>      def visit_array_type(self, name, info, element_type):
>          decl = gen_visit_decl(name)
> @@ -301,53 +315,30 @@ class QAPISchemaGenVisitVisitor(QAPISchemaVisitor):
>          if isinstance(element_type, QAPISchemaBuiltinType):
>              self._btin += decl
>              if self._opt_builtins:
> -                self.defn += defn
> +                self._genc.body(defn)
>          else:
> -            self.decl += decl
> -            self.defn += defn
> +            self._genh.body(decl)
> +            self._genc.body(defn)
>
>      def visit_object_type(self, name, info, base, members, variants):
>          # Nothing to do for the special empty builtin
>          if name == 'q_empty':
>              return
> -        self.decl += gen_visit_members_decl(name)
> -        self.defn += gen_visit_object_members(name, base, members, variants)
> +        self._genh.body(gen_visit_members_decl(name))
> +        self._genc.body(gen_visit_object_members(name, base, members, variants))
>          # TODO Worth changing the visitor signature, so we could
>          # directly use rather than repeat type.is_implicit()?
>          if not name.startswith('q_'):
>              # only explicit types need an allocating visit
> -            self.decl += gen_visit_decl(name)
> -            self.defn += gen_visit_object(name, base, members, variants)
> +            self._genh.body(gen_visit_decl(name))
> +            self._genc.body(gen_visit_object(name, base, members, variants))
>
>      def visit_alternate_type(self, name, info, variants):
> -        self.decl += gen_visit_decl(name)
> -        self.defn += gen_visit_alternate(name, variants)
> +        self._genh.body(gen_visit_decl(name))
> +        self._genc.body(gen_visit_alternate(name, variants))
>
>
>  def gen_visit(schema, output_dir, prefix, opt_builtins):
> -    blurb = ' * Schema-defined QAPI visitors'
> -    genc = QAPIGenC(blurb, __doc__)
> -    genh = QAPIGenH(blurb, __doc__)
> -
> -    genc.body(mcgen('''
> -#include "qemu/osdep.h"
> -#include "qemu-common.h"
> -#include "qapi/error.h"
> -#include "%(prefix)sqapi-visit.h"
> -''',
> -                    prefix=prefix))
> -
> -    genh.body(mcgen('''
> -#include "qapi/visitor.h"
> -#include "qapi/qmp/qerror.h"
> -#include "%(prefix)sqapi-types.h"
> -
> -''',
> -                    prefix=prefix))
> -
> -    vis = QAPISchemaGenVisitVisitor(opt_builtins)
> +    vis = QAPISchemaGenVisitVisitor(opt_builtins, prefix)
>      schema.visit(vis)
> -    genc.body(vis.defn)
> -    genh.body(vis.decl)
> -    genc.write(output_dir, prefix + 'qapi-visit.c')
> -    genh.write(output_dir, prefix + 'qapi-visit.h')
> +    vis.write(output_dir)
> --
> 2.13.6
>

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 17/21] qapi/types qapi/visit: Generate built-in stuff into separate files
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 17/21] qapi/types qapi/visit: Generate built-in stuff into separate files Markus Armbruster
@ 2018-02-05 13:46   ` Marc-Andre Lureau
  2018-02-06 20:54   ` Eric Blake
  1 sibling, 0 replies; 87+ messages in thread
From: Marc-Andre Lureau @ 2018-02-05 13:46 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: qemu-devel, marcandre, Blake, Eric, mdroth

On Fri, Feb 2, 2018 at 2:03 PM, Markus Armbruster <armbru@redhat.com> wrote:
> Linking code from multiple separate QAPI schemata into the same
> program is possible, but involves some weirdness around built-in
> types:
>
> * We generate code for built-in types into .c only with option
>   --builtins.  The user is responsible to generate code for exactly
>   one QAPI schema per program with --builtins.
>
> * We generate code for them it into .h regardless of --builtins,
>   guarded by #ifndef QAPI_VISIT_BUILTIN.  Because the code for
>   built-in types is exactly the same in all of them, including any
>   combination of these headers works.
>
> Replace this contraption by something more conventional: generate code
> for built-in types into their very own files: qapi-builtin-types.c,
> qapi-builtin-visit.c, qapi-builtin-types.h, qapi-builtin-visit.h, but
> only with --builtins.  Obey --output-dir, but ignore --prefix for
> them.
>
> Make qapi-types.h include qapi-builtin-types.h.  With multiple
> schemata you now have multiple qapi-types.[ch], but only one
> qapi-builtin-types.[ch].  Same for qapi-visit.[ch] and
> qapi-builtin-visit.[ch].
>
> Bonus: if all you need is built-in stuff, you can include a much
> smaller header.  To be exploited shortly.
>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>


> ---
>  Makefile               | 13 +++++---
>  Makefile.objs          |  1 +
>  scripts/qapi/common.py | 18 +++++------
>  scripts/qapi/types.py  | 82 ++++++++++++++++++++++++++----------------------
>  scripts/qapi/visit.py  | 84 ++++++++++++++++++++++++++++----------------------
>  5 files changed, 111 insertions(+), 87 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index e02f0c13ef..f9b7900330 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -88,10 +88,13 @@ endif
>  include $(SRC_PATH)/rules.mak
>
>  GENERATED_FILES = qemu-version.h config-host.h qemu-options.def
> -GENERATED_FILES += qmp-commands.h qapi-types.h qapi-visit.h qapi-event.h
> -GENERATED_FILES += qmp-marshal.c qapi-types.c qapi-visit.c qapi-event.c
> -GENERATED_FILES += qmp-introspect.h
> -GENERATED_FILES += qmp-introspect.c
> +GENERATED_FILES += qmp-commands.h qmp-marshal.c
> +GENERATED_FILES += qapi-builtin-types.h qapi-builtin-types.c
> +GENERATED_FILES += qapi-types.h qapi-types.c
> +GENERATED_FILES += qapi-builtin-visit.h qapi-builtin-visit.c
> +GENERATED_FILES += qapi-visit.h qapi-visit.c
> +GENERATED_FILES += qapi-event.h qapi-event.c
> +GENERATED_FILES += qmp-introspect.c qmp-introspect.h
>  GENERATED_FILES += qapi.texi
>
>  GENERATED_FILES += trace/generated-tcg-tracers.h
> @@ -514,7 +517,9 @@ qapi-modules = $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/qapi/common.json \
>                 $(SRC_PATH)/qapi/transaction.json \
>                 $(SRC_PATH)/qapi/ui.json
>
> +qapi-builtin-types.c qapi-builtin-types.h \
>  qapi-types.c qapi-types.h \
> +qapi-builtin-visit.c qapi-builtin-visit.h \
>  qapi-visit.c qapi-visit.h \
>  qmp-commands.h qmp-marshal.c \
>  qapi-event.c qapi-event.h \
> diff --git a/Makefile.objs b/Makefile.objs
> index 323ef12384..f16cca06e7 100644
> --- a/Makefile.objs
> +++ b/Makefile.objs
> @@ -2,6 +2,7 @@
>  # Common libraries for tools and emulators
>  stub-obj-y = stubs/ crypto/
>  util-obj-y = util/ qobject/ qapi/
> +util-obj-y += qapi-builtin-types.o qapi-builtin-visit.o
>  util-obj-y += qmp-introspect.o qapi-types.o qapi-visit.o qapi-event.o
>
>  chardev-obj-y = chardev/
> diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py
> index f4e9ebbb53..7ffffc78d9 100644
> --- a/scripts/qapi/common.py
> +++ b/scripts/qapi/common.py
> @@ -1527,11 +1527,10 @@ class QAPISchema(object):
>
>      def _def_builtin_type(self, name, json_type, c_type):
>          self._def_entity(QAPISchemaBuiltinType(name, json_type, c_type))
> -        # TODO As long as we have QAPI_TYPES_BUILTIN to share multiple
> -        # qapi-types.h from a single .c, all arrays of builtins must be
> -        # declared in the first file whether or not they are used.  Nicer
> -        # would be to use lazy instantiation, while figuring out how to
> -        # avoid compilation issues with multiple qapi-types.h.
> +        # Instantiating only the arrays that are actually used would
> +        # be nice, but we can't as long as their generated code
> +        # (qapi-builtin-types.[ch]) may be shared by some other
> +        # schema.
>          self._make_array_type(name, None)
>
>      def _def_predefineds(self):
> @@ -1985,14 +1984,15 @@ class QAPIGen(object):
>          return ''
>
>      def write(self, output_dir, fname):
> -        if output_dir:
> +        pathname = os.path.join(output_dir, fname)
> +        dir = os.path.dirname(pathname)
> +        if dir:
>              try:
> -                os.makedirs(output_dir)
> +                os.makedirs(dir)
>              except os.error as e:
>                  if e.errno != errno.EEXIST:
>                      raise
> -        fd = os.open(os.path.join(output_dir, fname),
> -                     os.O_RDWR | os.O_CREAT, 0666)
> +        fd = os.open(pathname, os.O_RDWR | os.O_CREAT, 0666)
>          f = os.fdopen(fd, 'r+')
>          text = (self.top(fname) + self._preamble + self._body
>                  + self.bottom(fname))
> diff --git a/scripts/qapi/types.py b/scripts/qapi/types.py
> index eeffcbf32c..f84ed17960 100644
> --- a/scripts/qapi/types.py
> +++ b/scripts/qapi/types.py
> @@ -171,64 +171,72 @@ class QAPISchemaGenTypeVisitor(QAPISchemaVisitor):
>      def __init__(self, opt_builtins, prefix):
>          self._opt_builtins = opt_builtins
>          self._prefix = prefix
> -        blurb = ' * Schema-defined QAPI types'
> -        self._genc = QAPIGenC(blurb, __doc__)
> -        self._genh = QAPIGenH(blurb, __doc__)
> +        self._module = {}
> +        self._add_module(None, ' * Built-in QAPI types')
>          self._genc.preamble(mcgen('''
>  #include "qemu/osdep.h"
>  #include "qapi/dealloc-visitor.h"
> -#include "%(prefix)sqapi-types.h"
> -#include "%(prefix)sqapi-visit.h"
> -''',
> -                                  prefix=prefix))
> +#include "qapi-builtin-types.h"
> +#include "qapi-builtin-visit.h"
> +'''))
>          self._genh.preamble(mcgen('''
>  #include "qapi/util.h"
>  '''))
> -        self._btin = '\n' + guardstart('QAPI_TYPES_BUILTIN')
> +
> +    def _module_basename(self, name):
> +        if name is None:
> +            return 'qapi-builtin-types'
> +        return self._prefix + 'qapi-types'
> +
> +    def _add_module(self, name, blurb):
> +        genc = QAPIGenC(blurb, __doc__)
> +        genh = QAPIGenH(blurb, __doc__)
> +        self._module[name] = (genc, genh)
> +        self._set_module(name)
> +
> +    def _set_module(self, name):
> +        self._genc, self._genh = self._module[name]
>
>      def write(self, output_dir):
> -        self._genc.write(output_dir, self._prefix + 'qapi-types.c')
> -        self._genh.write(output_dir, self._prefix + 'qapi-types.h')
> +        for name in self._module:
> +            if name is None and not self._opt_builtins:
> +                continue
> +            basename = self._module_basename(name)
> +            (genc, genh) = self._module[name]
> +            genc.write(output_dir, basename + '.c')
> +            genh.write(output_dir, basename + '.h')
>
>      def visit_begin(self, schema):
>          # gen_object() is recursive, ensure it doesn't visit the empty type
>          objects_seen.add(schema.the_empty_object_type.name)
>
> -    def visit_end(self):
> -        # To avoid header dependency hell, we always generate
> -        # declarations for built-in types in our header files and
> -        # simply guard them.  See also opt_builtins (command line
> -        # option -b).
> -        self._btin += guardend('QAPI_TYPES_BUILTIN')
> -        self._genh.preamble(self._btin)
> -        self._btin = None
> +    def visit_module(self, name):
> +        if len(self._module) != 1:
> +            return
> +        self._add_module(name, ' * Schema-defined QAPI types')
> +        self._genc.preamble(mcgen('''
> +#include "qemu/osdep.h"
> +#include "qapi/dealloc-visitor.h"
> +#include "%(prefix)sqapi-types.h"
> +#include "%(prefix)sqapi-visit.h"
> +''',
> +                                  prefix=self._prefix))
> +        self._genh.preamble(mcgen('''
> +#include "qapi-builtin-types.h"
> +'''))
>
>      def _gen_type_cleanup(self, name):
>          self._genh.body(gen_type_cleanup_decl(name))
>          self._genc.body(gen_type_cleanup(name))
>
>      def visit_enum_type(self, name, info, values, prefix):
> -        # Special case for our lone builtin enum type
> -        # TODO use something cleaner than existence of info
> -        if not info:
> -            self._btin += gen_enum(name, values, prefix)
> -            if self._opt_builtins:
> -                self._genc.body(gen_enum_lookup(name, values, prefix))
> -        else:
> -            self._genh.preamble(gen_enum(name, values, prefix))
> -            self._genc.body(gen_enum_lookup(name, values, prefix))
> +        self._genh.preamble(gen_enum(name, values, prefix))
> +        self._genc.body(gen_enum_lookup(name, values, prefix))
>
>      def visit_array_type(self, name, info, element_type):
> -        if isinstance(element_type, QAPISchemaBuiltinType):
> -            self._btin += gen_fwd_object_or_array(name)
> -            self._btin += gen_array(name, element_type)
> -            self._btin += gen_type_cleanup_decl(name)
> -            if self._opt_builtins:
> -                self._genc.body(gen_type_cleanup(name))
> -        else:
> -            self._genh.preamble(gen_fwd_object_or_array(name))
> -            self._genh.body(gen_array(name, element_type))
> -            self._gen_type_cleanup(name)
> +        self._genh.preamble(gen_fwd_object_or_array(name))
> +        self._genh.body(gen_array(name, element_type))
> +        self._gen_type_cleanup(name)
>
>      def visit_object_type(self, name, info, base, members, variants):
>          # Nothing to do for the special empty builtin
> diff --git a/scripts/qapi/visit.py b/scripts/qapi/visit.py
> index ee1a849574..f23e71bb9a 100644
> --- a/scripts/qapi/visit.py
> +++ b/scripts/qapi/visit.py
> @@ -267,58 +267,68 @@ class QAPISchemaGenVisitVisitor(QAPISchemaVisitor):
>      def __init__(self, opt_builtins, prefix):
>          self._opt_builtins = opt_builtins
>          self._prefix = prefix
> -        blurb = ' * Schema-defined QAPI visitors'
> -        self._genc = QAPIGenC(blurb, __doc__)
> -        self._genh = QAPIGenH(blurb, __doc__)
> +        self._module = {}
> +        self._add_module(None, ' * Built-in QAPI visitors')
>          self._genc.preamble(mcgen('''
>  #include "qemu/osdep.h"
>  #include "qemu-common.h"
>  #include "qapi/error.h"
> -#include "%(prefix)sqapi-visit.h"
> -''',
> -                                  prefix=prefix))
> +#include "qapi-builtin-visit.h"
> +'''))
>          self._genh.preamble(mcgen('''
>  #include "qapi/visitor.h"
>  #include "qapi/qmp/qerror.h"
> -#include "%(prefix)sqapi-types.h"
> +#include "qapi-builtin-types.h"
>  ''',
> -                                  prefix=prefix))
> -        self._btin = guardstart('QAPI_VISIT_BUILTIN')
> +                              prefix=prefix))
> +
> +    def _module_basename(self, name):
> +        if name is None:
> +            return 'qapi-builtin-visit'
> +        return self._prefix + 'qapi-visit'
> +
> +    def _add_module(self, name, blurb):
> +        genc = QAPIGenC(blurb, __doc__)
> +        genh = QAPIGenH(blurb, __doc__)
> +        self._module[name] = (genc, genh)
> +        self._set_module(name)
> +
> +    def _set_module(self, name):
> +        self._genc, self._genh = self._module[name]
>
>      def write(self, output_dir):
> -        self._genc.write(output_dir, self._prefix + 'qapi-visit.c')
> -        self._genh.write(output_dir, self._prefix + 'qapi-visit.h')
> +        for name in self._module:
> +            if name is None and not self._opt_builtins:
> +                continue
> +            basename = self._module_basename(name)
> +            (genc, genh) = self._module[name]
> +            genc.write(output_dir, basename + '.c')
> +            genh.write(output_dir, basename + '.h')
>
> -    def visit_end(self):
> -        # To avoid header dependency hell, we always generate
> -        # declarations for built-in types in our header files and
> -        # simply guard them.  See also opt_builtins (command line
> -        # option -b).
> -        self._btin += guardend('QAPI_VISIT_BUILTIN')
> -        self._genh.preamble(self._btin)
> -        self._btin = None
> +    def visit_module(self, name):
> +        if len(self._module) != 1:
> +            return
> +        self._add_module(name, ' * Schema-defined QAPI visitors')
> +        self._genc.preamble(mcgen('''
> +#include "qemu/osdep.h"
> +#include "qemu-common.h"
> +#include "qapi/error.h"
> +#include "%(prefix)sqapi-visit.h"
> +''',
> +                                  prefix=self._prefix))
> +        self._genh.preamble(mcgen('''
> +#include "qapi-builtin-visit.h"
> +#include "%(prefix)sqapi-types.h"
> +''',
> +                                  prefix=self._prefix))
>
>      def visit_enum_type(self, name, info, values, prefix):
> -        # Special case for our lone builtin enum type
> -        # TODO use something cleaner than existence of info
> -        if not info:
> -            self._btin += gen_visit_decl(name, scalar=True)
> -            if self._opt_builtins:
> -                self._genc.body(gen_visit_enum(name))
> -        else:
> -            self._genh.body(gen_visit_decl(name, scalar=True))
> -            self._genc.body(gen_visit_enum(name))
> +        self._genh.body(gen_visit_decl(name, scalar=True))
> +        self._genc.body(gen_visit_enum(name))
>
>      def visit_array_type(self, name, info, element_type):
> -        decl = gen_visit_decl(name)
> -        defn = gen_visit_list(name, element_type)
> -        if isinstance(element_type, QAPISchemaBuiltinType):
> -            self._btin += decl
> -            if self._opt_builtins:
> -                self._genc.body(defn)
> -        else:
> -            self._genh.body(decl)
> -            self._genc.body(defn)
> +        self._genh.body(gen_visit_decl(name))
> +        self._genc.body(gen_visit_list(name, element_type))
>
>      def visit_object_type(self, name, info, base, members, variants):
>          # Nothing to do for the special empty builtin
> --
> 2.13.6
>

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 18/21] qapi/common: Fix guardname() for funny filenames
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 18/21] qapi/common: Fix guardname() for funny filenames Markus Armbruster
@ 2018-02-05 13:47   ` Marc-Andre Lureau
  2018-02-06 21:00   ` Eric Blake
  1 sibling, 0 replies; 87+ messages in thread
From: Marc-Andre Lureau @ 2018-02-05 13:47 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: qemu-devel, marcandre, Blake, Eric, mdroth

On Fri, Feb 2, 2018 at 2:03 PM, Markus Armbruster <armbru@redhat.com> wrote:
> guardname() fails to return a valid C identifier for arguments
> containing anything but [A-Za-z0-9_.-'].  Fix that.
>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>


> ---
>  scripts/qapi/common.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py
> index 7ffffc78d9..7d497b5b17 100644
> --- a/scripts/qapi/common.py
> +++ b/scripts/qapi/common.py
> @@ -1860,7 +1860,7 @@ def mcgen(code, **kwds):
>
>
>  def guardname(filename):
> -    return c_name(filename, protect=False).upper()
> +    return re.sub(r'[^A-Za-z0-9_]', '_', filename).upper()
>
>
>  def guardstart(name):
> --
> 2.13.6
>

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 19/21] qapi/types: Generate separate .h, .c for each module
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 19/21] qapi/types: Generate separate .h, .c for each module Markus Armbruster
@ 2018-02-05 13:58   ` Marc-Andre Lureau
  0 siblings, 0 replies; 87+ messages in thread
From: Marc-Andre Lureau @ 2018-02-05 13:58 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: qemu-devel, marcandre, Blake, Eric, mdroth

On Fri, Feb 2, 2018 at 2:03 PM, Markus Armbruster <armbru@redhat.com> wrote:
> Our qapi-schema.json is composed of modules connected by include
> directives, but the generated code is monolithic all the same: one
> qapi-types.h with all the types, one qapi-visit.h with all the
> visitors, and so forth.  These monolithic headers get included all
> over the place.  In my "build everything" tree, adding a QAPI type
> recompiles about 4500 out of 4800 objects.
>
> Nobody would write such monolithic headers by hand.  It stands to
> reason that one shouldn't generate them, either.
>
> Split up generated qapi-types.h to mirror the schema's modular
> structure: one header per module.  Name the main module's header
> qapi-types.h, and sub-module D/B.json's header D/qapi-types-B.h.
>
> Mirror the schema's includes in the headers, so that qapi-types.h gets
> you everything exactly as before.  If you need less, you can include
> one or more of the sub-module headers.  To be exploited shortly.
>
> Split up qapi-types.c similarly.
>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

Most of the necessary split work is done in previous patch, this enables it:

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>


> ---
>  Makefile              | 30 ++++++++++++++++++++++++++++++
>  Makefile.objs         | 18 +++++++++++++++++-
>  scripts/qapi/types.py | 18 ++++++++++++++++--
>  3 files changed, 63 insertions(+), 3 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index f9b7900330..f1b68dca9b 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -91,6 +91,21 @@ GENERATED_FILES = qemu-version.h config-host.h qemu-options.def
>  GENERATED_FILES += qmp-commands.h qmp-marshal.c
>  GENERATED_FILES += qapi-builtin-types.h qapi-builtin-types.c
>  GENERATED_FILES += qapi-types.h qapi-types.c
> +GENERATED_FILES += qapi/qapi-types-block-core.h qapi/qapi-types-block-core.c
> +GENERATED_FILES += qapi/qapi-types-block.h qapi/qapi-types-block.c
> +GENERATED_FILES += qapi/qapi-types-char.h qapi/qapi-types-char.c
> +GENERATED_FILES += qapi/qapi-types-common.h qapi/qapi-types-common.c
> +GENERATED_FILES += qapi/qapi-types-crypto.h qapi/qapi-types-crypto.c
> +GENERATED_FILES += qapi/qapi-types-introspect.h qapi/qapi-types-introspect.c
> +GENERATED_FILES += qapi/qapi-types-migration.h qapi/qapi-types-migration.c
> +GENERATED_FILES += qapi/qapi-types-net.h qapi/qapi-types-net.c
> +GENERATED_FILES += qapi/qapi-types-rocker.h qapi/qapi-types-rocker.c
> +GENERATED_FILES += qapi/qapi-types-run-state.h qapi/qapi-types-run-state.c
> +GENERATED_FILES += qapi/qapi-types-sockets.h qapi/qapi-types-sockets.c
> +GENERATED_FILES += qapi/qapi-types-tpm.h qapi/qapi-types-tpm.c
> +GENERATED_FILES += qapi/qapi-types-trace.h qapi/qapi-types-trace.c
> +GENERATED_FILES += qapi/qapi-types-transaction.h qapi/qapi-types-transaction.c
> +GENERATED_FILES += qapi/qapi-types-ui.h qapi/qapi-types-ui.c
>  GENERATED_FILES += qapi-builtin-visit.h qapi-builtin-visit.c
>  GENERATED_FILES += qapi-visit.h qapi-visit.c
>  GENERATED_FILES += qapi-event.h qapi-event.c
> @@ -519,6 +534,21 @@ qapi-modules = $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/qapi/common.json \
>
>  qapi-builtin-types.c qapi-builtin-types.h \
>  qapi-types.c qapi-types.h \
> +qapi/qapi-types-block-core.c qapi/qapi-types-block-core.h \
> +qapi/qapi-types-block.c qapi/qapi-types-block.h \
> +qapi/qapi-types-char.c qapi/qapi-types-char.h \
> +qapi/qapi-types-common.c qapi/qapi-types-common.h \
> +qapi/qapi-types-crypto.c qapi/qapi-types-crypto.h \
> +qapi/qapi-types-introspect.c qapi/qapi-types-introspect.h \
> +qapi/qapi-types-migration.c qapi/qapi-types-migration.h \
> +qapi/qapi-types-net.c qapi/qapi-types-net.h \
> +qapi/qapi-types-rocker.c qapi/qapi-types-rocker.h \
> +qapi/qapi-types-run-state.c qapi/qapi-types-run-state.h \
> +qapi/qapi-types-sockets.c qapi/qapi-types-sockets.h \
> +qapi/qapi-types-tpm.c qapi/qapi-types-tpm.h \
> +qapi/qapi-types-trace.c qapi/qapi-types-trace.h \
> +qapi/qapi-types-transaction.c qapi/qapi-types-transaction.h \
> +qapi/qapi-types-ui.c qapi/qapi-types-ui.h \
>  qapi-builtin-visit.c qapi-builtin-visit.h \
>  qapi-visit.c qapi-visit.h \
>  qmp-commands.h qmp-marshal.c \
> diff --git a/Makefile.objs b/Makefile.objs
> index f16cca06e7..e7411a2658 100644
> --- a/Makefile.objs
> +++ b/Makefile.objs
> @@ -3,7 +3,23 @@
>  stub-obj-y = stubs/ crypto/
>  util-obj-y = util/ qobject/ qapi/
>  util-obj-y += qapi-builtin-types.o qapi-builtin-visit.o
> -util-obj-y += qmp-introspect.o qapi-types.o qapi-visit.o qapi-event.o
> +util-obj-y += qapi-types.o
> +util-obj-y += qapi/qapi-types-block-core.o
> +util-obj-y += qapi/qapi-types-block.o
> +util-obj-y += qapi/qapi-types-char.o
> +util-obj-y += qapi/qapi-types-common.o
> +util-obj-y += qapi/qapi-types-crypto.o
> +util-obj-y += qapi/qapi-types-introspect.o
> +util-obj-y += qapi/qapi-types-migration.o
> +util-obj-y += qapi/qapi-types-net.o
> +util-obj-y += qapi/qapi-types-rocker.o
> +util-obj-y += qapi/qapi-types-run-state.o
> +util-obj-y += qapi/qapi-types-sockets.o
> +util-obj-y += qapi/qapi-types-tpm.o
> +util-obj-y += qapi/qapi-types-trace.o
> +util-obj-y += qapi/qapi-types-transaction.o
> +util-obj-y += qapi/qapi-types-ui.o
> +util-obj-y += qmp-introspect.o qapi-visit.o qapi-event.o
>
>  chardev-obj-y = chardev/
>
> diff --git a/scripts/qapi/types.py b/scripts/qapi/types.py
> index f84ed17960..7bd8e1a978 100644
> --- a/scripts/qapi/types.py
> +++ b/scripts/qapi/types.py
> @@ -172,6 +172,7 @@ class QAPISchemaGenTypeVisitor(QAPISchemaVisitor):
>          self._opt_builtins = opt_builtins
>          self._prefix = prefix
>          self._module = {}
> +        self._main_module = None
>          self._add_module(None, ' * Built-in QAPI types')
>          self._genc.preamble(mcgen('''
>  #include "qemu/osdep.h"
> @@ -186,7 +187,11 @@ class QAPISchemaGenTypeVisitor(QAPISchemaVisitor):
>      def _module_basename(self, name):
>          if name is None:
>              return 'qapi-builtin-types'
> -        return self._prefix + 'qapi-types'
> +        basename = os.path.join(os.path.dirname(name),
> +                                self._prefix + 'qapi-types')
> +        if name == self._main_module:
> +            return basename
> +        return basename + '-' + os.path.splitext(os.path.basename(name))[0]
>
>      def _add_module(self, name, blurb):
>          genc = QAPIGenC(blurb, __doc__)
> @@ -211,7 +216,10 @@ class QAPISchemaGenTypeVisitor(QAPISchemaVisitor):
>          objects_seen.add(schema.the_empty_object_type.name)
>
>      def visit_module(self, name):
> -        if len(self._module) != 1:
> +        if self._main_module is None:
> +            self._main_module = name
> +        if name in self._module:
> +            self._set_module(name)
>              return
>          self._add_module(name, ' * Schema-defined QAPI types')
>          self._genc.preamble(mcgen('''
> @@ -225,6 +233,12 @@ class QAPISchemaGenTypeVisitor(QAPISchemaVisitor):
>  #include "qapi-builtin-types.h"
>  '''))
>
> +    def visit_include(self, name, info):
> +        self._genh.preamble(mcgen('''
> +#include "%(basename)s.h"
> +''',
> +                                  basename=self._module_basename(name)))
> +
>      def _gen_type_cleanup(self, name):
>          self._genh.body(gen_type_cleanup_decl(name))
>          self._genc.body(gen_type_cleanup(name))
> --
> 2.13.6
>

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 12/21] qapi: Concentrate QAPISchemaParser.exprs updates in .__init__()
  2018-02-05 13:45   ` Marc-Andre Lureau
@ 2018-02-05 14:26     ` Markus Armbruster
  0 siblings, 0 replies; 87+ messages in thread
From: Markus Armbruster @ 2018-02-05 14:26 UTC (permalink / raw)
  To: Marc-Andre Lureau; +Cc: marcandre, qemu-devel, mdroth

Marc-Andre Lureau <mlureau@redhat.com> writes:

> On Fri, Feb 2, 2018 at 2:03 PM, Markus Armbruster <armbru@redhat.com> wrote:
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>
> It's not obvious the motivation behind this change (beside behind more
> elegant), but

At one point during my search for a good way to record includes in the
parse tree, updating .exprs in two places got in the way, so I cleaned
it up.  I guess it's not in the way of the solution I eventually chose,
but I consider it a worthwhile little cleanup on its own.

> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

Thanks!

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 14/21] qapi: Generate in source order
  2018-02-05 13:45   ` Marc-Andre Lureau
@ 2018-02-05 14:33     ` Markus Armbruster
  2018-02-05 14:40       ` Marc-Andre Lureau
  2018-02-06 10:33       ` Markus Armbruster
  0 siblings, 2 replies; 87+ messages in thread
From: Markus Armbruster @ 2018-02-05 14:33 UTC (permalink / raw)
  To: Marc-Andre Lureau; +Cc: marcandre, qemu-devel, mdroth

Marc-Andre Lureau <mlureau@redhat.com> writes:

> On Fri, Feb 2, 2018 at 2:03 PM, Markus Armbruster <armbru@redhat.com> wrote:
>> The generators' conversion to visitors (merge commit 9e72681d16)
>> changed the processing order of entities from source order to
>> alphabetical order.  The next commit needs source order, so change it
>> back.
>>
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>> ---
>>  scripts/qapi/common.py                   |   4 +-
>>  tests/qapi-schema/comments.out           |   2 +-
>>  tests/qapi-schema/doc-bad-section.out    |   4 +-
>>  tests/qapi-schema/doc-good.out           |  32 ++--
>>  tests/qapi-schema/empty.out              |   2 +-
>>  tests/qapi-schema/event-case.out         |   2 +-
>>  tests/qapi-schema/ident-with-escape.out  |   6 +-
>>  tests/qapi-schema/include-relpath.out    |   2 +-
>>  tests/qapi-schema/include-repetition.out |   2 +-
>>  tests/qapi-schema/include-simple.out     |   2 +-
>>  tests/qapi-schema/indented-expr.out      |   2 +-
>>  tests/qapi-schema/qapi-schema-test.out   | 320 +++++++++++++++----------------
>>  12 files changed, 191 insertions(+), 189 deletions(-)
>>
>> diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py
>> index d5b93e7381..3b97bf8702 100644
>> --- a/scripts/qapi/common.py
>> +++ b/scripts/qapi/common.py
>> @@ -1471,6 +1471,7 @@ class QAPISchema(object):
>>          parser = QAPISchemaParser(open(fname, 'r'))
>>          exprs = check_exprs(parser.exprs)
>>          self.docs = parser.docs
>> +        self._entity_list = []
>>          self._entity_dict = {}
>>          self._predefining = True
>>          self._def_predefineds()
>> @@ -1482,6 +1483,7 @@ class QAPISchema(object):
>>          # Only the predefined types are allowed to not have info
>>          assert ent.info or self._predefining
>>          assert ent.name not in self._entity_dict
>> +        self._entity_list.append(ent)
>>          self._entity_dict[ent.name] = ent
>
> Why not use the OrderedDict instead?

Fair question!  However, the next patch will create anonymous entities,
which get added only to ._entity_list, not _entity_dict.

[...]

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 14/21] qapi: Generate in source order
  2018-02-05 14:33     ` Markus Armbruster
@ 2018-02-05 14:40       ` Marc-Andre Lureau
  2018-02-06 10:33       ` Markus Armbruster
  1 sibling, 0 replies; 87+ messages in thread
From: Marc-Andre Lureau @ 2018-02-05 14:40 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: marcandre, qemu-devel, mdroth

On Mon, Feb 5, 2018 at 3:33 PM, Markus Armbruster <armbru@redhat.com> wrote:
> Marc-Andre Lureau <mlureau@redhat.com> writes:
>
>> On Fri, Feb 2, 2018 at 2:03 PM, Markus Armbruster <armbru@redhat.com> wrote:
>>> The generators' conversion to visitors (merge commit 9e72681d16)
>>> changed the processing order of entities from source order to
>>> alphabetical order.  The next commit needs source order, so change it
>>> back.
>>>
>>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>>> ---
>>>  scripts/qapi/common.py                   |   4 +-
>>>  tests/qapi-schema/comments.out           |   2 +-
>>>  tests/qapi-schema/doc-bad-section.out    |   4 +-
>>>  tests/qapi-schema/doc-good.out           |  32 ++--
>>>  tests/qapi-schema/empty.out              |   2 +-
>>>  tests/qapi-schema/event-case.out         |   2 +-
>>>  tests/qapi-schema/ident-with-escape.out  |   6 +-
>>>  tests/qapi-schema/include-relpath.out    |   2 +-
>>>  tests/qapi-schema/include-repetition.out |   2 +-
>>>  tests/qapi-schema/include-simple.out     |   2 +-
>>>  tests/qapi-schema/indented-expr.out      |   2 +-
>>>  tests/qapi-schema/qapi-schema-test.out   | 320 +++++++++++++++----------------
>>>  12 files changed, 191 insertions(+), 189 deletions(-)
>>>
>>> diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py
>>> index d5b93e7381..3b97bf8702 100644
>>> --- a/scripts/qapi/common.py
>>> +++ b/scripts/qapi/common.py
>>> @@ -1471,6 +1471,7 @@ class QAPISchema(object):
>>>          parser = QAPISchemaParser(open(fname, 'r'))
>>>          exprs = check_exprs(parser.exprs)
>>>          self.docs = parser.docs
>>> +        self._entity_list = []
>>>          self._entity_dict = {}
>>>          self._predefining = True
>>>          self._def_predefineds()
>>> @@ -1482,6 +1483,7 @@ class QAPISchema(object):
>>>          # Only the predefined types are allowed to not have info
>>>          assert ent.info or self._predefining
>>>          assert ent.name not in self._entity_dict
>>> +        self._entity_list.append(ent)
>>>          self._entity_dict[ent.name] = ent
>>
>> Why not use the OrderedDict instead?
>
> Fair question!  However, the next patch will create anonymous entities,
> which get added only to ._entity_list, not _entity_dict.

I see, something we could improve or clarify, but that's ok to me as is:
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>


>
> [...]

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 20/21] Include less of qapi-types.h
  2018-02-05 13:46   ` Marc-Andre Lureau
@ 2018-02-05 14:53     ` Markus Armbruster
  0 siblings, 0 replies; 87+ messages in thread
From: Markus Armbruster @ 2018-02-05 14:53 UTC (permalink / raw)
  To: Marc-Andre Lureau; +Cc: marcandre, qemu-devel, mdroth

Marc-Andre Lureau <mlureau@redhat.com> writes:

> On Fri, Feb 2, 2018 at 2:03 PM, Markus Armbruster <armbru@redhat.com> wrote:
>> In my "build everything" tree, a change to the types in
>> qapi-schema.json triggers a recompile of about 4500 out of 4800
>> objects.
>>
>> The previous commit split up the generated qapi-types.h.  Replace
>> includes of qapi-types.h (i.e. all types) by includes of parts where
>> possible.
>>
>> To illustrate the benefits: adding a type to qapi/migration.json now
>> recompiles some 2300 instead of 4500 objects.  The next commit will
>> improve it further.
>>
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>
> for the record, what was your methodology?

I counted compiles like this:

    $ make 2>&1 | awk '/^  [A-Z]/ { h[$1]++ } END { n = asorti(h, x); for (i = 1; i <=n; i++) print x[i], h[x[i]] }'

> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

Thanks!

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 02/21] qapi: Generate up-to-date copyright notice
  2018-02-05 13:44   ` Marc-Andre Lureau
@ 2018-02-05 15:28     ` Markus Armbruster
  2018-02-05 15:45     ` Eric Blake
  1 sibling, 0 replies; 87+ messages in thread
From: Markus Armbruster @ 2018-02-05 15:28 UTC (permalink / raw)
  To: Marc-Andre Lureau; +Cc: marcandre, qemu-devel, mdroth

Marc-Andre Lureau <mlureau@redhat.com> writes:

> Hi
>
> On Fri, Feb 2, 2018 at 2:03 PM, Markus Armbruster <armbru@redhat.com> wrote:
>> Each generator carries a copyright notice for the generator itself,
>> and another one for the files it generates.  Only the former have been
>> updated along the way, the latter have not, and are all out of date.
>>
>> Fix by copying the generator's copyright notice to the generated files
>> instead.
>
> That makes sense, but we loose the Author lines in the generated
> files. Not a big deal I guess, but worth to point out, no?

We do.  They've become just as outdated as the copyright notices.
Giving them the same treatment doesn't seem to be worth the trouble.
I'm happy to explain this in the commit message.

>>
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>
> Other than that,
> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

Thanks!

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 03/21] qapi: New classes QAPIGenC, QAPIGenH, QAPIGenDoc
  2018-02-05 13:44   ` Marc-Andre Lureau
@ 2018-02-05 15:34     ` Markus Armbruster
  0 siblings, 0 replies; 87+ messages in thread
From: Markus Armbruster @ 2018-02-05 15:34 UTC (permalink / raw)
  To: Marc-Andre Lureau; +Cc: marcandre, qemu-devel, mdroth

Marc-Andre Lureau <mlureau@redhat.com> writes:

> Hi
>
> On Fri, Feb 2, 2018 at 2:03 PM, Markus Armbruster <armbru@redhat.com> wrote:
>> These classes encapsulate accumulating and writing output.
>>
>> Convert C code generation to QAPIGenC and QAPIGenH.  The conversion is
>> rather shallow: most of the output accumulation is not converted.
>> Left for later.
>>
>> The indentation machinery uses a single global variable indent_level,
>> even though we generally interleave creation of a .c and its .h.  It
>> should become instance variable of QAPIGenC.  Also left for later.
>>
>> Documentation generation isn't converted, and QAPIGenDoc isn't used.
>> This will change shortly.
>>
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>> ---
>>  scripts/qapi-commands.py   | 27 ++++++-------
>>  scripts/qapi-event.py      | 26 +++++++------
>>  scripts/qapi-introspect.py | 22 ++++++-----
>>  scripts/qapi-types.py      | 26 +++++++------
>>  scripts/qapi-visit.py      | 26 +++++++------
>>  scripts/qapi.py            | 96 ++++++++++++++++++++++++++--------------------
>>  6 files changed, 122 insertions(+), 101 deletions(-)
>>
>> diff --git a/scripts/qapi-commands.py b/scripts/qapi-commands.py
>> index a861ac52e7..4be7dbc482 100644
>> --- a/scripts/qapi-commands.py
>> +++ b/scripts/qapi-commands.py
>> @@ -260,12 +260,10 @@ blurb = '''
>>   * Schema-defined QAPI/QMP commands
>>  '''
>>
>> -(fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix,
>> -                            'qmp-marshal.c', 'qmp-commands.h',
>> -                            blurb, __doc__)
>> -
>> -fdef.write(mcgen('''
>> +genc = QAPIGenC(blurb, __doc__)
>> +genh = QAPIGenH(blurb, __doc__)
>>
>> +genc.body(mcgen('''
>>  #include "qemu/osdep.h"
>>  #include "qemu-common.h"
>>  #include "qemu/module.h"
>> @@ -279,21 +277,24 @@ fdef.write(mcgen('''
>>  #include "%(prefix)sqmp-commands.h"
>>
>>  ''',
>> -                 prefix=prefix))
>> +                prefix=prefix))
>>
>> -fdecl.write(mcgen('''
>> +genh.body(mcgen('''
>>  #include "%(prefix)sqapi-types.h"
>>  #include "qapi/qmp/qdict.h"
>>  #include "qapi/qmp/dispatch.h"
>>
>>  void %(c_prefix)sqmp_init_marshal(QmpCommandList *cmds);
>>  ''',
>> -                  prefix=prefix, c_prefix=c_name(prefix, protect=False)))
>> +                prefix=prefix, c_prefix=c_name(prefix, protect=False)))
>>
>>  schema = QAPISchema(input_file)
>> -gen = QAPISchemaGenCommandVisitor()
>> -schema.visit(gen)
>> -fdef.write(gen.defn)
>> -fdecl.write(gen.decl)
>> +vis = QAPISchemaGenCommandVisitor()
>> +schema.visit(vis)
>> +genc.body(vis.defn)
>> +genh.body(vis.decl)
>>
>> -close_output(fdef, fdecl)
>> +if do_c:
>> +    genc.write(output_dir, prefix + 'qmp-marshal.c')
>> +if do_h:
>> +    genh.write(output_dir, prefix + 'qmp-commands.h')
>> diff --git a/scripts/qapi-event.py b/scripts/qapi-event.py
>> index b1d611c5ea..da3de17c76 100644
>> --- a/scripts/qapi-event.py
>> +++ b/scripts/qapi-event.py
>> @@ -176,11 +176,10 @@ blurb = '''
>>   * Schema-defined QAPI/QMP events
>>  '''
>>
>> -(fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix,
>> -                            'qapi-event.c', 'qapi-event.h',
>> -                            blurb, __doc__)
>> +genc = QAPIGenC(blurb, __doc__)
>> +genh = QAPIGenH(blurb, __doc__)
>>
>> -fdef.write(mcgen('''
>> +genc.body(mcgen('''
>>  #include "qemu/osdep.h"
>>  #include "qemu-common.h"
>>  #include "%(prefix)sqapi-event.h"
>> @@ -190,22 +189,25 @@ fdef.write(mcgen('''
>>  #include "qapi/qmp-event.h"
>>
>>  ''',
>> -                 prefix=prefix))
>> +                prefix=prefix))
>>
>> -fdecl.write(mcgen('''
>> +genh.body(mcgen('''
>>  #include "qapi/util.h"
>>  #include "qapi/qmp/qdict.h"
>>  #include "%(prefix)sqapi-types.h"
>>
>>  ''',
>> -                  prefix=prefix))
>> +                prefix=prefix))
>>
>>  event_enum_name = c_name(prefix + 'QAPIEvent', protect=False)
>>
>>  schema = QAPISchema(input_file)
>> -gen = QAPISchemaGenEventVisitor()
>> -schema.visit(gen)
>> -fdef.write(gen.defn)
>> -fdecl.write(gen.decl)
>> +vis = QAPISchemaGenEventVisitor()
>> +schema.visit(vis)
>> +genc.body(vis.defn)
>> +genh.body(vis.decl)
>>
>> -close_output(fdef, fdecl)
>> +if do_c:
>> +    genc.write(output_dir, prefix + 'qapi-event.c')
>> +if do_h:
>> +    genh.write(output_dir, prefix + 'qapi-event.h')
>> diff --git a/scripts/qapi-introspect.py b/scripts/qapi-introspect.py
>> index bd9253a172..c654f8fa94 100644
>> --- a/scripts/qapi-introspect.py
>> +++ b/scripts/qapi-introspect.py
>> @@ -181,21 +181,23 @@ blurb = '''
>>   * QAPI/QMP schema introspection
>>  '''
>>
>> -(fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix,
>> -                            'qmp-introspect.c', 'qmp-introspect.h',
>> -                            blurb, __doc__)
>> +genc = QAPIGenC(blurb, __doc__)
>> +genh = QAPIGenH(blurb, __doc__)
>>
>> -fdef.write(mcgen('''
>> +genc.body(mcgen('''
>>  #include "qemu/osdep.h"
>>  #include "%(prefix)sqmp-introspect.h"
>>
>>  ''',
>> -                 prefix=prefix))
>> +                prefix=prefix))
>>
>>  schema = QAPISchema(input_file)
>> -gen = QAPISchemaGenIntrospectVisitor(opt_unmask)
>> -schema.visit(gen)
>> -fdef.write(gen.defn)
>> -fdecl.write(gen.decl)
>> +vis = QAPISchemaGenIntrospectVisitor(opt_unmask)
>> +schema.visit(vis)
>> +genc.body(vis.defn)
>> +genh.body(vis.decl)
>>
>> -close_output(fdef, fdecl)
>> +if do_c:
>> +    genc.write(output_dir, prefix + 'qmp-introspect.c')
>> +if do_h:
>> +    genh.write(output_dir, prefix + 'qmp-introspect.h')
>> diff --git a/scripts/qapi-types.py b/scripts/qapi-types.py
>> index 1103dbda2d..97406b3368 100644
>> --- a/scripts/qapi-types.py
>> +++ b/scripts/qapi-types.py
>> @@ -180,7 +180,7 @@ class QAPISchemaGenTypeVisitor(QAPISchemaVisitor):
>>          self.decl = ''
>>          self.defn = ''
>>          self._fwdecl = ''
>> -        self._btin = guardstart('QAPI_TYPES_BUILTIN')
>> +        self._btin = '\n' + guardstart('QAPI_TYPES_BUILTIN')
>>
>>      def visit_end(self):
>>          self.decl = self._fwdecl + self.decl
>> @@ -256,26 +256,28 @@ blurb = '''
>>   * Schema-defined QAPI types
>>  '''
>>
>> -(fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix,
>> -                            'qapi-types.c', 'qapi-types.h',
>> -                            blurb, __doc__)
>> +genc = QAPIGenC(blurb, __doc__)
>> +genh = QAPIGenH(blurb, __doc__)
>>
>> -fdef.write(mcgen('''
>> +genc.body(mcgen('''
>>  #include "qemu/osdep.h"
>>  #include "qapi/dealloc-visitor.h"
>>  #include "%(prefix)sqapi-types.h"
>>  #include "%(prefix)sqapi-visit.h"
>>  ''',
>> -                 prefix=prefix))
>> +                prefix=prefix))
>>
>> -fdecl.write(mcgen('''
>> +genh.body(mcgen('''
>>  #include "qapi/util.h"
>>  '''))
>>
>>  schema = QAPISchema(input_file)
>> -gen = QAPISchemaGenTypeVisitor()
>> -schema.visit(gen)
>> -fdef.write(gen.defn)
>> -fdecl.write(gen.decl)
>> +vis = QAPISchemaGenTypeVisitor()
>> +schema.visit(vis)
>> +genc.body(vis.defn)
>> +genh.body(vis.decl)
>>
>> -close_output(fdef, fdecl)
>> +if do_c:
>> +    genc.write(output_dir, prefix + 'qapi-types.c')
>> +if do_h:
>> +    genh.write(output_dir, prefix + 'qapi-types.h')
>> diff --git a/scripts/qapi-visit.py b/scripts/qapi-visit.py
>> index 5231f89c36..d1b25daf0d 100644
>> --- a/scripts/qapi-visit.py
>> +++ b/scripts/qapi-visit.py
>> @@ -339,30 +339,32 @@ blurb = '''
>>   * Schema-defined QAPI visitors
>>  '''
>>
>> -(fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix,
>> -                            'qapi-visit.c', 'qapi-visit.h',
>> -                            blurb, __doc__)
>> +genc = QAPIGenC(blurb, __doc__)
>> +genh = QAPIGenH(blurb, __doc__)
>>
>> -fdef.write(mcgen('''
>> +genc.body(mcgen('''
>>  #include "qemu/osdep.h"
>>  #include "qemu-common.h"
>>  #include "qapi/error.h"
>>  #include "%(prefix)sqapi-visit.h"
>>  ''',
>> -                 prefix=prefix))
>> +                prefix=prefix))
>>
>> -fdecl.write(mcgen('''
>> +genh.body(mcgen('''
>>  #include "qapi/visitor.h"
>>  #include "qapi/qmp/qerror.h"
>>  #include "%(prefix)sqapi-types.h"
>>
>>  ''',
>> -                  prefix=prefix))
>> +                prefix=prefix))
>>
>>  schema = QAPISchema(input_file)
>> -gen = QAPISchemaGenVisitVisitor()
>> -schema.visit(gen)
>> -fdef.write(gen.defn)
>> -fdecl.write(gen.decl)
>> +vis = QAPISchemaGenVisitVisitor()
>> +schema.visit(vis)
>> +genc.body(vis.defn)
>> +genh.body(vis.decl)
>>
>> -close_output(fdef, fdecl)
>> +if do_c:
>> +    genc.write(output_dir, prefix + 'qapi-visit.c')
>> +if do_h:
>> +    genh.write(output_dir, prefix + 'qapi-visit.h')
>> diff --git a/scripts/qapi.py b/scripts/qapi.py
>> index d0816f7479..d73ef618e2 100644
>> --- a/scripts/qapi.py
>> +++ b/scripts/qapi.py
>> @@ -2,7 +2,7 @@
>>  # QAPI helper library
>>  #
>>  # Copyright IBM, Corp. 2011
>> -# Copyright (c) 2013-2016 Red Hat Inc.
>> +# Copyright (c) 2013-2018 Red Hat Inc.
>>  #
>>  # Authors:
>>  #  Anthony Liguori <aliguori@us.ibm.com>
>> @@ -1820,7 +1820,6 @@ def guardname(filename):
>>
>>  def guardstart(name):
>>      return mcgen('''
>> -
>>  #ifndef %(name)s
>>  #define %(name)s
>>
>> @@ -1832,7 +1831,6 @@ def guardend(name):
>>      return mcgen('''
>>
>>  #endif /* %(name)s */
>> -
>>  ''',
>>                   name=guardname(name))
>>
>> @@ -1970,17 +1968,53 @@ def parse_command_line(extra_options='', extra_long_options=[]):
>>
>>      return (fname, output_dir, do_c, do_h, prefix, extra_opts)
>>
>> +
>>  #
>> -# Generate output files with boilerplate
>> +# Accumulate and write output
>>  #
>>
>> +class QAPIGen(object):
>> +
>> +    def __init__(self):
>> +        self._preamble = ''
>> +        self._body = ''
>> +
>> +    def preamble(self, text):
>> +        self._preamble += text
>> +
>> +    def body(self, text):
>> +        self._body += text
>> +
>> +    def top(self, fname):
>> +        return ''
>> +
>> +    def bottom(self, fname):
>> +        return ''
>> +
>
> Some methods appends, other return. That's a bit confusing. Why not
> name them accordingly? add_preamble, add_body, get_top...?

You're right, the functions called for side effects have less than
obvious names.  I think I'll keep the noun names for the pure functions.

>> +    def write(self, output_dir, fname):
>> +        if output_dir:
>> +            try:
>> +                os.makedirs(output_dir)
>> +            except os.error as e:
>> +                if e.errno != errno.EEXIST:
>> +                    raise
>> +        f = open(os.path.join(output_dir, fname), 'w')
>> +        f.write(self.top(fname) + self._preamble + self._body
>> +                + self.bottom(fname))
>> +        f.close()
>> +
>> +
>> +class QAPIGenC(QAPIGen):
>> +
>> +    def __init__(self, blurb, pydoc):
>> +        QAPIGen.__init__(self)
>> +        self._blurb = blurb.strip('\n')
>> +        self._copyright = '\n * '.join(re.findall(r'^Copyright .*', pydoc,
>> +                                                  re.MULTILINE))
>>
>> -def open_output(output_dir, do_c, do_h, prefix, c_file, h_file, blurb, doc):
>> -    guard = guardname(prefix + h_file)
>> -    c_file = output_dir + prefix + c_file
>> -    h_file = output_dir + prefix + h_file
>> -    copyright = '\n * '.join(re.findall(r'^Copyright .*', doc, re.MULTILINE))
>> -    comment = mcgen('''/* AUTOMATICALLY GENERATED, DO NOT MODIFY */
>> +    def top(self, fname):
>> +        return mcgen('''
>> +/* AUTOMATICALLY GENERATED, DO NOT MODIFY */
>>
>>  /*
>>  %(blurb)s
>> @@ -1992,41 +2026,19 @@ def open_output(output_dir, do_c, do_h, prefix, c_file, h_file, blurb, doc):
>>   */
>>
>>  ''',
>> -                    blurb=blurb.strip('\n'), copyright=copyright)
>> +                     blurb=self._blurb, copyright=self._copyright)
>>
>> -    if output_dir:
>> -        try:
>> -            os.makedirs(output_dir)
>> -        except os.error as e:
>> -            if e.errno != errno.EEXIST:
>> -                raise
>>
>> -    def maybe_open(really, name, opt):
>> -        if really:
>> -            return open(name, opt)
>> -        else:
>> -            import StringIO
>> -            return StringIO.StringIO()
>> +class QAPIGenH(QAPIGenC):
>>
>> -    fdef = maybe_open(do_c, c_file, 'w')
>> -    fdecl = maybe_open(do_h, h_file, 'w')
>> +    def top(self, fname):
>> +        return QAPIGenC.top(self, fname) + guardstart(fname)
>>
>> -    fdef.write(comment)
>> -    fdecl.write(comment)
>> -    fdecl.write(mcgen('''
>> -#ifndef %(guard)s
>> -#define %(guard)s
>> +    def bottom(self, fname):
>> +        return guardend(fname)
>>
>> -''',
>> -                      guard=guard))
>>
>> -    return (fdef, fdecl)
>> -
>> -
>> -def close_output(fdef, fdecl):
>> -    fdecl.write(mcgen('''
>> -
>> -#endif
>> -'''))
>> -    fdecl.close()
>> -    fdef.close()
>> +class QAPIGenDoc(QAPIGen):
>> +    def top(self, fname):
>> +        return (QAPIGen.top(self, fname)
>> +                + '@c AUTOMATICALLY GENERATED, DO NOT MODIFY\n\n')
>> --
>> 2.13.6
>>
>
> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

Thanks!

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 06/21] qapi-gen: New common driver for code and doc generators
  2018-02-05 13:44   ` Marc-Andre Lureau
@ 2018-02-05 15:36     ` Markus Armbruster
  2018-02-08  9:55       ` Markus Armbruster
  0 siblings, 1 reply; 87+ messages in thread
From: Markus Armbruster @ 2018-02-05 15:36 UTC (permalink / raw)
  To: Marc-Andre Lureau; +Cc: marcandre, qemu-devel, mdroth

Marc-Andre Lureau <mlureau@redhat.com> writes:

> On Fri, Feb 2, 2018 at 2:03 PM, Markus Armbruster <armbru@redhat.com> wrote:
>> Whenever qapi-schema.json changes, we run six programs eleven times to
>> update eleven files.  This is silly.  Replace the six programs by a
>> single program that spits out all eleven files.
>>
>
> Now we will need documentation update.

Absolutely!  One reason this is RFC.

> Also greping for the renamed files:
>
> git grep -E 'qapi-commands|qapi2texi|qapi-event.py|qapi-intros|qapi-types.py|qapi-visit.py'
> docs/devel/qapi-code-gen.txt:=== scripts/qapi-types.py ===
> docs/devel/qapi-code-gen.txt:    $ python scripts/qapi-types.py
> --output-dir="qapi-generated" \
> docs/devel/qapi-code-gen.txt:=== scripts/qapi-visit.py ===
> docs/devel/qapi-code-gen.txt:    $ python scripts/qapi-visit.py
> --output-dir="qapi-generated"
> docs/devel/qapi-code-gen.txt:=== scripts/qapi-commands.py ===
> docs/devel/qapi-code-gen.txt:                        generated by
> qapi-visit.py are used to
> docs/devel/qapi-code-gen.txt:    $ python scripts/qapi-commands.py
> --output-dir="qapi-generated"
> docs/devel/qapi-code-gen.txt:=== scripts/qapi-event.py ===
> docs/devel/qapi-code-gen.txt:    $ python scripts/qapi-event.py
> --output-dir="qapi-generated"
> docs/devel/qapi-code-gen.txt:=== scripts/qapi-introspect.py ===
> docs/devel/qapi-code-gen.txt:    $ python scripts/qapi-introspect.py
> --output-dir="qapi-generated"
> monitor.c: * qapi-introspect.py's output actually conforms to the schema.
> qapi-schema.json:# Documentation generated with qapi2texi.py is in
> source order, with
>
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>> ---
>>  Makefile                                           | 86 ++++++++++------------
>>  scripts/qapi-gen.py                                | 41 +++++++++++
>>  scripts/qapi/__init__.py                           |  0
>>  scripts/{qapi-commands.py => qapi/commands.py}     | 23 ++----
>>  scripts/{qapi.py => qapi/common.py}                |  0
>>  scripts/{qapi2texi.py => qapi/doc.py}              | 29 ++------
>>  scripts/{qapi-event.py => qapi/events.py}          | 23 ++----
>>  scripts/{qapi-introspect.py => qapi/introspect.py} | 32 ++------
>>  scripts/{qapi-types.py => qapi/types.py}           | 34 ++-------
>>  scripts/{qapi-visit.py => qapi/visit.py}           | 34 ++-------
>>  tests/Makefile.include                             | 56 +++++++-------
>>  tests/qapi-schema/test-qapi.py                     |  2 +-
>>  12 files changed, 140 insertions(+), 220 deletions(-)
>>  create mode 100755 scripts/qapi-gen.py
>>  create mode 100644 scripts/qapi/__init__.py
>>  rename scripts/{qapi-commands.py => qapi/commands.py} (94%)
>>  rename scripts/{qapi.py => qapi/common.py} (100%)
>>  rename scripts/{qapi2texi.py => qapi/doc.py} (92%)
>>  mode change 100755 => 100644
>>  rename scripts/{qapi-event.py => qapi/events.py} (92%)
>>  rename scripts/{qapi-introspect.py => qapi/introspect.py} (90%)
>>  rename scripts/{qapi-types.py => qapi/types.py} (90%)
>>  rename scripts/{qapi-visit.py => qapi/visit.py} (92%)
>>
>> diff --git a/Makefile b/Makefile
>> index af31e8981f..e02f0c13ef 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -92,6 +92,7 @@ GENERATED_FILES += qmp-commands.h qapi-types.h qapi-visit.h qapi-event.h
>>  GENERATED_FILES += qmp-marshal.c qapi-types.c qapi-visit.c qapi-event.c
>>  GENERATED_FILES += qmp-introspect.h
>>  GENERATED_FILES += qmp-introspect.c
>> +GENERATED_FILES += qapi.texi
>>
>>  GENERATED_FILES += trace/generated-tcg-tracers.h
>>
>> @@ -477,25 +478,26 @@ qemu-ga$(EXESUF): QEMU_CFLAGS += -I qga/qapi-generated
>>  qemu-keymap$(EXESUF): LIBS += $(XKBCOMMON_LIBS)
>>  qemu-keymap$(EXESUF): QEMU_CFLAGS += $(XKBCOMMON_CFLAGS)
>>
>> -gen-out-type = $(subst .,-,$(suffix $@))
>> +qapi-py = $(SRC_PATH)/scripts/qapi/commands.py \
>> +$(SRC_PATH)/scripts/qapi/events.py \
>> +$(SRC_PATH)/scripts/qapi/introspect.py \
>> +$(SRC_PATH)/scripts/qapi/types.py \
>> +$(SRC_PATH)/scripts/qapi/visit.py \
>> +$(SRC_PATH)/scripts/qapi/common.py \
>> +$(SRC_PATH)/scripts/qapi/doc.py \
>> +$(SRC_PATH)/scripts/ordereddict.py \
>> +$(SRC_PATH)/scripts/qapi-gen.py
>>
>> -qapi-py = $(SRC_PATH)/scripts/qapi.py $(SRC_PATH)/scripts/ordereddict.py
>> -
>> -qga/qapi-generated/qga-qapi-types.c qga/qapi-generated/qga-qapi-types.h :\
>> -$(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-types.py $(qapi-py)
>> -       $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py \
>> -               $(gen-out-type) -o qga/qapi-generated -p "qga-" $<, \
>> -               "GEN","$@")
>> -qga/qapi-generated/qga-qapi-visit.c qga/qapi-generated/qga-qapi-visit.h :\
>> -$(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py)
>> -       $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py \
>> -               $(gen-out-type) -o qga/qapi-generated -p "qga-" $<, \
>> -               "GEN","$@")
>> -qga/qapi-generated/qga-qmp-commands.h qga/qapi-generated/qga-qmp-marshal.c :\
>> -$(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py)
>> -       $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py \
>> -               $(gen-out-type) -o qga/qapi-generated -p "qga-" $<, \
>> -               "GEN","$@")
>> +qga/qapi-generated/qga-qapi-types.c qga/qapi-generated/qga-qapi-types.h \
>> +qga/qapi-generated/qga-qapi-visit.c qga/qapi-generated/qga-qapi-visit.h \
>> +qga/qapi-generated/qga-qmp-commands.h qga/qapi-generated/qga-qmp-marshal.c \
>> +qga/qapi-generated/qga-qapi.texi: \
>> +qga/qapi-generated/qapi-gen-timestamp ;
>> +qga/qapi-generated/qapi-gen-timestamp: $(SRC_PATH)/qga/qapi-schema.json $(qapi-py)
>> +       $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-gen.py \
>> +               -o qga/qapi-generated -p "qga-" $<, \
>> +               "GEN","$(@:%-timestamp=%)")
>> +       @>$@
>>
>>  qapi-modules = $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/qapi/common.json \
>>                 $(SRC_PATH)/qapi/block.json $(SRC_PATH)/qapi/block-core.json \
>> @@ -512,31 +514,18 @@ qapi-modules = $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/qapi/common.json \
>>                 $(SRC_PATH)/qapi/transaction.json \
>>                 $(SRC_PATH)/qapi/ui.json
>>
>> -qapi-types.c qapi-types.h :\
>> -$(qapi-modules) $(SRC_PATH)/scripts/qapi-types.py $(qapi-py)
>> -       $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py \
>> -               $(gen-out-type) -o "." -b $<, \
>> -               "GEN","$@")
>> -qapi-visit.c qapi-visit.h :\
>> -$(qapi-modules) $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py)
>> -       $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py \
>> -               $(gen-out-type) -o "." -b $<, \
>> -               "GEN","$@")
>> -qapi-event.c qapi-event.h :\
>> -$(qapi-modules) $(SRC_PATH)/scripts/qapi-event.py $(qapi-py)
>> -       $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-event.py \
>> -               $(gen-out-type) -o "." $<, \
>> -               "GEN","$@")
>> -qmp-commands.h qmp-marshal.c :\
>> -$(qapi-modules) $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py)
>> -       $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py \
>> -               $(gen-out-type) -o "." $<, \
>> -               "GEN","$@")
>> -qmp-introspect.h qmp-introspect.c :\
>> -$(qapi-modules) $(SRC_PATH)/scripts/qapi-introspect.py $(qapi-py)
>> -       $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-introspect.py \
>> -               $(gen-out-type) -o "." $<, \
>> -               "GEN","$@")
>> +qapi-types.c qapi-types.h \
>> +qapi-visit.c qapi-visit.h \
>> +qmp-commands.h qmp-marshal.c \
>> +qapi-event.c qapi-event.h \
>> +qmp-introspect.h qmp-introspect.c \
>> +qapi.texi: \
>> +qapi-gen-timestamp ;
>> +qapi-gen-timestamp: $(qapi-modules) $(qapi-py)
>> +       $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-gen.py \
>> +               -o "." -b $<, \
>> +               "GEN","$(@:%-timestamp=%)")
>> +       @>$@
>>
>>  QGALIB_GEN=$(addprefix qga/qapi-generated/, qga-qapi-types.h qga-qapi-visit.h qga-qmp-commands.h)
>>  $(qga-obj-y): $(QGALIB_GEN)
>> @@ -596,6 +585,7 @@ clean:
>>         rm -f trace/generated-tracers-dtrace.dtrace*
>>         rm -f trace/generated-tracers-dtrace.h*
>>         rm -f $(foreach f,$(GENERATED_FILES),$(f) $(f)-timestamp)
>> +       rm -f qapi-gen-timestamp
>>         rm -rf qapi-generated
>>         rm -rf qga/qapi-generated
>>         for d in $(ALL_SUBDIRS); do \
>> @@ -803,13 +793,11 @@ qemu-monitor-info.texi: $(SRC_PATH)/hmp-commands-info.hx $(SRC_PATH)/scripts/hxt
>>  qemu-img-cmds.texi: $(SRC_PATH)/qemu-img-cmds.hx $(SRC_PATH)/scripts/hxtool
>>         $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"GEN","$@")
>>
>> -docs/interop/qemu-qmp-qapi.texi docs/interop/qemu-ga-qapi.texi: $(SRC_PATH)/scripts/qapi2texi.py $(qapi-py)
>> +docs/interop/qemu-qmp-qapi.texi: qapi.texi
>> +       @cp -p $< $@
>>
>> -docs/interop/qemu-qmp-qapi.texi: $(qapi-modules)
>> -       $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi2texi.py $< > $@,"GEN","$@")
>> -
>> -docs/interop/qemu-ga-qapi.texi: $(SRC_PATH)/qga/qapi-schema.json
>> -       $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi2texi.py $< > $@,"GEN","$@")
>> +docs/interop/qemu-ga-qapi.texi: qga/qapi-generated/qga-qapi.texi
>> +       @cp -p $< $@
>>
>>  qemu.1: qemu-doc.texi qemu-options.texi qemu-monitor.texi qemu-monitor-info.texi
>>  qemu.1: qemu-option-trace.texi
>> diff --git a/scripts/qapi-gen.py b/scripts/qapi-gen.py
>> new file mode 100755
>> index 0000000000..575c938a1b
>> --- /dev/null
>> +++ b/scripts/qapi-gen.py
>> @@ -0,0 +1,41 @@
>> +#!/usr/bin/env python
>> +# QAPI generator
>> +#
>> +# This work is licensed under the terms of the GNU GPL, version 2 or later.
>> +# See the COPYING file in the top-level directory.
>> +
>> +import sys
>> +from qapi.common import parse_command_line, QAPISchema
>> +from qapi.types import gen_types
>> +from qapi.visit import gen_visit
>> +from qapi.commands import gen_commands
>> +from qapi.events import gen_events
>> +from qapi.introspect import gen_introspect
>> +from qapi.doc import gen_doc
>> +
>> +
>> +def main(argv):
>> +    (input_file, output_dir, do_c, do_h, prefix, opts) = \
>> +        parse_command_line('bu', ['builtins', 'unmask-non-abi-names'])
>> +
>> +    opt_builtins = False
>> +    opt_unmask = False
>> +
>> +    for o, a in opts:
>> +        if o in ('-b', '--builtins'):
>> +            opt_builtins = True
>> +        if o in ('-u', '--unmask-non-abi-names'):
>> +            opt_unmask = True
>> +
>> +    schema = QAPISchema(input_file)
>> +
>> +    gen_types(schema, output_dir, prefix, opt_builtins)
>> +    gen_visit(schema, output_dir, prefix, opt_builtins)
>> +    gen_commands(schema, output_dir, prefix)
>> +    gen_events(schema, output_dir, prefix)
>> +    gen_introspect(schema, output_dir, prefix, opt_unmask)
>> +    gen_doc(schema, output_dir, prefix)
>> +
>> +
>> +if __name__ == '__main__':
>> +    main(sys.argv)
>> diff --git a/scripts/qapi/__init__.py b/scripts/qapi/__init__.py
>> new file mode 100644
>> index 0000000000..e69de29bb2
>> diff --git a/scripts/qapi-commands.py b/scripts/qapi/commands.py
>> similarity index 94%
>> rename from scripts/qapi-commands.py
>> rename to scripts/qapi/commands.py
>> index 331b58670e..383a4dd426 100644
>> --- a/scripts/qapi-commands.py
>> +++ b/scripts/qapi/commands.py
>> @@ -13,7 +13,7 @@ This work is licensed under the terms of the GNU GPL, version 2.
>>  See the COPYING file in the top-level directory.
>>  """
>>
>> -from qapi import *
>> +from qapi.common import *
>>
>>
>>  def gen_command_decl(name, arg_type, boxed, ret_type):
>> @@ -255,13 +255,8 @@ class QAPISchemaGenCommandVisitor(QAPISchemaVisitor):
>>          self._regy += gen_register_command(name, success_response)
>>
>>
>> -def main(argv):
>> -    (input_file, output_dir, do_c, do_h, prefix, opts) = parse_command_line()
>> -
>> -    blurb = '''
>> - * Schema-defined QAPI/QMP commands
>> -'''
>> -
>> +def gen_commands(schema, output_dir, prefix):
>> +    blurb = ' * Schema-defined QAPI/QMP commands'
>>      genc = QAPIGenC(blurb, __doc__)
>>      genh = QAPIGenH(blurb, __doc__)
>>
>> @@ -290,17 +285,9 @@ void %(c_prefix)sqmp_init_marshal(QmpCommandList *cmds);
>>  ''',
>>                      prefix=prefix, c_prefix=c_name(prefix, protect=False)))
>>
>> -    schema = QAPISchema(input_file)
>>      vis = QAPISchemaGenCommandVisitor(prefix)
>>      schema.visit(vis)
>>      genc.body(vis.defn)
>>      genh.body(vis.decl)
>> -
>> -    if do_c:
>> -        genc.write(output_dir, prefix + 'qmp-marshal.c')
>> -    if do_h:
>> -        genh.write(output_dir, prefix + 'qmp-commands.h')
>> -
>> -
>> -if __name__ == '__main__':
>> -    main(sys.argv)
>> +    genc.write(output_dir, prefix + 'qmp-marshal.c')
>> +    genh.write(output_dir, prefix + 'qmp-commands.h')
>> diff --git a/scripts/qapi.py b/scripts/qapi/common.py
>> similarity index 100%
>> rename from scripts/qapi.py
>> rename to scripts/qapi/common.py
>> diff --git a/scripts/qapi2texi.py b/scripts/qapi/doc.py
>> old mode 100755
>> new mode 100644
>> similarity index 92%
>> rename from scripts/qapi2texi.py
>> rename to scripts/qapi/doc.py
>> index 924b374cd3..1f57f6e1c2
>> --- a/scripts/qapi2texi.py
>> +++ b/scripts/qapi/doc.py
>> @@ -4,10 +4,9 @@
>>  # This work is licensed under the terms of the GNU LGPL, version 2+.
>>  # See the COPYING file in the top-level directory.
>>  """This script produces the documentation of a qapi schema in texinfo format"""
>> +
>>  import re
>> -import sys
>> -
>> -import qapi
>> +import qapi.common
>>
>>  MSG_FMT = """
>>  @deftypefn {type} {{}} {name}
>> @@ -196,7 +195,7 @@ def texi_entity(doc, what, base=None, variants=None,
>>              + texi_sections(doc))
>>
>>
>> -class QAPISchemaGenDocVisitor(qapi.QAPISchemaVisitor):
>> +class QAPISchemaGenDocVisitor(qapi.common.QAPISchemaVisitor):
>
> Would be a bit easier to read and more consitent with a top-level
> "from qapi.common import QAPISchemaVisitor"

Can do.

>>      def __init__(self):
>>          self.out = None
>>          self.cur_doc = None
>> @@ -271,20 +270,8 @@ def texi_schema(schema):
>>      return gen.out
>>
>>
>> -def main(argv):
>> -    """Takes schema argument, prints result to stdout"""
>> -    if len(argv) != 2:
>> -        print >>sys.stderr, "%s: need exactly 1 argument: SCHEMA" % argv[0]
>> -        sys.exit(1)
>> -
>> -    schema = qapi.QAPISchema(argv[1])
>> -    if not qapi.doc_required:
>> -        print >>sys.stderr, ("%s: need pragma 'doc-required' "
>> -                             "to generate documentation" % argv[0])
>> -        sys.exit(1)
>> -    print '@c AUTOMATICALLY GENERATED, DO NOT MODIFY\n'
>> -    print texi_schema(schema),
>> -
>> -
>> -if __name__ == '__main__':
>> -    main(sys.argv)
>> +def gen_doc(schema, output_dir, prefix):
>> +    if qapi.common.doc_required:
>> +        gen = qapi.common.QAPIGenDoc()
>> +        gen.body(texi_schema(schema))
>> +        gen.write(output_dir, prefix + 'qapi.texi')
>> diff --git a/scripts/qapi-event.py b/scripts/qapi/events.py
>> similarity index 92%
>> rename from scripts/qapi-event.py
>> rename to scripts/qapi/events.py
>> index 5b33c694d4..1f267686db 100644
>> --- a/scripts/qapi-event.py
>> +++ b/scripts/qapi/events.py
>> @@ -12,7 +12,7 @@ This work is licensed under the terms of the GNU GPL, version 2.
>>  See the COPYING file in the top-level directory.
>>  """
>>
>> -from qapi import *
>> +from qapi.common import *
>>
>>
>>  def build_event_send_proto(name, arg_type, boxed):
>> @@ -171,13 +171,8 @@ class QAPISchemaGenEventVisitor(QAPISchemaVisitor):
>>          self._event_names.append(name)
>>
>>
>> -def main(argv):
>> -    (input_file, output_dir, do_c, do_h, prefix, dummy) = parse_command_line()
>> -
>> -    blurb = '''
>> - * Schema-defined QAPI/QMP events
>> -'''
>> -
>> +def gen_events(schema, output_dir, prefix):
>> +    blurb = ' * Schema-defined QAPI/QMP events'
>>      genc = QAPIGenC(blurb, __doc__)
>>      genh = QAPIGenH(blurb, __doc__)
>>
>> @@ -201,17 +196,9 @@ def main(argv):
>>  ''',
>>                      prefix=prefix))
>>
>> -    schema = QAPISchema(input_file)
>>      vis = QAPISchemaGenEventVisitor(prefix)
>>      schema.visit(vis)
>>      genc.body(vis.defn)
>>      genh.body(vis.decl)
>> -
>> -    if do_c:
>> -        genc.write(output_dir, prefix + 'qapi-event.c')
>> -    if do_h:
>> -        genh.write(output_dir, prefix + 'qapi-event.h')
>> -
>> -
>> -if __name__ == '__main__':
>> -    main(sys.argv)
>> +    genc.write(output_dir, prefix + 'qapi-event.c')
>> +    genh.write(output_dir, prefix + 'qapi-event.h')
>> diff --git a/scripts/qapi-introspect.py b/scripts/qapi/introspect.py
>> similarity index 90%
>> rename from scripts/qapi-introspect.py
>> rename to scripts/qapi/introspect.py
>> index 09e7d1f140..2153060f2c 100644
>> --- a/scripts/qapi-introspect.py
>> +++ b/scripts/qapi/introspect.py
>> @@ -10,7 +10,7 @@ This work is licensed under the terms of the GNU GPL, version 2.
>>  See the COPYING file in the top-level directory.
>>  """
>>
>> -from qapi import *
>> +from qapi.common import *
>>
>>
>>  # Caveman's json.dumps() replacement (we're stuck at Python 2.4)
>> @@ -168,22 +168,8 @@ const char %(c_name)s[] = %(c_string)s;
>>          self._gen_json(name, 'event', {'arg-type': self._use_type(arg_type)})
>>
>>
>> -def main(argv):
>> -    # Debugging aid: unmask QAPI schema's type names
>> -    # We normally mask them, because they're not QMP wire ABI
>> -    opt_unmask = False
>> -
>> -    (input_file, output_dir, do_c, do_h, prefix, opts) = \
>> -        parse_command_line('u', ['unmask-non-abi-names'])
>> -
>> -    for o, a in opts:
>> -        if o in ('-u', '--unmask-non-abi-names'):
>> -            opt_unmask = True
>> -
>> -    blurb = '''
>> - * QAPI/QMP schema introspection
>> -'''
>> -
>> +def gen_introspect(schema, output_dir, prefix, opt_unmask):
>> +    blurb = ' * QAPI/QMP schema introspection'
>>      genc = QAPIGenC(blurb, __doc__)
>>      genh = QAPIGenH(blurb, __doc__)
>>
>> @@ -194,17 +180,9 @@ def main(argv):
>>  ''',
>>                      prefix=prefix))
>>
>> -    schema = QAPISchema(input_file)
>>      vis = QAPISchemaGenIntrospectVisitor(prefix, opt_unmask)
>>      schema.visit(vis)
>>      genc.body(vis.defn)
>>      genh.body(vis.decl)
>> -
>> -    if do_c:
>> -        genc.write(output_dir, prefix + 'qmp-introspect.c')
>> -    if do_h:
>> -        genh.write(output_dir, prefix + 'qmp-introspect.h')
>> -
>> -
>> -if __name__ == '__main__':
>> -    main(sys.argv)
>> +    genc.write(output_dir, prefix + 'qmp-introspect.c')
>> +    genh.write(output_dir, prefix + 'qmp-introspect.h')
>> diff --git a/scripts/qapi-types.py b/scripts/qapi/types.py
>> similarity index 90%
>> rename from scripts/qapi-types.py
>> rename to scripts/qapi/types.py
>> index f2ddde94b1..b2095120e0 100644
>> --- a/scripts/qapi-types.py
>> +++ b/scripts/qapi/types.py
>> @@ -13,7 +13,7 @@ This work is licensed under the terms of the GNU GPL, version 2.
>>  # See the COPYING file in the top-level directory.
>>  """
>>
>> -from qapi import *
>> +from qapi.common import *
>>
>>
>>  # variants must be emitted before their container; track what has already
>> @@ -241,24 +241,8 @@ class QAPISchemaGenTypeVisitor(QAPISchemaVisitor):
>>          self._gen_type_cleanup(name)
>>
>>
>> -def main(argv):
>> -    # If you link code generated from multiple schemata, you want only one
>> -    # instance of the code for built-in types.  Generate it only when
>> -    # opt_builtins, enabled by command line option -b.  See also
>> -    # QAPISchemaGenTypeVisitor.visit_end().
>> -    opt_builtins = False
>> -
>> -    (input_file, output_dir, do_c, do_h, prefix, opts) = \
>> -        parse_command_line('b', ['builtins'])
>> -
>> -    for o, a in opts:
>> -        if o in ('-b', '--builtins'):
>> -            opt_builtins = True
>> -
>> -    blurb = '''
>> - * Schema-defined QAPI types
>> -'''
>> -
>> +def gen_types(schema, output_dir, prefix, opt_builtins):
>> +    blurb = ' * Schema-defined QAPI types'
>>      genc = QAPIGenC(blurb, __doc__)
>>      genh = QAPIGenH(blurb, __doc__)
>>
>> @@ -274,17 +258,9 @@ def main(argv):
>>  #include "qapi/util.h"
>>  '''))
>>
>> -    schema = QAPISchema(input_file)
>>      vis = QAPISchemaGenTypeVisitor(opt_builtins)
>>      schema.visit(vis)
>>      genc.body(vis.defn)
>>      genh.body(vis.decl)
>> -
>> -    if do_c:
>> -        genc.write(output_dir, prefix + 'qapi-types.c')
>> -    if do_h:
>> -        genh.write(output_dir, prefix + 'qapi-types.h')
>> -
>> -
>> -if __name__ == '__main__':
>> -    main(sys.argv)
>> +    genc.write(output_dir, prefix + 'qapi-types.c')
>> +    genh.write(output_dir, prefix + 'qapi-types.h')
>> diff --git a/scripts/qapi-visit.py b/scripts/qapi/visit.py
>> similarity index 92%
>> rename from scripts/qapi-visit.py
>> rename to scripts/qapi/visit.py
>> index 473fa72574..80c0b85f8c 100644
>> --- a/scripts/qapi-visit.py
>> +++ b/scripts/qapi/visit.py
>> @@ -13,7 +13,7 @@ This work is licensed under the terms of the GNU GPL, version 2.
>>  See the COPYING file in the top-level directory.
>>  """
>>
>> -from qapi import *
>> +from qapi.common import *
>>
>>
>>  def gen_visit_decl(name, scalar=False):
>> @@ -324,24 +324,8 @@ class QAPISchemaGenVisitVisitor(QAPISchemaVisitor):
>>          self.defn += gen_visit_alternate(name, variants)
>>
>>
>> -def main(argv):
>> -    # If you link code generated from multiple schemata, you want only one
>> -    # instance of the code for built-in types.  Generate it only when
>> -    # opt_builtins, enabled by command line option -b.  See also
>> -    # QAPISchemaGenVisitVisitor.visit_end().
>> -    opt_builtins = False
>> -
>> -    (input_file, output_dir, do_c, do_h, prefix, opts) = \
>> -        parse_command_line('b', ['builtins'])
>> -
>> -    for o, a in opts:
>> -        if o in ('-b', '--builtins'):
>> -            opt_builtins = True
>> -
>> -    blurb = '''
>> - * Schema-defined QAPI visitors
>> -'''
>> -
>> +def gen_visit(schema, output_dir, prefix, opt_builtins):
>> +    blurb = ' * Schema-defined QAPI visitors'
>>      genc = QAPIGenC(blurb, __doc__)
>>      genh = QAPIGenH(blurb, __doc__)
>>
>> @@ -361,17 +345,9 @@ def main(argv):
>>  ''',
>>                      prefix=prefix))
>>
>> -    schema = QAPISchema(input_file)
>>      vis = QAPISchemaGenVisitVisitor(opt_builtins)
>>      schema.visit(vis)
>>      genc.body(vis.defn)
>>      genh.body(vis.decl)
>> -
>> -    if do_c:
>> -        genc.write(output_dir, prefix + 'qapi-visit.c')
>> -    if do_h:
>> -        genh.write(output_dir, prefix + 'qapi-visit.h')
>> -
>> -
>> -if __name__ == '__main__':
>> -    main(sys.argv)
>> +    genc.write(output_dir, prefix + 'qapi-visit.c')
>> +    genh.write(output_dir, prefix + 'qapi-visit.h')
>> diff --git a/tests/Makefile.include b/tests/Makefile.include
>> index 851aafe9d1..768655a810 100644
>> --- a/tests/Makefile.include
>> +++ b/tests/Makefile.include
>> @@ -23,7 +23,16 @@ check-help:
>>  ifneq ($(wildcard config-host.mak),)
>>  export SRC_PATH
>>
>> -qapi-py = $(SRC_PATH)/scripts/qapi.py $(SRC_PATH)/scripts/ordereddict.py
>> +# TODO don't duplicate $(SRC_PATH)/Makefile's qapi-py here
>
> hmm, it doesn't look necessary, since the makefile is included from
> there. Right?

That's what I thought, so I deleted it, breaking my build.  I still
don't quite understand what's happening here.

>> +qapi-py = $(SRC_PATH)/scripts/qapi/commands.py \
>> +$(SRC_PATH)/scripts/qapi/events.py \
>> +$(SRC_PATH)/scripts/qapi/introspect.py \
>> +$(SRC_PATH)/scripts/qapi/types.py \
>> +$(SRC_PATH)/scripts/qapi/visit.py \
>> +$(SRC_PATH)/scripts/qapi/common.py \
>> +$(SRC_PATH)/scripts/qapi/doc.py \
>> +$(SRC_PATH)/scripts/ordereddict.py \
>> +$(SRC_PATH)/scripts/qapi-gen.py
>>
>>  # Get the list of all supported sysemu targets
>>  SYSEMU_TARGET_LIST := $(subst -softmmu.mak,,$(notdir \
>> @@ -642,34 +651,24 @@ tests/test-logging$(EXESUF): tests/test-logging.o $(test-util-obj-y)
>>  tests/test-replication$(EXESUF): tests/test-replication.o $(test-util-obj-y) \
>>         $(test-block-obj-y)
>>
>> -tests/test-qapi-types.c tests/test-qapi-types.h :\
>> -$(SRC_PATH)/tests/qapi-schema/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-types.py $(qapi-py)
>> -       $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py \
>> -               $(gen-out-type) -o tests -p "test-" $<, \
>> -               "GEN","$@")
>> -tests/test-qapi-visit.c tests/test-qapi-visit.h :\
>> -$(SRC_PATH)/tests/qapi-schema/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py)
>> -       $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py \
>> -               $(gen-out-type) -o tests -p "test-" $<, \
>> -               "GEN","$@")
>> -tests/test-qmp-commands.h tests/test-qmp-marshal.c :\
>> -$(SRC_PATH)/tests/qapi-schema/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py)
>> -       $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py \
>> -               $(gen-out-type) -o tests -p "test-" $<, \
>> -               "GEN","$@")
>> -tests/test-qapi-event.c tests/test-qapi-event.h :\
>> -$(SRC_PATH)/tests/qapi-schema/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-event.py $(qapi-py)
>> -       $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-event.py \
>> -               $(gen-out-type) -o tests -p "test-" $<, \
>> -               "GEN","$@")
>> -tests/test-qmp-introspect.c tests/test-qmp-introspect.h :\
>> -$(SRC_PATH)/tests/qapi-schema/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-introspect.py $(qapi-py)
>> -       $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-introspect.py \
>> -               $(gen-out-type) -o tests -p "test-" $<, \
>> -               "GEN","$@")
>> +tests/test-qapi-types.c tests/test-qapi-types.h \
>> +tests/test-qapi-visit.c tests/test-qapi-visit.h \
>> +tests/test-qmp-commands.h tests/test-qmp-marshal.c \
>> +tests/test-qapi-event.c tests/test-qapi-event.h \
>> +tests/test-qmp-introspect.c tests/test-qmp-introspect.h: \
>> +tests/test-qapi-gen-timestamp ;
>> +tests/test-qapi-gen-timestamp: $(SRC_PATH)/tests/qapi-schema/qapi-schema-test.json $(qapi-py)
>> +       $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-gen.py \
>> +               -o tests -p "test-" $<, \
>> +               "GEN","$(@:%-timestamp=%)")
>> +       @>$@
>>
>> -tests/qapi-schema/doc-good.test.texi: $(SRC_PATH)/tests/qapi-schema/doc-good.json $(SRC_PATH)/scripts/qapi2texi.py $(qapi-py)
>> -       $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi2texi.py $< > $@,"GEN","$@")
>> +tests/qapi-schema/doc-good.test.texi: $(SRC_PATH)/tests/qapi-schema/doc-good.json $(qapi-py)
>> +       $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-gen.py \
>> +               -o tests/qapi-schema -p "doc-good-" $<, \
>> +               "GEN","$@")
>> +       @mv tests/qapi-schema/doc-good-qapi.texi $@
>> +       @rm -f tests/qapi-schema/doc-good-qapi-*.[ch] tests/qapi-schema/doc-good-qmp-*.[ch]
>>
>>  tests/test-string-output-visitor$(EXESUF): tests/test-string-output-visitor.o $(test-qapi-obj-y)
>>  tests/test-string-input-visitor$(EXESUF): tests/test-string-input-visitor.o $(test-qapi-obj-y)
>> @@ -937,6 +936,7 @@ check-clean:
>>         $(MAKE) -C tests/tcg clean
>>         rm -rf $(check-unit-y) tests/*.o $(QEMU_IOTESTS_HELPERS-y)
>>         rm -rf $(sort $(foreach target,$(SYSEMU_TARGET_LIST), $(check-qtest-$(target)-y)) $(check-qtest-generic-y))
>> +       rm -f tests/test-qapi-gen-timestamp
>>
>>  clean: check-clean
>>
>> diff --git a/tests/qapi-schema/test-qapi.py b/tests/qapi-schema/test-qapi.py
>> index fe0ca08d78..7772d09919 100644
>> --- a/tests/qapi-schema/test-qapi.py
>> +++ b/tests/qapi-schema/test-qapi.py
>> @@ -10,7 +10,7 @@
>>  # See the COPYING file in the top-level directory.
>>  #
>>
>> -from qapi import *
>> +from qapi.common import *
>>  from pprint import pprint
>>  import os
>>  import sys
>> --
>> 2.13.6
>>
>
> good to me otherwise,
> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

Thanks!

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 02/21] qapi: Generate up-to-date copyright notice
  2018-02-05 13:44   ` Marc-Andre Lureau
  2018-02-05 15:28     ` Markus Armbruster
@ 2018-02-05 15:45     ` Eric Blake
  1 sibling, 0 replies; 87+ messages in thread
From: Eric Blake @ 2018-02-05 15:45 UTC (permalink / raw)
  To: Marc-Andre Lureau, Markus Armbruster; +Cc: qemu-devel, marcandre, mdroth

[-- Attachment #1: Type: text/plain, Size: 934 bytes --]

On 02/05/2018 07:44 AM, Marc-Andre Lureau wrote:
> Hi
> 
> On Fri, Feb 2, 2018 at 2:03 PM, Markus Armbruster <armbru@redhat.com> wrote:
>> Each generator carries a copyright notice for the generator itself,
>> and another one for the files it generates.  Only the former have been
>> updated along the way, the latter have not, and are all out of date.
>>
>> Fix by copying the generator's copyright notice to the generated files
>> instead.
> 
> That makes sense, but we loose the Author lines in the generated
> files. Not a big deal I guess, but worth to point out, no?

I don't see too much use for author lines as long as you have a 'this
file is generated' line; you can use git history to learn the authors of
the generator code.  But yeah, a commit message blurb can't hurt.


-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 03/21] qapi: New classes QAPIGenC, QAPIGenH, QAPIGenDoc
  2018-02-03  8:49     ` Markus Armbruster
@ 2018-02-05 15:46       ` Eric Blake
  2018-02-06  7:28         ` Markus Armbruster
  0 siblings, 1 reply; 87+ messages in thread
From: Eric Blake @ 2018-02-05 15:46 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: qemu-devel, marcandre.lureau, mdroth

[-- Attachment #1: Type: text/plain, Size: 1633 bytes --]

On 02/03/2018 02:49 AM, Markus Armbruster wrote:
> Eric Blake <eblake@redhat.com> writes:
> 
>> On 02/02/2018 07:03 AM, Markus Armbruster wrote:
>>> These classes encapsulate accumulating and writing output.
>>>
>>> Convert C code generation to QAPIGenC and QAPIGenH.  The conversion is
>>> rather shallow: most of the output accumulation is not converted.
>>> Left for later.
>>>
>>> The indentation machinery uses a single global variable indent_level,
>>> even though we generally interleave creation of a .c and its .h.  It
>>> should become instance variable of QAPIGenC.  Also left for later.
>>>
>>> Documentation generation isn't converted, and QAPIGenDoc isn't used.
>>> This will change shortly.
>>>

>>>  schema = QAPISchema(input_file)
>>> -gen = QAPISchemaGenEventVisitor()
>>> -schema.visit(gen)
>>> -fdef.write(gen.defn)
>>> -fdecl.write(gen.decl)
>>> +vis = QAPISchemaGenEventVisitor()
>>> +schema.visit(vis)
>>> +genc.body(vis.defn)
>>> +genh.body(vis.decl)
>>
>> I don't know if it is worth a sentence in the commit message that the
>> visitor variable is renamed from 'gen' to 'vis' for less confusion with
>> the new class instances 'genc' and 'genh'.
> 
> Did the rename give you pause when reviewing?

Enough to question whether it was intentional, since it wasn't mentioned
in the commit message (I obviously figured out that it was intentional
and useful, but the fact that I even pointed it out meant that I did
pause during the review).

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 06/21] qapi-gen: New common driver for code and doc generators
  2018-02-03  9:03     ` Markus Armbruster
@ 2018-02-05 15:52       ` Eric Blake
  2018-02-06  7:45         ` Markus Armbruster
  0 siblings, 1 reply; 87+ messages in thread
From: Eric Blake @ 2018-02-05 15:52 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: qemu-devel, marcandre.lureau, mdroth

[-- Attachment #1: Type: text/plain, Size: 4685 bytes --]

On 02/03/2018 03:03 AM, Markus Armbruster wrote:
> Eric Blake <eblake@redhat.com> writes:
> 
>> On 02/02/2018 07:03 AM, Markus Armbruster wrote:
>>> Whenever qapi-schema.json changes, we run six programs eleven times to
>>> update eleven files.  This is silly.  Replace the six programs by a
>>> single program that spits out all eleven files.
>>
>> Yay, about time!
>>
>> One program, but still invoked multiple times:
>>

>>>  rename scripts/{qapi2texi.py => qapi/doc.py} (92%)
>>>  mode change 100755 => 100644
>>
>> Unintinentional?  We're inconsistent on which of our *.py files are
>> executable in git.  Does it matter whether a file that is designed for
>> use as a module is marked executable (if so, perhaps 5/21 should be
>> adding the x attribute on other files, rather than this patch removing
>> it on the doc generator).
> 
> qapi2texi.py is no longer runnable as a standalone program after this
> patch.
> 
> So are qapi-{commands,events,introspect,types,visit}.py, but they never
> had the executable bit set.

Okay, so dropping the bit consistently makes sense; still, a mention in
the commit message wouldn't hurt.

> 
>>> +++ b/Makefile
>>
>>> +qga/qapi-generated/qga-qapi-types.c qga/qapi-generated/qga-qapi-types.h \
>>> +qga/qapi-generated/qga-qapi-visit.c qga/qapi-generated/qga-qapi-visit.h \
>>> +qga/qapi-generated/qga-qmp-commands.h qga/qapi-generated/qga-qmp-marshal.c \
>>> +qga/qapi-generated/qga-qapi.texi: \
>>> +qga/qapi-generated/qapi-gen-timestamp ;
>>> +qga/qapi-generated/qapi-gen-timestamp: $(SRC_PATH)/qga/qapi-schema.json $(qapi-py)
>>> +	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-gen.py \
>>> +		-o qga/qapi-generated -p "qga-" $<, \
>>> +		"GEN","$(@:%-timestamp=%)")
>>> +	@>$@
>>
>> once for qga,
> 
> That's the QAPI/QGA schema.  The commit message talks about the QAPI/QMP
> schema.  I wish the two weren't named the same.

7 files here,...

> 
> Modularization might make fusing them possible.  Whether that's a good
> idea I don't know.
> 
>>> +qapi-types.c qapi-types.h \
>>> +qapi-visit.c qapi-visit.h \
>>> +qmp-commands.h qmp-marshal.c \
>>> +qapi-event.c qapi-event.h \
>>> +qmp-introspect.h qmp-introspect.c \
>>> +qapi.texi: \
>>> +qapi-gen-timestamp ;
>>> +qapi-gen-timestamp: $(qapi-modules) $(qapi-py)
>>> +	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-gen.py \
>>> +		-o "." -b $<, \
>>> +		"GEN","$(@:%-timestamp=%)")
>>> +	@>$@
>>
>> and again for the main level.  Still, a definite improvement!

11 files here,...

> 
> Perhaps I can find a way to clarify the commit message.
> 

[1]


>>> -def main(argv):
>>> -    (input_file, output_dir, do_c, do_h, prefix, opts) = parse_command_line()
>>> -
>>> -    blurb = '''
>>> - * Schema-defined QAPI/QMP commands
>>> -'''
>>> -
>>> +def gen_commands(schema, output_dir, prefix):
>>> +    blurb = ' * Schema-defined QAPI/QMP commands'
>>
>> Some churn on the definition of blurb; worth tidying this in the
>> introduction earlier in the series?
> 
> Doesn't seem worth a separate patch, but I can try to reshuffle things
> to reduce churn.

Yeah, my question was more about the conversion between multiline
'''...''' to single-line '...'; why not just use the single-line
construct earlier in the series when introducing the blurb variable.
You are right that creating blurb didn't need a separate patch, just
less churn over the series.

>>>  
>>> -qapi-py = $(SRC_PATH)/scripts/qapi.py $(SRC_PATH)/scripts/ordereddict.py
>>> +# TODO don't duplicate $(SRC_PATH)/Makefile's qapi-py here
>>> +qapi-py = $(SRC_PATH)/scripts/qapi/commands.py \
>>> +$(SRC_PATH)/scripts/qapi/events.py \
>>> +$(SRC_PATH)/scripts/qapi/introspect.py \
>>> +$(SRC_PATH)/scripts/qapi/types.py \
>>> +$(SRC_PATH)/scripts/qapi/visit.py \
>>> +$(SRC_PATH)/scripts/qapi/common.py \
>>> +$(SRC_PATH)/scripts/qapi/doc.py \
>>> +$(SRC_PATH)/scripts/ordereddict.py \
>>> +$(SRC_PATH)/scripts/qapi-gen.py
>>
>> So, were you counting these in the 11 generated files mentioned in the
>> commit message? :)
> 
> I'm not sure I understand what you mean here...

[1] and 9 more files.  So, the commit message only mentioned the 11 QMP
files, rather than all 27 (if I counted right) QAPI generated files.  My
comments were trying to point out that you simplified more than just the
QMP code generation into fewer script invocations, and the counts looked
off since out of the three spots converted, only one of the spots had 11
files.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 09/21] qapi: Don't absolutize include file name in error messages
  2018-02-03  9:08     ` Markus Armbruster
@ 2018-02-05 15:55       ` Eric Blake
  2018-02-06  7:49         ` Markus Armbruster
  0 siblings, 1 reply; 87+ messages in thread
From: Eric Blake @ 2018-02-05 15:55 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: qemu-devel, marcandre.lureau, mdroth

[-- Attachment #1: Type: text/plain, Size: 2321 bytes --]

On 02/03/2018 03:08 AM, Markus Armbruster wrote:
> Eric Blake <eblake@redhat.com> writes:
> 
>> On 02/02/2018 07:03 AM, Markus Armbruster wrote:
>>> Error messages print absolute filenames of included files even gave a
>>
>> s/even gave/even when given/
> 
> I meant to write "even if the user gave".  Is that okay?

Yes, that works too.

> 
>>> relative one on the command line:
>>>
>>>      PYTHONPATH=scripts python -B tests/qapi-schema/test-qapi.py tests/qapi-schema/include-cycle.json
>>>     In file included from tests/qapi-schema/include-cycle.json:1:
>>>     In file included from /work/armbru/qemu/tests/qapi-schema/include-cycle-b.json:1:
>>>     /work/armbru/qemu/tests/qapi-schema/include-cycle-c.json:1: Inclusion loop for include-cycle.json
>>>
>>> Improve this to
>>>
>>>     In file included from tests/qapi-schema/include-cycle.json:1:
>>>     In file included from tests/qapi-schema/include-cycle-b.json:1:
>>>     tests/qapi-schema/include-cycle-c.json:1: Inclusion loop for include-cycle.json
>>
>> Nice, and makes developing new qapi tests a little less painful since
>> it's less modification to qapi-schema/*.err additions.
> 
> Probably not, as our make rule strips off $(SRC_PATH):
> 
> 	@perl -p -e 's|\Q$(SRC_PATH)\E/||g' $*.test.err | diff -q $(SRC_PATH)/$*.err -
> 
> I've kept that, because it might also occur in stack backtraces.  I
> think.

I still recall having to hand-edit .err files when doing a naive "run
the test to get the failure, then 'mv' the bad files into the expected
filenames, then rerun the tests"; so I'm not sure if our make rule was
properly munging absolute names out of the file in the first place.  I'm
not too fussed about it, though, as adding new tests is less frequent
and it's still fairly easy to learn if you did it right or not by
whether 'make check' succeeds.

> 
>>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>>> ---
>>>  scripts/qapi/common.py                | 12 ++++++------
>>>  tests/qapi-schema/include-no-file.err |  2 +-
>>>  2 files changed, 7 insertions(+), 7 deletions(-)
>>>
>>
>> Reviewed-by: Eric Blake <eblake@redhat.com>
> 
> Thanks!
> 

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 03/21] qapi: New classes QAPIGenC, QAPIGenH, QAPIGenDoc
  2018-02-05 15:46       ` Eric Blake
@ 2018-02-06  7:28         ` Markus Armbruster
  0 siblings, 0 replies; 87+ messages in thread
From: Markus Armbruster @ 2018-02-06  7:28 UTC (permalink / raw)
  To: Eric Blake; +Cc: marcandre.lureau, qemu-devel, mdroth

Eric Blake <eblake@redhat.com> writes:

> On 02/03/2018 02:49 AM, Markus Armbruster wrote:
>> Eric Blake <eblake@redhat.com> writes:
>> 
>>> On 02/02/2018 07:03 AM, Markus Armbruster wrote:
>>>> These classes encapsulate accumulating and writing output.
>>>>
>>>> Convert C code generation to QAPIGenC and QAPIGenH.  The conversion is
>>>> rather shallow: most of the output accumulation is not converted.
>>>> Left for later.
>>>>
>>>> The indentation machinery uses a single global variable indent_level,
>>>> even though we generally interleave creation of a .c and its .h.  It
>>>> should become instance variable of QAPIGenC.  Also left for later.
>>>>
>>>> Documentation generation isn't converted, and QAPIGenDoc isn't used.
>>>> This will change shortly.
>>>>
>
>>>>  schema = QAPISchema(input_file)
>>>> -gen = QAPISchemaGenEventVisitor()
>>>> -schema.visit(gen)
>>>> -fdef.write(gen.defn)
>>>> -fdecl.write(gen.decl)
>>>> +vis = QAPISchemaGenEventVisitor()
>>>> +schema.visit(vis)
>>>> +genc.body(vis.defn)
>>>> +genh.body(vis.decl)
>>>
>>> I don't know if it is worth a sentence in the commit message that the
>>> visitor variable is renamed from 'gen' to 'vis' for less confusion with
>>> the new class instances 'genc' and 'genh'.
>> 
>> Did the rename give you pause when reviewing?
>
> Enough to question whether it was intentional, since it wasn't mentioned
> in the commit message (I obviously figured out that it was intentional
> and useful, but the fact that I even pointed it out meant that I did
> pause during the review).

Okay, I'll try to make it clearer.

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 06/21] qapi-gen: New common driver for code and doc generators
  2018-02-05 15:52       ` Eric Blake
@ 2018-02-06  7:45         ` Markus Armbruster
  2018-02-06 14:56           ` Eric Blake
  0 siblings, 1 reply; 87+ messages in thread
From: Markus Armbruster @ 2018-02-06  7:45 UTC (permalink / raw)
  To: Eric Blake; +Cc: marcandre.lureau, qemu-devel, mdroth

Eric Blake <eblake@redhat.com> writes:

> On 02/03/2018 03:03 AM, Markus Armbruster wrote:
>> Eric Blake <eblake@redhat.com> writes:
>> 
>>> On 02/02/2018 07:03 AM, Markus Armbruster wrote:
>>>> Whenever qapi-schema.json changes, we run six programs eleven times to
>>>> update eleven files.  This is silly.  Replace the six programs by a
>>>> single program that spits out all eleven files.
>>>
>>> Yay, about time!
>>>
>>> One program, but still invoked multiple times:
>>>
>
>>>>  rename scripts/{qapi2texi.py => qapi/doc.py} (92%)
>>>>  mode change 100755 => 100644
>>>
>>> Unintinentional?  We're inconsistent on which of our *.py files are
>>> executable in git.  Does it matter whether a file that is designed for
>>> use as a module is marked executable (if so, perhaps 5/21 should be
>>> adding the x attribute on other files, rather than this patch removing
>>> it on the doc generator).
>> 
>> qapi2texi.py is no longer runnable as a standalone program after this
>> patch.
>> 
>> So are qapi-{commands,events,introspect,types,visit}.py, but they never
>> had the executable bit set.
>
> Okay, so dropping the bit consistently makes sense; still, a mention in
> the commit message wouldn't hurt.

Can do.

>>>> +++ b/Makefile
>>>
>>>> +qga/qapi-generated/qga-qapi-types.c qga/qapi-generated/qga-qapi-types.h \
>>>> +qga/qapi-generated/qga-qapi-visit.c qga/qapi-generated/qga-qapi-visit.h \
>>>> +qga/qapi-generated/qga-qmp-commands.h qga/qapi-generated/qga-qmp-marshal.c \
>>>> +qga/qapi-generated/qga-qapi.texi: \
>>>> +qga/qapi-generated/qapi-gen-timestamp ;
>>>> +qga/qapi-generated/qapi-gen-timestamp: $(SRC_PATH)/qga/qapi-schema.json $(qapi-py)
>>>> +	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-gen.py \
>>>> +		-o qga/qapi-generated -p "qga-" $<, \
>>>> +		"GEN","$(@:%-timestamp=%)")
>>>> +	@>$@
>>>
>>> once for qga,
>> 
>> That's the QAPI/QGA schema.  The commit message talks about the QAPI/QMP
>> schema.  I wish the two weren't named the same.
>
> 7 files here,...
>
>> 
>> Modularization might make fusing them possible.  Whether that's a good
>> idea I don't know.
>> 
>>>> +qapi-types.c qapi-types.h \
>>>> +qapi-visit.c qapi-visit.h \
>>>> +qmp-commands.h qmp-marshal.c \
>>>> +qapi-event.c qapi-event.h \
>>>> +qmp-introspect.h qmp-introspect.c \
>>>> +qapi.texi: \
>>>> +qapi-gen-timestamp ;
>>>> +qapi-gen-timestamp: $(qapi-modules) $(qapi-py)
>>>> +	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-gen.py \
>>>> +		-o "." -b $<, \
>>>> +		"GEN","$(@:%-timestamp=%)")
>>>> +	@>$@
>>>
>>> and again for the main level.  Still, a definite improvement!
>
> 11 files here,...
>
>> 
>> Perhaps I can find a way to clarify the commit message.
>> 
>
> [1]
>
>
>>>> -def main(argv):
>>>> -    (input_file, output_dir, do_c, do_h, prefix, opts) = parse_command_line()
>>>> -
>>>> -    blurb = '''
>>>> - * Schema-defined QAPI/QMP commands
>>>> -'''
>>>> -
>>>> +def gen_commands(schema, output_dir, prefix):
>>>> +    blurb = ' * Schema-defined QAPI/QMP commands'
>>>
>>> Some churn on the definition of blurb; worth tidying this in the
>>> introduction earlier in the series?
>> 
>> Doesn't seem worth a separate patch, but I can try to reshuffle things
>> to reduce churn.
>
> Yeah, my question was more about the conversion between multiline
> '''...''' to single-line '...'; why not just use the single-line
> construct earlier in the series when introducing the blurb variable.

Introduced in PATCH 01:

    -c_comment = '''
    -/*
    - * schema-defined QMP->QAPI command dispatch
    +blurb = '''
    + * Schema-defined QAPI/QMP commands
      *
      * Copyright IBM, Corp. 2011
      *
      * Authors:
      *  Anthony Liguori   <aliguori@us.ibm.com>
    - *
    - * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
    - * See the COPYING.LIB file in the top-level directory.
    - *
    - */
    -'''

Shortened in PATCH 02:

     blurb = '''
      * Schema-defined QAPI/QMP commands
    - *
    - * Copyright IBM, Corp. 2011
    - *
    - * Authors:
    - *  Anthony Liguori   <aliguori@us.ibm.com>
     '''

Reformatted in PATCH 06 (see above).

Moved in PATCH 16 to visitor's __init__ for types and visits (the rest
aren't implemented, yet):

     class QAPISchemaGenTypeVisitor(QAPISchemaVisitor):
    -    def __init__(self, opt_builtins):
    +    def __init__(self, opt_builtins, prefix):
             self._opt_builtins = opt_builtins
    -        self.decl = None
    -        self.defn = None
    -        self._fwdecl = None
    -        self._btin = None
    +        self._prefix = prefix
    +        blurb = ' * Schema-defined QAPI types'
    +        self._genc = QAPIGenC(blurb, __doc__)
    +        self._genh = QAPIGenH(blurb, __doc__)

Variable eliminated there in PATCH 17:

    -        blurb = ' * Schema-defined QAPI types'
    -        self._genc = QAPIGenC(blurb, __doc__)
    -        self._genh = QAPIGenH(blurb, __doc__)
    +        self._module = {}
    +        self._add_module(None, ' * Built-in QAPI types')

I could delay the reformatting until PATCH 16, or do it in PATCH 02.
Feels like a wash to me, but if you have a preference...

> You are right that creating blurb didn't need a separate patch, just
> less churn over the series.
>
>>>>  
>>>> -qapi-py = $(SRC_PATH)/scripts/qapi.py $(SRC_PATH)/scripts/ordereddict.py
>>>> +# TODO don't duplicate $(SRC_PATH)/Makefile's qapi-py here
>>>> +qapi-py = $(SRC_PATH)/scripts/qapi/commands.py \
>>>> +$(SRC_PATH)/scripts/qapi/events.py \
>>>> +$(SRC_PATH)/scripts/qapi/introspect.py \
>>>> +$(SRC_PATH)/scripts/qapi/types.py \
>>>> +$(SRC_PATH)/scripts/qapi/visit.py \
>>>> +$(SRC_PATH)/scripts/qapi/common.py \
>>>> +$(SRC_PATH)/scripts/qapi/doc.py \
>>>> +$(SRC_PATH)/scripts/ordereddict.py \
>>>> +$(SRC_PATH)/scripts/qapi-gen.py
>>>
>>> So, were you counting these in the 11 generated files mentioned in the
>>> commit message? :)
>> 
>> I'm not sure I understand what you mean here...
>
> [1] and 9 more files.  So, the commit message only mentioned the 11 QMP
> files, rather than all 27 (if I counted right) QAPI generated files.  My
> comments were trying to point out that you simplified more than just the
> QMP code generation into fewer script invocations, and the counts looked
> off since out of the three spots converted, only one of the spots had 11
> files.

The commit message talks only about the QAPI/QMP schema.  It's confusing
because our poor taste in file names creates ambiguity: does
qapi-schema.json refer to ./qapi-schema.json (i.e. the QAPI/QMP one),
qga/qapi-schema.json, or both?

Perhaps I should rename qapi-schema.json to qapi/schema.json.

The commit message needs a note along the lines of "same for
qga/qapi-schema.json".

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 09/21] qapi: Don't absolutize include file name in error messages
  2018-02-05 15:55       ` Eric Blake
@ 2018-02-06  7:49         ` Markus Armbruster
  2018-02-06 15:06           ` Eric Blake
  0 siblings, 1 reply; 87+ messages in thread
From: Markus Armbruster @ 2018-02-06  7:49 UTC (permalink / raw)
  To: Eric Blake; +Cc: marcandre.lureau, qemu-devel, mdroth

Eric Blake <eblake@redhat.com> writes:

> On 02/03/2018 03:08 AM, Markus Armbruster wrote:
>> Eric Blake <eblake@redhat.com> writes:
>> 
>>> On 02/02/2018 07:03 AM, Markus Armbruster wrote:
>>>> Error messages print absolute filenames of included files even gave a
>>>
>>> s/even gave/even when given/
>> 
>> I meant to write "even if the user gave".  Is that okay?
>
> Yes, that works too.
>
>> 
>>>> relative one on the command line:
>>>>
>>>>      PYTHONPATH=scripts python -B tests/qapi-schema/test-qapi.py tests/qapi-schema/include-cycle.json
>>>>     In file included from tests/qapi-schema/include-cycle.json:1:
>>>>     In file included from /work/armbru/qemu/tests/qapi-schema/include-cycle-b.json:1:
>>>>     /work/armbru/qemu/tests/qapi-schema/include-cycle-c.json:1: Inclusion loop for include-cycle.json
>>>>
>>>> Improve this to
>>>>
>>>>     In file included from tests/qapi-schema/include-cycle.json:1:
>>>>     In file included from tests/qapi-schema/include-cycle-b.json:1:
>>>>     tests/qapi-schema/include-cycle-c.json:1: Inclusion loop for include-cycle.json
>>>
>>> Nice, and makes developing new qapi tests a little less painful since
>>> it's less modification to qapi-schema/*.err additions.
>> 
>> Probably not, as our make rule strips off $(SRC_PATH):
>> 
>> 	@perl -p -e 's|\Q$(SRC_PATH)\E/||g' $*.test.err | diff -q $(SRC_PATH)/$*.err -
>> 
>> I've kept that, because it might also occur in stack backtraces.  I
>> think.
>
> I still recall having to hand-edit .err files when doing a naive "run
> the test to get the failure, then 'mv' the bad files into the expected
> filenames, then rerun the tests";

Whenever the Perl script does something, you can't simply move the
.test.err to .err.  Annoying.

A make target check-accept could automate the work.

However, with this patch, the Perl script should do something less
often.  I guess that's your point.

Sorry for being slow on the update :)

>                                   so I'm not sure if our make rule was
> properly munging absolute names out of the file in the first place.  I'm
> not too fussed about it, though, as adding new tests is less frequent
> and it's still fairly easy to learn if you did it right or not by
> whether 'make check' succeeds.
>
>>>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>>>> ---
>>>>  scripts/qapi/common.py                | 12 ++++++------
>>>>  tests/qapi-schema/include-no-file.err |  2 +-
>>>>  2 files changed, 7 insertions(+), 7 deletions(-)
>>>>
>>>
>>> Reviewed-by: Eric Blake <eblake@redhat.com>
>> 
>> Thanks!
>> 

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 14/21] qapi: Generate in source order
  2018-02-05 14:33     ` Markus Armbruster
  2018-02-05 14:40       ` Marc-Andre Lureau
@ 2018-02-06 10:33       ` Markus Armbruster
  1 sibling, 0 replies; 87+ messages in thread
From: Markus Armbruster @ 2018-02-06 10:33 UTC (permalink / raw)
  To: Marc-Andre Lureau; +Cc: marcandre, qemu-devel, mdroth

Markus Armbruster <armbru@redhat.com> writes:

> Marc-Andre Lureau <mlureau@redhat.com> writes:
>
>> On Fri, Feb 2, 2018 at 2:03 PM, Markus Armbruster <armbru@redhat.com> wrote:
>>> The generators' conversion to visitors (merge commit 9e72681d16)
>>> changed the processing order of entities from source order to
>>> alphabetical order.  The next commit needs source order, so change it
>>> back.
>>>
>>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>>> ---
>>>  scripts/qapi/common.py                   |   4 +-
>>>  tests/qapi-schema/comments.out           |   2 +-
>>>  tests/qapi-schema/doc-bad-section.out    |   4 +-
>>>  tests/qapi-schema/doc-good.out           |  32 ++--
>>>  tests/qapi-schema/empty.out              |   2 +-
>>>  tests/qapi-schema/event-case.out         |   2 +-
>>>  tests/qapi-schema/ident-with-escape.out  |   6 +-
>>>  tests/qapi-schema/include-relpath.out    |   2 +-
>>>  tests/qapi-schema/include-repetition.out |   2 +-
>>>  tests/qapi-schema/include-simple.out     |   2 +-
>>>  tests/qapi-schema/indented-expr.out      |   2 +-
>>>  tests/qapi-schema/qapi-schema-test.out   | 320 +++++++++++++++----------------
>>>  12 files changed, 191 insertions(+), 189 deletions(-)
>>>
>>> diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py
>>> index d5b93e7381..3b97bf8702 100644
>>> --- a/scripts/qapi/common.py
>>> +++ b/scripts/qapi/common.py
>>> @@ -1471,6 +1471,7 @@ class QAPISchema(object):
>>>          parser = QAPISchemaParser(open(fname, 'r'))
>>>          exprs = check_exprs(parser.exprs)
>>>          self.docs = parser.docs
>>> +        self._entity_list = []
>>>          self._entity_dict = {}
>>>          self._predefining = True
>>>          self._def_predefineds()
>>> @@ -1482,6 +1483,7 @@ class QAPISchema(object):
>>>          # Only the predefined types are allowed to not have info
>>>          assert ent.info or self._predefining
>>>          assert ent.name not in self._entity_dict
>>> +        self._entity_list.append(ent)
>>>          self._entity_dict[ent.name] = ent
>>
>> Why not use the OrderedDict instead?
>
> Fair question!  However, the next patch will create anonymous entities,
> which get added only to ._entity_list, not _entity_dict.
>
> [...]

Flaw in QAPISchema.check():

        for ent in self._entity_dict.values():
            ent.check(self)

Need to iterate over entity_list, or else we fail to check anonymous
entities.  Currently harmless, as QAPISchemaInclude.check() does
nothing.  I'll fix it.

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 06/21] qapi-gen: New common driver for code and doc generators
  2018-02-06  7:45         ` Markus Armbruster
@ 2018-02-06 14:56           ` Eric Blake
  0 siblings, 0 replies; 87+ messages in thread
From: Eric Blake @ 2018-02-06 14:56 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: marcandre.lureau, qemu-devel, mdroth

On 02/06/2018 01:45 AM, Markus Armbruster wrote:

>>>>> -def main(argv):
>>>>> -    (input_file, output_dir, do_c, do_h, prefix, opts) = parse_command_line()
>>>>> -
>>>>> -    blurb = '''
>>>>> - * Schema-defined QAPI/QMP commands
>>>>> -'''
>>>>> -
>>>>> +def gen_commands(schema, output_dir, prefix):
>>>>> +    blurb = ' * Schema-defined QAPI/QMP commands'
>>>>
>>>> Some churn on the definition of blurb; worth tidying this in the
>>>> introduction earlier in the series?
>>>
>>> Doesn't seem worth a separate patch, but I can try to reshuffle things
>>> to reduce churn.
>>
>> Yeah, my question was more about the conversion between multiline
>> '''...''' to single-line '...'; why not just use the single-line
>> construct earlier in the series when introducing the blurb variable.
> 
> Introduced in PATCH 01:
> 
>      -c_comment = '''
>      -/*
>      - * schema-defined QMP->QAPI command dispatch
>      +blurb = '''
>      + * Schema-defined QAPI/QMP commands
>        *
>        * Copyright IBM, Corp. 2011

Multiline made sense here.

> Shortened in PATCH 02:
> 
>       blurb = '''
>        * Schema-defined QAPI/QMP commands
>      - *
>      - * Copyright IBM, Corp. 2011
>      - *
>      - * Authors:
>      - *  Anthony Liguori   <aliguori@us.ibm.com>
        '''
> 

Where it is now a single line...


> Variable eliminated there in PATCH 17:
> 
>      -        blurb = ' * Schema-defined QAPI types'
>      -        self._genc = QAPIGenC(blurb, __doc__)
>      -        self._genh = QAPIGenH(blurb, __doc__)
>      +        self._module = {}
>      +        self._add_module(None, ' * Built-in QAPI types')

Oh, I didn't even notice that!

> 
> I could delay the reformatting until PATCH 16, or do it in PATCH 02.
> Feels like a wash to me, but if you have a preference...

I guess my preference is to reformat to single line in PATCH 02, then 
patch 6 doesn't have to touch it, and patch 16 can still get rid of it. 
But, as it disappears by the end of the series anyways, I'm also okay if 
you don't bother (churn is not necessarily bad, if it is still easy to 
review).


> The commit message talks only about the QAPI/QMP schema.  It's confusing
> because our poor taste in file names creates ambiguity: does
> qapi-schema.json refer to ./qapi-schema.json (i.e. the QAPI/QMP one),
> qga/qapi-schema.json, or both?
> 
> Perhaps I should rename qapi-schema.json to qapi/schema.json.

I'd be in favor of such a change.  We'd also rename qga/qapi-schema.json 
to qga/schema.json?

> 
> The commit message needs a note along the lines of "same for
> qga/qapi-schema.json".
> 

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 09/21] qapi: Don't absolutize include file name in error messages
  2018-02-06  7:49         ` Markus Armbruster
@ 2018-02-06 15:06           ` Eric Blake
  0 siblings, 0 replies; 87+ messages in thread
From: Eric Blake @ 2018-02-06 15:06 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: marcandre.lureau, qemu-devel, mdroth

On 02/06/2018 01:49 AM, Markus Armbruster wrote:

>>> Probably not, as our make rule strips off $(SRC_PATH):
>>>
>>> 	@perl -p -e 's|\Q$(SRC_PATH)\E/||g' $*.test.err | diff -q $(SRC_PATH)/$*.err -
>>>
>>> I've kept that, because it might also occur in stack backtraces.  I
>>> think.

Ideally, we don't have any stack backtraces ;)  But we have indeed 
historically checked in .err files with a backtrace that a later patch 
in the series cleans up, so that part of the munging does indeed play a 
role in a clean 'make check' for documenting an expected weakness in the 
generator.

>>
>> I still recall having to hand-edit .err files when doing a naive "run
>> the test to get the failure, then 'mv' the bad files into the expected
>> filenames, then rerun the tests";
> 
> Whenever the Perl script does something, you can't simply move the
> .test.err to .err.  Annoying.

We could also munge the original output prior to creating .test.err; but 
that also has drawbacks if it eats something that would have been useful 
for debugging the test.

> 
> A make target check-accept could automate the work.

Yeah, but I'm not sure how often we'd need to invoke it, or even 
remember that it exists.  But it would at least avoid the issue of 
having to debug a munged .test.err.

> 
> However, with this patch, the Perl script should do something less
> often.  I guess that's your point.
> 
> Sorry for being slow on the update :)

No problem; I figure you've got a lot on your mind as you are trying to 
tie down loose ends before some much deserved time off.


-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 17/21] qapi/types qapi/visit: Generate built-in stuff into separate files
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 17/21] qapi/types qapi/visit: Generate built-in stuff into separate files Markus Armbruster
  2018-02-05 13:46   ` Marc-Andre Lureau
@ 2018-02-06 20:54   ` Eric Blake
  1 sibling, 0 replies; 87+ messages in thread
From: Eric Blake @ 2018-02-06 20:54 UTC (permalink / raw)
  To: Markus Armbruster, qemu-devel; +Cc: marcandre.lureau, mdroth

On 02/02/2018 07:03 AM, Markus Armbruster wrote:
> Linking code from multiple separate QAPI schemata into the same
> program is possible, but involves some weirdness around built-in
> types:
> 
> * We generate code for built-in types into .c only with option
>    --builtins.  The user is responsible to generate code for exactly
>    one QAPI schema per program with --builtins.
> 
> * We generate code for them it into .h regardless of --builtins,

s/them it/them/

>    guarded by #ifndef QAPI_VISIT_BUILTIN.  Because the code for
>    built-in types is exactly the same in all of them, including any
>    combination of these headers works.
> 
> Replace this contraption by something more conventional: generate code
> for built-in types into their very own files: qapi-builtin-types.c,
> qapi-builtin-visit.c, qapi-builtin-types.h, qapi-builtin-visit.h, but
> only with --builtins.  Obey --output-dir, but ignore --prefix for
> them.
> 
> Make qapi-types.h include qapi-builtin-types.h.  With multiple
> schemata you now have multiple qapi-types.[ch], but only one
> qapi-builtin-types.[ch].  Same for qapi-visit.[ch] and
> qapi-builtin-visit.[ch].
> 
> Bonus: if all you need is built-in stuff, you can include a much
> smaller header.  To be exploited shortly.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 18/21] qapi/common: Fix guardname() for funny filenames
  2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 18/21] qapi/common: Fix guardname() for funny filenames Markus Armbruster
  2018-02-05 13:47   ` Marc-Andre Lureau
@ 2018-02-06 21:00   ` Eric Blake
  1 sibling, 0 replies; 87+ messages in thread
From: Eric Blake @ 2018-02-06 21:00 UTC (permalink / raw)
  To: Markus Armbruster, qemu-devel; +Cc: marcandre.lureau, mdroth

On 02/02/2018 07:03 AM, Markus Armbruster wrote:
> guardname() fails to return a valid C identifier for arguments
> containing anything but [A-Za-z0-9_.-'].  Fix that.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>   scripts/qapi/common.py | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py
> index 7ffffc78d9..7d497b5b17 100644
> --- a/scripts/qapi/common.py
> +++ b/scripts/qapi/common.py
> @@ -1860,7 +1860,7 @@ def mcgen(code, **kwds):
>   
>   
>   def guardname(filename):
> -    return c_name(filename, protect=False).upper()
> +    return re.sub(r'[^A-Za-z0-9_]', '_', filename).upper()

For some choices of filename, the old code prefixes a q_ (via c_name) 
which gets turned into Q_ in the final guard name.  The new code does 
not.  Then again, all of the names protected by c_name() all contain 
lower case, while guard names are all upper case; so we aren't 
protecting ourselves from defining a reserved word; the main use for 
c_name() is to protect ourselves where we are not changing case (for 
example, _BOOL is no better than Q__BOOL as a guard name for a file 
named _Bool).

Might be worth mentioning this design consideration in the commit 
message, but the change itself is reasonable.

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [Qemu-devel] [PATCH RFC 06/21] qapi-gen: New common driver for code and doc generators
  2018-02-05 15:36     ` Markus Armbruster
@ 2018-02-08  9:55       ` Markus Armbruster
  0 siblings, 0 replies; 87+ messages in thread
From: Markus Armbruster @ 2018-02-08  9:55 UTC (permalink / raw)
  To: Marc-Andre Lureau; +Cc: marcandre, qemu-devel, mdroth

Markus Armbruster <armbru@redhat.com> writes:

> Marc-Andre Lureau <mlureau@redhat.com> writes:
>
>> On Fri, Feb 2, 2018 at 2:03 PM, Markus Armbruster <armbru@redhat.com> wrote:
[...]
>>> diff --git a/scripts/qapi2texi.py b/scripts/qapi/doc.py
>>> old mode 100755
>>> new mode 100644
>>> similarity index 92%
>>> rename from scripts/qapi2texi.py
>>> rename to scripts/qapi/doc.py
>>> index 924b374cd3..1f57f6e1c2
>>> --- a/scripts/qapi2texi.py
>>> +++ b/scripts/qapi/doc.py
>>> @@ -4,10 +4,9 @@
>>>  # This work is licensed under the terms of the GNU LGPL, version 2+.
>>>  # See the COPYING file in the top-level directory.
>>>  """This script produces the documentation of a qapi schema in texinfo format"""
>>> +
>>>  import re
>>> -import sys
>>> -
>>> -import qapi
>>> +import qapi.common
>>>
>>>  MSG_FMT = """
>>>  @deftypefn {type} {{}} {name}
>>> @@ -196,7 +195,7 @@ def texi_entity(doc, what, base=None, variants=None,
>>>              + texi_sections(doc))
>>>
>>>
>>> -class QAPISchemaGenDocVisitor(qapi.QAPISchemaVisitor):
>>> +class QAPISchemaGenDocVisitor(qapi.common.QAPISchemaVisitor):
>>
>> Would be a bit easier to read and more consitent with a top-level
>> "from qapi.common import QAPISchemaVisitor"
>
> Can do.

The obvious patch (appended) doesn't work, because doc_required is
always False in gen_doc().  WTF?!?

[...]


diff --git a/scripts/qapi/doc.py b/scripts/qapi/doc.py
index 4027722032..919e77b79e 100644
--- a/scripts/qapi/doc.py
+++ b/scripts/qapi/doc.py
@@ -7,7 +7,7 @@
 
 from __future__ import print_function
 import re
-import qapi.common
+from qapi.common import doc_required, QAPIGenDoc, QAPISchemaVisitor
 
 MSG_FMT = """
 @deftypefn {type} {{}} {name}
@@ -196,7 +196,7 @@ def texi_entity(doc, what, base=None, variants=None,
             + texi_sections(doc))
 
 
-class QAPISchemaGenDocVisitor(qapi.common.QAPISchemaVisitor):
+class QAPISchemaGenDocVisitor(QAPISchemaVisitor):
     def __init__(self):
         self.out = None
         self.cur_doc = None
@@ -272,7 +272,7 @@ def texi_schema(schema):
 
 
 def gen_doc(schema, output_dir, prefix):
-    if qapi.common.doc_required:
-        gen = qapi.common.QAPIGenDoc()
+    if doc_required:
+        gen = QAPIGenDoc()
         gen.add(texi_schema(schema))
         gen.write(output_dir, prefix + 'qapi.texi')

^ permalink raw reply related	[flat|nested] 87+ messages in thread

end of thread, other threads:[~2018-02-08  9:55 UTC | newest]

Thread overview: 87+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-02 13:03 [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code Markus Armbruster
2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 01/21] qapi: Streamline boilerplate comment generation Markus Armbruster
2018-02-02 15:08   ` Eric Blake
2018-02-03  8:45     ` Markus Armbruster
2018-02-05 13:44   ` Marc-Andre Lureau
2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 02/21] qapi: Generate up-to-date copyright notice Markus Armbruster
2018-02-02 15:47   ` Eric Blake
2018-02-03  8:48     ` Markus Armbruster
2018-02-05 13:44   ` Marc-Andre Lureau
2018-02-05 15:28     ` Markus Armbruster
2018-02-05 15:45     ` Eric Blake
2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 03/21] qapi: New classes QAPIGenC, QAPIGenH, QAPIGenDoc Markus Armbruster
2018-02-02 15:59   ` Eric Blake
2018-02-03  8:49     ` Markus Armbruster
2018-02-05 15:46       ` Eric Blake
2018-02-06  7:28         ` Markus Armbruster
2018-02-05 13:44   ` Marc-Andre Lureau
2018-02-05 15:34     ` Markus Armbruster
2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 04/21] qapi: Reduce use of global variables in generators some Markus Armbruster
2018-02-02 16:03   ` Eric Blake
2018-02-05 13:44   ` Marc-Andre Lureau
2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 05/21] qapi: Turn generators into modules Markus Armbruster
2018-02-02 16:47   ` Eric Blake
2018-02-05 13:44   ` Marc-Andre Lureau
2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 06/21] qapi-gen: New common driver for code and doc generators Markus Armbruster
2018-02-02 19:27   ` Eric Blake
2018-02-03  9:03     ` Markus Armbruster
2018-02-05 15:52       ` Eric Blake
2018-02-06  7:45         ` Markus Armbruster
2018-02-06 14:56           ` Eric Blake
2018-02-05 13:44   ` Marc-Andre Lureau
2018-02-05 15:36     ` Markus Armbruster
2018-02-08  9:55       ` Markus Armbruster
2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 07/21] qapi: Move parse_command_line() next to its only use Markus Armbruster
2018-02-02 19:29   ` Eric Blake
2018-02-05 13:45   ` Marc-Andre Lureau
2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 08/21] qapi: Touch generated files only when they change Markus Armbruster
2018-02-02 19:42   ` Eric Blake
2018-02-03  9:05     ` Markus Armbruster
2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 09/21] qapi: Don't absolutize include file name in error messages Markus Armbruster
2018-02-02 20:22   ` Eric Blake
2018-02-03  9:08     ` Markus Armbruster
2018-02-05 15:55       ` Eric Blake
2018-02-06  7:49         ` Markus Armbruster
2018-02-06 15:06           ` Eric Blake
2018-02-05 13:46   ` Marc-Andre Lureau
2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 10/21] qapi/common: Eliminate QAPISchema.exprs Markus Armbruster
2018-02-02 22:02   ` Eric Blake
2018-02-05 13:45   ` Marc-Andre Lureau
2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 11/21] qapi: Lift error reporting from QAPISchema.__init__() to callers Markus Armbruster
2018-02-05 13:45   ` Marc-Andre Lureau
2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 12/21] qapi: Concentrate QAPISchemaParser.exprs updates in .__init__() Markus Armbruster
2018-02-05 13:45   ` Marc-Andre Lureau
2018-02-05 14:26     ` Markus Armbruster
2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 13/21] qapi: Record 'include' directives in parse tree Markus Armbruster
2018-02-05 13:45   ` Marc-Andre Lureau
2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 14/21] qapi: Generate in source order Markus Armbruster
2018-02-05 13:45   ` Marc-Andre Lureau
2018-02-05 14:33     ` Markus Armbruster
2018-02-05 14:40       ` Marc-Andre Lureau
2018-02-06 10:33       ` Markus Armbruster
2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 15/21] qapi: Record 'include' directives in intermediate representation Markus Armbruster
2018-02-05 13:45   ` Marc-Andre Lureau
2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 16/21] qapi/types qapi/visit: Make visitors use QAPIGen more Markus Armbruster
2018-02-05 13:46   ` Marc-Andre Lureau
2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 17/21] qapi/types qapi/visit: Generate built-in stuff into separate files Markus Armbruster
2018-02-05 13:46   ` Marc-Andre Lureau
2018-02-06 20:54   ` Eric Blake
2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 18/21] qapi/common: Fix guardname() for funny filenames Markus Armbruster
2018-02-05 13:47   ` Marc-Andre Lureau
2018-02-06 21:00   ` Eric Blake
2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 19/21] qapi/types: Generate separate .h, .c for each module Markus Armbruster
2018-02-05 13:58   ` Marc-Andre Lureau
2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 20/21] Include less of qapi-types.h Markus Armbruster
2018-02-05 13:46   ` Marc-Andre Lureau
2018-02-05 14:53     ` Markus Armbruster
2018-02-02 13:03 ` [Qemu-devel] [PATCH RFC 21/21] qapi: Empty out qapi-schema.json Markus Armbruster
2018-02-05 13:45   ` Marc-Andre Lureau
2018-02-02 14:52 ` [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code Markus Armbruster
2018-02-02 16:44 ` Daniel P. Berrangé
2018-02-03  9:18   ` Markus Armbruster
2018-02-02 18:36 ` no-reply
2018-02-02 19:33 ` no-reply
2018-02-02 20:11 ` no-reply
2018-02-02 21:13 ` no-reply
2018-02-02 22:14 ` no-reply
2018-02-03 11:30 ` Markus Armbruster

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.