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