qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kashyap Chamarthy <kchamart@redhat.com>
To: Laszlo Ersek <lersek@redhat.com>
Cc: "Eric Blake" <eblake@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	qemu-devel@nongnu.org, libvir-list@redhat.com
Subject: Re: [Qemu-devel] [RFC] Defining firmware (OVMF, et al) metadata format & file
Date: Mon, 9 Apr 2018 11:02:44 +0200	[thread overview]
Message-ID: <20180409090244.GP9903@paraplu> (raw)
In-Reply-To: <721a331e-0ba9-58e2-8659-81b725a0ddff@redhat.com>

On Fri, Apr 06, 2018 at 08:21:00PM +0200, Laszlo Ersek wrote:
> On 04/06/18 20:10, Eric Blake wrote:

[...]

> # key=value pairs also support Python or JSON object literal subset notations,
> # without spaces. Dictionaries/objects {} are supported as are arrays [].
> #
> #    example-command arg-name1={'key':'value','obj'={'prop':"value"}}
> #
> # Both JSON and Python formatting should work, including both styles of
> # string literal quotes. Both paradigms of literal values should work,
> # including null/true/false for JSON and None/True/False for Python.

A couple of examples of the the key-value pairs and using JSON dicts
with 'qmp-shell'.

Key-value pairs:

  (QEMU) blockdev-snapshot node=node-Base snapshot-file=./overlay1.qcow2 overlay=node-Overlay1
  [...]

A combination key-value pairs and JSON dicts:

   (QEMU) blockdev-add driver=qcow2 node-name=node-overlay1 file={"driver":"file","filename":"overlay1.qcow2"}
   [...]

> This looks awesome, because it should let me provide messy nested input
> (which I'll obviously compose in my $EDITOR and then paste it), and then
> the QMP shell will both validate and pretty print that. I'm going to try
> this.

A couple of notes when using the 'qmp-shell':

  - Assuming you started QEMU with: `[...] -qmp
    unix:/tmp/qmp-sock,server,nowait`, you might want to use the '-p'
    command-line option to prett-print the JSON:
    
        $ qmp-shell -v -p /tmp/qmp-sock

  - It also provides a persistent command history in a convenient file:
    '~/.qmp-shell_history'

-- 
/kashyap

  reply	other threads:[~2018-04-09  9:02 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-07 14:49 [Qemu-devel] [RFC] Defining firmware (OVMF, et al) metadata format & file Kashyap Chamarthy
2018-03-07 15:18 ` Daniel P. Berrangé
2018-03-08  7:52   ` Gerd Hoffmann
2018-03-08 10:17     ` Daniel P. Berrangé
2018-04-06 17:28       ` Laszlo Ersek
2018-04-06 18:10         ` Eric Blake
2018-04-06 18:21           ` Laszlo Ersek
2018-04-09  9:02             ` Kashyap Chamarthy [this message]
2018-04-09 15:32               ` Laszlo Ersek
2018-03-09 10:02     ` Kashyap Chamarthy
2018-03-08  7:45 ` Gerd Hoffmann
2018-03-08 10:16   ` Daniel P. Berrangé
2018-03-08 11:10 ` Laszlo Ersek
2018-03-08 15:47   ` Daniel P. Berrangé
2018-03-08 20:47     ` Laszlo Ersek
2018-03-09 11:27       ` Kashyap Chamarthy
2018-03-09 15:09         ` Laszlo Ersek
2018-03-12 11:17       ` Daniel P. Berrangé
2018-03-09 14:27   ` Gerd Hoffmann
2018-03-09 15:18     ` Laszlo Ersek
2018-03-12 11:13       ` Daniel P. Berrangé

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=20180409090244.GP9903@paraplu \
    --to=kchamart@redhat.com \
    --cc=berrange@redhat.com \
    --cc=eblake@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=lersek@redhat.com \
    --cc=libvir-list@redhat.com \
    --cc=qemu-devel@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).