From: Igor Mammedov Date: Mon, 25 Mar 2013 14:48:46 +0000 (+0100) Subject: qmp: fix handling of boolean values in qmp-shell X-Git-Tag: v1.5.0-rc0~427^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e5ecec7bad7b679aa11ab788424bc0e1705be15b;p=thirdparty%2Fqemu.git 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 Signed-off-by: Luiz Capitulino --- diff --git a/QMP/qmp-shell b/QMP/qmp-shell index 24b665c8c02..d126e63ad19 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