From: Luiz Capitulino <lcapitulino@redhat.com>
To: Igor Mammedov <imammedo@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] qmp: fix handling of boolean values in qmp-shell
Date: Mon, 25 Mar 2013 11:16:16 -0400 [thread overview]
Message-ID: <20130325111616.35ee0115@redhat.com> (raw)
In-Reply-To: <1364222926-31757-1-git-send-email-imammedo@redhat.com>
On Mon, 25 Mar 2013 15:48:46 +0100
Igor Mammedov <imammedo@redhat.com> wrote:
> 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>
Applied to the qmp branch, thanks.
> ---
> QMP/qmp-shell | 7 ++++++-
> 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
>
prev parent reply other threads:[~2013-03-25 15:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-25 14:48 [Qemu-devel] [PATCH] qmp: fix handling of boolean values in qmp-shell Igor Mammedov
2013-03-25 15:16 ` Luiz Capitulino [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130325111616.35ee0115@redhat.com \
--to=lcapitulino@redhat.com \
--cc=imammedo@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).