All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v1 00/23] QAPI Infrastructure Round 1
@ 2011-05-18  0:51 Michael Roth
  2011-05-18  0:51 ` [Qemu-devel] [PATCH v1][ 01/23] Add hard build dependency on glib Michael Roth
                   ` (23 more replies)
  0 siblings, 24 replies; 36+ messages in thread
From: Michael Roth @ 2011-05-18  0:51 UTC (permalink / raw)
  To: qemu-devel; +Cc: aliguori, mdroth, lcapitulino

These apply on top of master, and can also be obtained from:
git://repo.or.cz/qemu/mdroth.git qapi_round1_v1

These patches are a backport of some of the QAPI-related work from Anthony's
glib tree. The main goal is to get the basic code generation infrastructure in
place so that it can be used by the guest agent to implement a QMP-like guest
interface, and so that future work regarding the QMP conversion to QAPI can be
decoupled from the infrastructure bits.

Round1 incorporates the following components from Anthony's tree:

 - Pulls in GLib libraries (core GLib, GThreads, and GIO)

 - Adds code to do exception-like error propagation

 - New error reporting functions

 - Schema-based code generation for QAPI types and synchronous QMP commands
   using visiter patterns to cut reduce the amount of code generated by the
   previous scripts. This is just infrastructure, QMP will remain untouched
   until the actual conversion efforts are underway. Only a set of unit tests
   and, in the guest, virtagent, will utilize this infrastructure initially.

The code in this patchest has been exercised fairly extensively with both the
guest agent and the unit tests, and should be fairly close to final form. Only
the qerror and glib dependencies will have any affect on the existing tree so
the hope is that continued work can be done upstream.

TESTING/USAGE:

I was planning on including generated output examples for easy reference but I
didn't want to get the patch count up too high. Reviewing that code should be be
straightforward via the unit tests however:

  For type and visiter generation: `make test-visiter`
  For type, visiter, marshalling/dispatch: `make test-qmp-commands`

Generated code will be output to $(SRC_DIR)/qapi-generated/

I'm planning on a Round2 after this which will capture a small set of patches
related to hardening the json parser. Those will potentially impact QMP
functionality so I didn't want to toss them in here.

Comments and testing are very appreciated. Thanks!

KNOWN ISSUES:

 - Extra newlines in the marshalling code
 - Memory leak in input marshalling code (input parameters need to be
   deallocated after they're passed to the QMP function)

 Makefile                    |   21 ++
 Makefile.objs               |   12 +-
 Makefile.target             |    1 +
 configure                   |   13 ++
 error.c                     |  132 +++++++++++++
 error.h                     |   70 +++++++
 error_int.h                 |   27 +++
 module.h                    |    2 +
 qapi-schema-test.json       |   16 ++
 qapi/qapi-dealloc-visiter.c |  125 ++++++++++++
 qapi/qapi-dealloc-visiter.h |   13 ++
 qapi/qapi-types-core.h      |   12 ++
 qapi/qapi-visit-core.h      |  175 +++++++++++++++++
 qapi/qmp-core.h             |   90 +++++++++
 qapi/qmp-dispatch.c         |  104 ++++++++++
 qapi/qmp-input-visiter.c    |  239 +++++++++++++++++++++++
 qapi/qmp-input-visiter.h    |   13 ++
 qapi/qmp-output-visiter.c   |  188 +++++++++++++++++++
 qapi/qmp-output-visiter.h   |   14 ++
 qapi/qmp-registry.c         |   38 ++++
 qerror-report.c             |  139 ++++++++++++++
 qerror.c                    |  178 +++++-------------
 qerror.h                    |    7 +
 qlist.h                     |   10 +
 scripts/ordereddict.py      |  128 +++++++++++++
 scripts/qapi-commands.py    |  437 +++++++++++++++++++++++++++++++++++++++++++
 scripts/qapi-types.py       |  243 ++++++++++++++++++++++++
 scripts/qapi-visit.py       |  219 ++++++++++++++++++++++
 scripts/qapi.py             |  181 ++++++++++++++++++
 test-qmp-commands.c         |  113 +++++++++++
 test-visiter.c              |  214 +++++++++++++++++++++
 31 files changed, 3045 insertions(+), 129 deletions(-)

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

end of thread, other threads:[~2011-05-18 17:45 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-18  0:51 [Qemu-devel] [PATCH v1 00/23] QAPI Infrastructure Round 1 Michael Roth
2011-05-18  0:51 ` [Qemu-devel] [PATCH v1][ 01/23] Add hard build dependency on glib Michael Roth
2011-05-18  0:51 ` [Qemu-devel] [PATCH v1][ 02/23] error-propagation: base code for error propagation Michael Roth
2011-05-18  0:51 ` [Qemu-devel] [PATCH v1][ 03/23] error-propagation: build qemu with with error-propagation bits Michael Roth
2011-05-18 13:53   ` Luiz Capitulino
2011-05-18  0:51 ` [Qemu-devel] [PATCH v1][ 04/23] qerror: refactor error to make the human message reusable Michael Roth
2011-05-18  8:09   ` Stefan Hajnoczi
2011-05-18 13:54     ` Luiz Capitulino
2011-05-18  0:51 ` [Qemu-devel] [PATCH v1][ 05/23] qlist: add qlist_first()/qlist_next() Michael Roth
2011-05-18  8:12   ` Stefan Hajnoczi
2011-05-18  0:51 ` [Qemu-devel] [PATCH v1][ 06/23] qapi: add module init types for qapi Michael Roth
2011-05-18  0:51 ` [Qemu-devel] [PATCH v1][ 07/23] qapi: add ordereddict/qapi.py helper libraries Michael Roth
2011-05-18  0:51 ` [Qemu-devel] [PATCH v1][ 08/23] qapi: add qapi-types.py code generator Michael Roth
2011-05-18  0:51 ` [Qemu-devel] [PATCH v1][ 09/23] qapi: add qapi-visit.py " Michael Roth
2011-05-18  0:51 ` [Qemu-devel] [PATCH v1][ 10/23] qapi: add qapi-commands.py " Michael Roth
2011-05-18  0:51 ` [Qemu-devel] [PATCH v1][ 11/23] qapi: add qapi-types-core.h Michael Roth
2011-05-18  0:51 ` [Qemu-devel] [PATCH v1][ 12/23] qapi: add qapi-visit-core.h Michael Roth
2011-05-18  0:52 ` [Qemu-devel] [PATCH v1][ 13/23] qapi: add QMP input visiter Michael Roth
2011-05-18  8:35   ` Stefan Hajnoczi
2011-05-18  0:52 ` [Qemu-devel] [PATCH v1][ 14/23] qapi: add QMP output visiter Michael Roth
2011-05-18  8:44   ` Stefan Hajnoczi
2011-05-18  0:52 ` [Qemu-devel] [PATCH v1][ 15/23] qapi: add QAPI dealloc visiter Michael Roth
2011-05-18  0:52 ` [Qemu-devel] [PATCH v1][ 16/23] qapi: add command registration/lookup functions Michael Roth
2011-05-18  0:52 ` [Qemu-devel] [PATCH v1][ 17/23] qapi: add QMP dispatch functions Michael Roth
2011-05-18  8:58   ` Stefan Hajnoczi
2011-05-18  0:52 ` [Qemu-devel] [PATCH v1][ 18/23] qapi: add base declaration/types for QMP Michael Roth
2011-05-18  0:52 ` [Qemu-devel] [PATCH v1][ 19/23] qapi: test schema used for unit tests Michael Roth
2011-05-18  0:52 ` [Qemu-devel] [PATCH v1][ 20/23] qapi: add test-visiter, tests for gen. visiter code Michael Roth
2011-05-18  0:52 ` [Qemu-devel] [PATCH v1][ 21/23] qapi: Makefile changes to build test-visiter Michael Roth
2011-05-18  0:52 ` [Qemu-devel] [PATCH v1][ 22/23] qapi: add test-qmp-commands, tests for gen. marshalling/dispatch code Michael Roth
2011-05-18  0:52 ` [Qemu-devel] [PATCH v1][ 23/23] qapi: Makefile changes to build test-qmp-commands Michael Roth
2011-05-18 13:46 ` [Qemu-devel] [PATCH v1 00/23] QAPI Infrastructure Round 1 Luiz Capitulino
2011-05-18 14:43   ` Michael Roth
2011-05-18 15:10     ` Luiz Capitulino
2011-05-18 16:33       ` Michael Roth
2011-05-18 17:45         ` Luiz Capitulino

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.