qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 5/7] add json encoder for qobjects


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH 5/7] add json encoder for qobjects
Date: Sat, 17 Oct 2009 11:20:39 -0500
User-agent: Thunderbird 2.0.0.23 (X11/20090825)

Paolo Bonzini wrote:
On 10/17/2009 03:03 PM, Anthony Liguori wrote:

I think it makes more sense as an external entity.

Maybe... I just thought of it as a toString method that happens to emit JSON.

json is one representation of the monitor protocol. I think we should attempt to design things so that there is a clear separate of representation from the implementation.

BTW, the next thing I'd like to do this weekend is write a QObject decoded based on the json parser. So that you can do something like:

 int locked, readonly;
 char *file;

err = qobject_unmarshal(obj, "{'locked': %i, 'file': %s, 'readonly': %i}", &locked, &file, &readonly);

I think this would tremendously simplify the monitor command implementations.

Regards,

Anthony Liguori




reply via email to

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