qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 3/5] scripts: qmp-shell: allow single-quotes in JSON


From: John Snow
Subject: [Qemu-devel] [PATCH 3/5] scripts: qmp-shell: allow single-quotes in JSON expressions
Date: Tue, 21 Apr 2015 22:02:33 -0400

As a convenience for the user, replace any single quotes given
with double quotes so that the data will deserialize correctly
via json.loads().

Signed-off-by: John Snow <address@hidden>
---
 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 5347f89..d7cb33d 100755
--- a/scripts/qmp/qmp-shell
+++ b/scripts/qmp/qmp-shell
@@ -129,7 +129,7 @@ class QMPShell(qmp.QEMUMonitorProtocol):
 
             < command-name > [ arg-name1=arg1 ] ... [ arg-nameN=argN ]
         """
-        cmdargs = cmdline.split()
+        cmdargs = cmdline.replace("'", '"').split()
         qmpcmd = { 'execute': cmdargs[0], 'arguments': {} }
         self.__cli_expr(cmdargs[1:], qmpcmd['arguments'])
         return qmpcmd
-- 
2.1.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]