OSDN Git Service

qmp-shell: learn to send commands with quoted arguments
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Mon, 26 Mar 2018 15:08:40 +0000 (17:08 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Wed, 15 Aug 2018 05:24:22 +0000 (07:24 +0200)
commitfcfab7541020d835daab3f7143da321cf1def926
tree312ecc1b13fe1ad22fecbf6365ff8626c63e7229
parent38441756b70eec5807b5f60dad11a93a91199866
qmp-shell: learn to send commands with quoted arguments

Use shlex to split the CLI command, respecting quoted arguments, and
also comments. This allows to call for ex:

(QEMU) human-monitor-command command-line="screendump /dev/null"
{"execute": "human-monitor-command", "arguments": {"command-line": "screendump /dev/null"}}

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20180326150916.9602-3-marcandre.lureau@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
scripts/qmp/qmp-shell