qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 05/27] qapi: add SIZE type parser to string_inpu


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 05/27] qapi: add SIZE type parser to string_input_visitor
Date: Mon, 25 Nov 2013 17:32:34 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130923 Thunderbird/17.0.9

Il 25/11/2013 17:04, Michael S. Tsirkin ha scritto:
>>> > > 
>>> > > Does this put syntax like "value": "128M" in QMP?  If yes, NAK.  QMP
>>> > > does not want fancy syntax for numbers, only plain numbers.
>>> > > 
>> > 
>> > I thought QMP uses its own qmp_visitor, so it shouldn't affect general QMP,
>> > if I'm not mistaken.
>> > 
>> > but it allows to use unified memdev_add parser for all interfaces 
>> > (CLI/HMP/QMP) and
>> > it's more user friendly to have on CLI/HMP size=1G vs long integer to 
>> > express it.
> Yes please. Firing up a calculator to figure out how much is 1G is not
> friendly, neither is firing it up to figure out what did management do
> with QMP. It should be a text based interface not a binary one.

Wait. :)

Command-line and *HMP* object_add (and if we add them, qom_get/qom_set)
should be a text based interface.  Right now it could be implemented
using object_property_parse/print which use the
string-input/output-visitor.  This is the visitor that this patch touches.

QMP object_add (like qom_get/qom-set) should not be at all a text based
interface.  As Igor says, it should use the QDict-based visitor.

This is unfortunately a counter-example to the rule that HMP commands
should always be implemented in terms of their QMP counterparts.  I do
not believe this is really a problem.  It can be fixed later; for now, I
think "perfect is the enemy of good" applies.

Paolo



reply via email to

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