qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: David Edmondson <david.edmondson@oracle.com>,
	qemu-devel@nongnu.org, qemu-trivial@nongnu.org
Cc: Markus Armbruster <armbru@redhat.com>
Subject: Re: [PATCH] qmp-shell: Sort by key when pretty-printing
Date: Tue, 13 Oct 2020 16:19:38 +0200	[thread overview]
Message-ID: <71a27e2a-3883-fc4f-647f-594b49f62816@redhat.com> (raw)
In-Reply-To: <20201013141414.18398-1-david.edmondson@oracle.com>

On 10/13/20 4:14 PM, David Edmondson wrote:
> If the user selects pretty-printing (-p) the contents of any
> dictionaries in the output are sorted by key.
> 
> Signed-off-by: David Edmondson <david.edmondson@oracle.com>
> ---
>   scripts/qmp/qmp-shell | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/qmp/qmp-shell b/scripts/qmp/qmp-shell
> index c5eef06f3f..b4d06096ab 100755
> --- a/scripts/qmp/qmp-shell
> +++ b/scripts/qmp/qmp-shell
> @@ -260,7 +260,7 @@ class QMPShell(qmp.QEMUMonitorProtocol):
>           indent = None
>           if self._pretty:
>               indent = 4
> -        jsobj = json.dumps(qmp, indent=indent)
> +        jsobj = json.dumps(qmp, indent=indent, sort_keys=self._pretty)
>           print(str(jsobj))
>   
>       def _execute_cmd(self, cmdline):
> 

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>



  reply	other threads:[~2020-10-13 14:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-13 14:14 [PATCH] qmp-shell: Sort by key when pretty-printing David Edmondson
2020-10-13 14:19 ` Philippe Mathieu-Daudé [this message]
2020-10-20  6:43 ` Markus Armbruster
2020-11-30 20:56 ` John Snow
2020-11-30 21:57   ` David Edmondson
2020-12-01 15:17     ` John Snow

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=71a27e2a-3883-fc4f-647f-594b49f62816@redhat.com \
    --to=philmd@redhat.com \
    --cc=armbru@redhat.com \
    --cc=david.edmondson@oracle.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).