[Top][All Lists]

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

Re: [Qemu-devel] [PATCH 01/11] QMP: Introduce specification file

From: Avi Kivity
Subject: Re: [Qemu-devel] [PATCH 01/11] QMP: Introduce specification file
Date: Tue, 30 Jun 2009 19:05:58 +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/30/2009 05:03 PM, Luiz Capitulino wrote:
Great.  So Luiz, do you understand and agree with the proposed changes
to your series?

  Yes, only the lists and dictionaries types are not very clear
to me.

  Should command handlers return data in those types to the
monitor and thus get printed by it?

  Detailed is welcome, anyway.

I would recommend proceeding as follows:

1. Add QValue, QArray, QDictionary

QValue is a polymorphic object that can be a number, a string, an array, or a dictionary. It needs a bunch of accessors like qvalue_to_qarray() to check if a value is an array, and things like qarray_get() or qdict_put() to manipulate them. For the simpler data types, qvalue_to_int64() and qvalue_from_int64() should suffice.

2. Split the human monitor command implementations into protocol adapters and implementation.

The protocol adapter reads the command, parses it according to qemu-monitor.hx, and constructs a QArray of the parameter list and passes it down to the command implementation. The command implementation returns a QValue, which the protocol adapter formats to the human monitor response format.

3. Refine the object model

Instead of passing a QArray for the argument list, pass a QDictionary. For arguments that are themselves dictionaries (file=blah.img,cache=none), pass them as dictionaries instead of strings ({file: blah.img, cache: none}).

When the dust settles down on the encoding selection, we simply make the machine protocol parser generate QValues and pass these to the newly-splitted command implementations. We pass the return value to an emitter of our choice which can convert an arbitrary QValue into a string representation.

error compiling committee.c: too many arguments to function

reply via email to

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