From nobody Tue May 7 17:41:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1493736172450618.9946953646105; Tue, 2 May 2017 07:42:52 -0700 (PDT) Received: from localhost ([::1]:59368 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d5Z0r-0004O0-2d for importer@patchew.org; Tue, 02 May 2017 10:42:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52240) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d5Z01-0003lg-Sc for qemu-devel@nongnu.org; Tue, 02 May 2017 10:41:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d5Yzx-00063k-SP for qemu-devel@nongnu.org; Tue, 02 May 2017 10:41:57 -0400 Received: from 5.mo5.mail-out.ovh.net ([87.98.173.103]:60223) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d5Yzx-00062f-LB for qemu-devel@nongnu.org; Tue, 02 May 2017 10:41:53 -0400 Received: from player786.ha.ovh.net (b6.ovh.net [213.186.33.56]) by mo5.mail-out.ovh.net (Postfix) with ESMTP id 03E49E9BE7 for ; Tue, 2 May 2017 16:41:51 +0200 (CEST) Received: from bahia.lan (gar31-1-82-66-74-139.fbx.proxad.net [82.66.74.139]) (Authenticated sender: groug@kaod.org) by player786.ha.ovh.net (Postfix) with ESMTPA id 9FF3B80084; Tue, 2 May 2017 16:41:49 +0200 (CEST) From: Greg Kurz To: qemu-devel@nongnu.org Date: Tue, 02 May 2017 16:41:43 +0200 Message-ID: <149373610338.5144.9635049015143453288.stgit@bahia.lan> User-Agent: StGit/0.17.1-20-gc0b1b-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Ovh-Tracer-Id: 11146127603796253065 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeeliedrheejgdeivdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 87.98.173.103 Subject: [Qemu-devel] [PATCH] scripts/qmp/qom-set: fix the value argument passed to srv.command() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 When invoking the script with -s, we end up passing a bogus value to QEMU: $ ./scripts/qmp/qom-set -s /var/tmp/qmp-sock-exp /machine.accel kvm {} $ ./scripts/qmp/qom-get -s /var/tmp/qmp-sock-exp /machine.accel /var/tmp/qmp-sock-exp This happens because sys.argv[2] isn't necessarily the command line argument that holds the value. It is sys.argv[4] when -s was also passed. Actually, the code already has a variable to handle that. This patch simply uses it. Signed-off-by: Greg Kurz Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- scripts/qmp/qom-set | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/qmp/qom-set b/scripts/qmp/qom-set index 54ecfecc531e..94e27789224c 100755 --- a/scripts/qmp/qom-set +++ b/scripts/qmp/qom-set @@ -61,4 +61,4 @@ else: srv =3D QEMUMonitorProtocol(socket_path) srv.connect() =20 -print srv.command('qom-set', path=3Dpath, property=3Dprop, value=3Dsys.arg= v[2]) +print srv.command('qom-set', path=3Dpath, property=3Dprop, value=3Dvalue)