[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 1/5] qmp-shell: learn to send commands with quoted ar
From: |
Markus Armbruster |
Subject: |
[Qemu-devel] [PULL 1/5] qmp-shell: learn to send commands with quoted arguments |
Date: |
Wed, 15 Aug 2018 09:13:04 +0200 |
From: Marc-André Lureau <address@hidden>
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 <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
---
scripts/qmp/qmp-shell | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/scripts/qmp/qmp-shell b/scripts/qmp/qmp-shell
index a42306dd89..770140772d 100755
--- a/scripts/qmp/qmp-shell
+++ b/scripts/qmp/qmp-shell
@@ -74,6 +74,7 @@ import sys
import os
import errno
import atexit
+import shlex
class QMPCompleter(list):
def complete(self, text, state):
@@ -219,7 +220,7 @@ class QMPShell(qmp.QEMUMonitorProtocol):
< command-name > [ arg-name1=arg1 ] ... [ arg-nameN=argN ]
"""
- cmdargs = cmdline.split()
+ cmdargs = shlex.split(cmdline)
# Transactional CLI entry/exit:
if cmdargs[0] == 'transaction(':
--
2.17.1
- [Qemu-devel] [PULL 0/5] Miscellaneous patches for 2018-08-15, Markus Armbruster, 2018/08/15
- [Qemu-devel] [PULL 3/5] qapi: Fix some pycodestyle-3 complaints, Markus Armbruster, 2018/08/15
- [Qemu-devel] [PULL 1/5] qmp-shell: learn to send commands with quoted arguments,
Markus Armbruster <=
- [Qemu-devel] [PULL 5/5] monitor: fix oob command leak, Markus Armbruster, 2018/08/15
- [Qemu-devel] [PULL 4/5] tests: fix crumple/recursive leak, Markus Armbruster, 2018/08/15
- [Qemu-devel] [PULL 2/5] tests: change /0.15/* tests to /qmp/*, Markus Armbruster, 2018/08/15
- Re: [Qemu-devel] [PULL 0/5] Miscellaneous patches for 2018-08-15, Peter Maydell, 2018/08/15