|
From: | Avi Kivity |
Subject: | Re: [Qemu-devel] Re: [PATCH 08/11] QMP: Port balloon command |
Date: | Sun, 28 Jun 2009 20:43:06 +0300 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Lightning/1.0pre Thunderbird/3.0b2 |
On 06/28/2009 08:23 PM, Filip Navara wrote:
On Sun, Jun 28, 2009 at 5:52 PM, Avi Kivity<address@hidden> wrote:On 06/27/2009 06:58 PM, Luiz Capitulino wrote:So, IMHO both solutions (QMP and JSON) solves the problem and I would work on either one. I just would like that Anthony and Avi get in agreement, because the project will fail if it becomes one more difference between qemu and qemu-kvm.There's no danger of a diverging implementation in this case since no one is proposing to have different monitor protocols. We just need to find the best protocol. Anthony's looking for minimal churn for the existing monitor command set and for libvirt, while I am considering the additional effort for new commands and for new clients.I'm with Avi on this issue, but I will be happy as long as the protocol is precisely described and extensible for future. Moreover I believe that converting the current code to use a new function like monitor_print_data could be done now even without knowing the exact details of the on-wire protocol. The monitor_print_data function could be then adjusted to understand the protocol specifics and emit the data accordingly.
In terms of implementation, I think we could structure the human and machine monitor as follows:
- the human monitor parses a command (with the current parser) and generates a dict - the machine monitor (using a json-like parser) parses its input which contains a parameter dict
- the dict is handed off to common code - common code does something, returns an error code and a return value - the human monitor prints the return value (with the current printfs)- the machine monitor packs the return value according to the protocol and lets the json-like emitter emit it
So we don't have to duplicate parsers an emitters; instead we have to write some accessor functions for generalized values (which can come from the human monitor, command line, machine monitor, and maybe config file).
-- error compiling committee.c: too many arguments to function
[Prev in Thread] | Current Thread | [Next in Thread] |