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