qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Wang Bing-hua <louiswpf@gmail.com>
To: qemu-devel@nongnu.org
Cc: Eduardo Habkost <eduardo@habkost.net>,
	John Snow <jsnow@redhat.com>, Wang Bing-hua <louiswpf@gmail.com>,
	Cleber Rosa <crosa@redhat.com>
Subject: [PATCH] python/qom: Fix qom-set failure
Date: Tue, 21 Dec 2021 01:44:18 +0800	[thread overview]
Message-ID: <20211220174418.84977-1-louiswpf@gmail.com> (raw)

Fix the following failure by interpreting 'value' argument as 'int'.

$ scripts/qmp/qom-set -s /tmp/qmp-socket /machine/unattached/device[6].temperature 0
QMPResponseError: Invalid parameter type for 'temperature', expected: integer

Fixes: c750c02891a8 ("python/qmp: Add qom script rewrites")
Signed-off-by: Wang Bing-hua <louiswpf@gmail.com>
---
 python/qemu/qmp/qom.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/python/qemu/qmp/qom.py b/python/qemu/qmp/qom.py
index 8ff28a8343..0b77dc6aa3 100644
--- a/python/qemu/qmp/qom.py
+++ b/python/qemu/qmp/qom.py
@@ -72,6 +72,7 @@ def configure_parser(cls, parser: argparse.ArgumentParser) -> None:
         cls.add_path_prop_arg(parser)
         parser.add_argument(
             'value',
+            type=int,
             metavar='<value>',
             action='store',
             help='new QOM property value'
-- 
2.34.1



             reply	other threads:[~2021-12-20 21:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-20 17:44 Wang Bing-hua [this message]
2022-01-10 20:16 ` [PATCH] python/qom: Fix qom-set failure John Snow
2022-01-18 16:20   ` Markus Armbruster

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=20211220174418.84977-1-louiswpf@gmail.com \
    --to=louiswpf@gmail.com \
    --cc=crosa@redhat.com \
    --cc=eduardo@habkost.net \
    --cc=jsnow@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).