qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 00/25] Monitor handlers new structure phase 1


From: Luiz Capitulino
Subject: [Qemu-devel] [PATCH 00/25] Monitor handlers new structure phase 1
Date: Tue, 28 Jul 2009 19:04:48 -0300

 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(-)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]