From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:43599) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMV0A-0005Af-GO for qemu-devel@nongnu.org; Tue, 17 May 2011 20:52:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QMV09-0005AL-EF for qemu-devel@nongnu.org; Tue, 17 May 2011 20:52:38 -0400 Received: from mout.perfora.net ([74.208.4.194]:56597) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMV09-00058e-9s for qemu-devel@nongnu.org; Tue, 17 May 2011 20:52:37 -0400 From: Michael Roth Date: Tue, 17 May 2011 19:51:47 -0500 Message-Id: <1305679930-4215-1-git-send-email-mdroth@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH v1 00/23] QAPI Infrastructure Round 1 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@linux.vnet.ibm.com, mdroth@linux.vnet.ibm.com, lcapitulino@redhat.com 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(-)