From: Max Reitz <mreitz@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>,
Luiz Capitulino <lcapitulino@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v4 0/3] chardev: Add -qmp-pretty
Date: Tue, 02 Dec 2014 10:24:51 +0100 [thread overview]
Message-ID: <547D8563.2020501@redhat.com> (raw)
In-Reply-To: <8738931fr3.fsf@blackfin.pond.sub.org>
On 2014-11-28 at 16:55, Markus Armbruster wrote:
> Copying Luiz.
>
> Max Reitz <mreitz@redhat.com> 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
next prev parent reply other threads:[~2014-12-02 9:25 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-17 12:31 [Qemu-devel] [PATCH v4 0/3] chardev: Add -qmp-pretty Max Reitz
2014-11-17 12:31 ` [Qemu-devel] [PATCH v4 1/3] " Max Reitz
2014-11-17 12:31 ` [Qemu-devel] [PATCH v4 2/3] iotests: _filter_qmp for pretty JSON output Max Reitz
2014-11-17 16:04 ` Eric Blake
2014-11-17 16:14 ` Max Reitz
2014-11-17 17:06 ` Eric Blake
2014-11-17 12:31 ` [Qemu-devel] [PATCH v4 3/3] iotests: Use -qmp-pretty in 067 Max Reitz
2014-11-20 18:39 ` Kevin Wolf
2014-11-20 18:56 ` Max Reitz
2014-11-20 19:43 ` Eric Blake
2014-11-20 17:02 ` [Qemu-devel] [PATCH v4 0/3] chardev: Add -qmp-pretty Kevin Wolf
2014-11-28 15:55 ` Markus Armbruster
2014-11-28 17:21 ` Paolo Bonzini
2014-12-02 9:24 ` Max Reitz [this message]
2014-12-02 18:17 ` Markus Armbruster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=547D8563.2020501@redhat.com \
--to=mreitz@redhat.com \
--cc=armbru@redhat.com \
--cc=kwolf@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.