From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46636) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xvjhd-0007FD-9M for qemu-devel@nongnu.org; Tue, 02 Dec 2014 04:25:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XvjhX-0000Gv-3z for qemu-devel@nongnu.org; Tue, 02 Dec 2014 04:25:01 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51342) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XvjhW-0000Gp-S1 for qemu-devel@nongnu.org; Tue, 02 Dec 2014 04:24:55 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sB29OreZ026191 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Tue, 2 Dec 2014 04:24:54 -0500 Message-ID: <547D8563.2020501@redhat.com> Date: Tue, 02 Dec 2014 10:24:51 +0100 From: Max Reitz MIME-Version: 1.0 References: <1416227466-29491-1-git-send-email-mreitz@redhat.com> <8738931fr3.fsf@blackfin.pond.sub.org> In-Reply-To: <8738931fr3.fsf@blackfin.pond.sub.org> Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v4 0/3] chardev: Add -qmp-pretty List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: Kevin Wolf , Paolo Bonzini , qemu-devel@nongnu.org, Stefan Hajnoczi , Luiz Capitulino On 2014-11-28 at 16:55, Markus Armbruster wrote: > Copying Luiz. > > Max Reitz writes: > >> This series does not add new functionality. Adding a QMP monitor with >> prettily formatted JSON output can be done as follows: >> >> $ qemu -chardev stdio,id=mon0 -mon chardev=mon0,mode=control,pretty=on >> >> However, this is rather cumbersome, so this series (its first patch) >> adds a shortcut in the form of the new command line option -qmp-pretty. >> >> Since the argument given to a monitor command line option (such as -qmp) >> is parsed depending on its prefix and probably also depending on the >> current phase of the moon, this is cleaner than trying to add a "switch" >> to -qmp itself (in the form of "-qmp stdio,pretty=on"). > Yet another "convenience" option *groan* > > Why can't we simply make -qmp set pretty=on and be done with it? > It's a convenience option, i.e. meant for humans, and why would humans > *not* want pretty=on? Well, pretty=on produces really long output. I prefer short output if I don't expect to run commands like query-block which are completely unreadable with pretty=off. I personally had a really bad taste when I saw that I couldn't modify -qmp somehow to get it to set pretty=on optionally. But then, after having implemented -qmp-pretty in basically five lines (the "case" statement for that option and the qemu_opt_set_bool() in monitor_parse()), I could send the series with a clear conscience. It's not that there's a new convenience option which is really bad to maintain and will break after the first gentle blow, as it reuses all the code paths from -qmp, which we will keep anyway. Since this is only in block-next, I wouldn't object to it being dropped and making pretty=on the default for -qmp, in principle. But I personally like having a convenience pretty=off option, too, because I as a human often actually don't want pretty=on. Max