summaryrefslogtreecommitdiffstats
path: root/QMP
diff options
context:
space:
mode:
authorIgor Mammedov <imammedo@redhat.com>2013-03-25 15:48:46 +0100
committerLuiz Capitulino <lcapitulino@redhat.com>2013-03-25 16:21:33 -0400
commite5ecec7bad7b679aa11ab788424bc0e1705be15b (patch)
tree6feafece3e0b27009226bf3c58a983c57cc0f563 /QMP
parent28c4fa32bd76268320d44db5d82e0d18fbc7c864 (diff)
downloadhqemu-e5ecec7bad7b679aa11ab788424bc0e1705be15b.zip
hqemu-e5ecec7bad7b679aa11ab788424bc0e1705be15b.tar.gz
qmp: fix handling of boolean values in qmp-shell
qmp-shell converts only integer arguments and the rest is assumed to be strings which are faithfully sent as quoted strings by json. But QEMU refuses to accept qmp command with boolean argument whose value is escaped as string. Fix it by special-casing true/false keywords and store value as corresponding boolean. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'QMP')
-rwxr-xr-xQMP/qmp-shell7
1 files changed, 6 insertions, 1 deletions
diff --git a/QMP/qmp-shell b/QMP/qmp-shell
index 24b665c..d126e63 100755
--- a/QMP/qmp-shell
+++ b/QMP/qmp-shell
@@ -101,7 +101,12 @@ class QMPShell(qmp.QEMUMonitorProtocol):
try:
value = int(opt[1])
except ValueError:
- value = opt[1]
+ if opt[1] == 'true':
+ value = True
+ elif opt[1] == 'false':
+ value = False
+ else:
+ value = opt[1]
qmpcmd['arguments'][opt[0]] = value
return qmpcmd
OpenPOWER on IntegriCloud