[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH for-2.11 v2 4/5] qmp-shell: Accept QMP command a
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH for-2.11 v2 4/5] qmp-shell: Accept QMP command as argument |
Date: |
Wed, 16 Aug 2017 08:25:41 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) |
Eduardo Habkost <address@hidden> writes:
> On Tue, Aug 15, 2017 at 12:03:53PM +0200, Markus Armbruster wrote:
>> Eduardo Habkost <address@hidden> writes:
>>
>> Suggest to insert here:
>>
>> If additional arguments QMP-COMMAND ARG=VAL... are given, run just
>> that QMP command instead of the REPL.
>>
>> Question: is this limited to simple arguments? If no, how would I write
>> an object argument? For instance, how would I do
>>
>> { "execute": "blockdev-add", "arguments": { "node-name": "foo",
>> "driver": "nbd", "server": { "type": "inet", "host": "localhost", "port":
>> "12345" } } }
>>
>> ?
>
> Exactly the same way you would write it when running qmp-shell in
> interactive mode. e.g.:
>
> $ ./scripts/qmp/qmp-shell /tmp/qmp blockdev-add driver=qcow2
> node-name=node-E 'file={"driver":"file","filename":"/path/to/file.qcow2"}'
I see.
The QEMU command line uses dotted key syntax instead.
To be honest, the less qmp-shell is used, the happier I am. Would you
like to serve as its sub-maintainer?
>> > This is useful for testing QMP commands in scripts.
>> >
>> > Example usage, combined with 'jq' for filtering the results:
>> >
>> > $ ./scripts/qmp/qmp-shell /tmp/qmp qom-list path=/ | jq -r .return[].name
>> > machine
>> > type
>> > chardevs
>> > backend
>>
>> What's jq?
>
> https://stedolan.github.io/jq/
>
> "like sed for JSON data"
A fine addition to your commit message.
>>
>> > $
>>
>> Let's drop this line.
>
> Will do it.
>
>>
>> >
>> > Signed-off-by: Eduardo Habkost <address@hidden>
[...]
- Re: [Qemu-devel] [PATCH for-2.11 v2 1/5] qmp-shell: Use optparse module, (continued)
Re: [Qemu-devel] [PATCH for-2.11 v2 1/5] qmp-shell: Use optparse module, Daniel P. Berrange, 2017/08/15
[Qemu-devel] [PATCH for-2.11 v2 2/5] qmp-shell: Pass split cmdargs to __build_cmd(), Eduardo Habkost, 2017/08/08
[Qemu-devel] [PATCH for-2.11 v2 3/5] qmp-shell: execute_cmdargs() method, Eduardo Habkost, 2017/08/08
[Qemu-devel] [PATCH for-2.11 v2 4/5] qmp-shell: Accept QMP command as argument, Eduardo Habkost, 2017/08/08
[Qemu-devel] [PATCH for-2.11 v2 5/5] Remove scripts/qmp/qmp, Eduardo Habkost, 2017/08/08