From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MVuoF-00008o-E7 for qemu-devel@nongnu.org; Tue, 28 Jul 2009 18:06:11 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MVuoA-0008OS-Mv for qemu-devel@nongnu.org; Tue, 28 Jul 2009 18:06:10 -0400 Received: from [199.232.76.173] (port=49631 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MVuoA-0008OE-Gc for qemu-devel@nongnu.org; Tue, 28 Jul 2009 18:06:06 -0400 Received: from mx2.redhat.com ([66.187.237.31]:37477) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MVuo9-0000Ub-O6 for qemu-devel@nongnu.org; Tue, 28 Jul 2009 18:06:06 -0400 From: Luiz Capitulino Date: Tue, 28 Jul 2009 19:04:48 -0300 Message-Id: <1248818713-11261-1-git-send-email-lcapitulino@redhat.com> Subject: [Qemu-devel] [PATCH 00/25] Monitor handlers new structure phase 1 List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: jan.kiszka@siemens.com, aliguori@us.ibm.com, dlaor@redhat.com, avi@redhat.com Hi there, In the long QEMU Monitor Protocol (QMP) thread people have agreed that, whichever protocol we are going to use, the first step that needs to be done is to improve current Monitor's code, so that command handlers support 'structured' input and output. Basically, this means that handlers will receive their input through a dictionary (instead of the ugly args[] array) and will output their data back to the Monitor instead of directly printing them. Once this is done, plugging the protocol should be simple, as handlers will be part of the common code, working with both the human and (any) machine protocols. I have divided this project in the following (obvious) phases: 1. Command handlers receive their arguments through a dictionary 2. Command handlers output their data back to the Monitor 3. Plug the protocol This patchset implements phase 1. The next phase is already on the way and I should submit patches as soon as this series is merged. Something worth to mention is that I have implemented unit-tests for most of the new code (dictionary and Monitor's parsing). To this end, I'm using a unit-test framework called check: http://check.sourceforge.net In this patchset, however, I'm only merging the dictionary suite, because I have had issues in getting the Monitor's one building (I have an off tree version that works, though). Also, I have some important words regarding the _porting_ of commands: o Each patch ports a set of handlers according to their number of arguments (this is how the Monitor currently handles them) o I'm not 100% confident with regard to the type conversion needed to store integers in the dictionary, please review o As argments have been moved 'inside' the hanlders, some of them got a bit ugly and I didn't want to fix them in this series o The porting work (as all this series) has been done in way that the tree always builds and works --- Makefile | 6 + check-qdict.c | 289 +++ configure | 32 + console.h | 3 +- hw/pci-hotplug.c | 15 +- migration.c | 12 +- migration.h | 9 +- monitor.c | 480 +++-- monitor.h | 1 + net.c | 29 +- net.h | 13 +- qdict-test-data.txt | 4999 +++++++++++++++++++++++++++++++++++++++++++++++++++ qemu-dict.c | 215 +++ qemu-dict.h | 36 + qemu-monitor.hx | 109 +- savevm.c | 13 +- sysemu.h | 18 +- vl.c | 13 +- 18 files changed, 5996 insertions(+), 296 deletions(-)