From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38069) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vkz5m-0005Ck-WE for qemu-devel@nongnu.org; Mon, 25 Nov 2013 11:33:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vkz5h-0003dt-14 for qemu-devel@nongnu.org; Mon, 25 Nov 2013 11:32:58 -0500 Received: from mx1.redhat.com ([209.132.183.28]:17978) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vkz5g-0003dZ-NI for qemu-devel@nongnu.org; Mon, 25 Nov 2013 11:32:52 -0500 Message-ID: <52937BA2.6020605@redhat.com> Date: Mon, 25 Nov 2013 17:32:34 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1385001528-12003-1-git-send-email-imammedo@redhat.com> <1385001528-12003-6-git-send-email-imammedo@redhat.com> <87r4aaxdqt.fsf@blackfin.pond.sub.org> <20131125163642.4d832fd5@nial.usersys.redhat.com> <20131125160337.GB10326@redhat.com> In-Reply-To: <20131125160337.GB10326@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 05/27] qapi: add SIZE type parser to string_input_visitor List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: peter.maydell@linaro.org, mdroth@linux.vnet.ibm.com, stefanb@linux.vnet.ibm.com, hutao@cn.fujitsu.com, quintela@redhat.com, mjt@tls.msk.ru, Markus Armbruster , qemu-devel@nongnu.org, vasilis.liaskovitis@profitbricks.com, chegu_vinod@hp.com, kraxel@redhat.com, aliguori@amazon.com, Igor Mammedov , marcel.a@redhat.com, lcapitulino@redhat.com, stefanha@redhat.com, afaerber@suse.de 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