From patchwork Wed Oct 18 10:00:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Zhao Liu X-Patchwork-Id: 1850785 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=eIsFy0+g; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S9VyC6qlPz20Pd for ; Wed, 18 Oct 2023 23:48:19 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qt5vp-0007Nq-8C; Wed, 18 Oct 2023 08:45:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qt3Bf-00068T-Nw for qemu-devel@nongnu.org; Wed, 18 Oct 2023 05:50:02 -0400 Received: from mgamail.intel.com ([134.134.136.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qt3BQ-0004Ob-Mo for qemu-devel@nongnu.org; Wed, 18 Oct 2023 05:49:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697622584; x=1729158584; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=rXT6Mlyo8nMUo+Xa/LhY3Ep4TFB4IYJ1y3RgX521rUk=; b=eIsFy0+g6TYkerDbTcxYfbuF0ecbGK2B4Dta7i0m8mx4XQa5cbd/lKzq fz7AH8QXH5lOzRxXKO81aVVr2jlF7bqIWg/43EpGsEgEodgj+moShaTmg xKE7dBySdvoHJDaZDAsOSH62DWiLqOXG1gjfpy2PCS6qJL3JB6vis9ODR qM2sIXncOrKz0qKkrovc1wvxwBkcJfpDeZS54SDAU7oax797fVVOXovtN a8rmXbjcRzgDq35RkfvOkNHX2MLqwT9Nl6oB4d6BFYlDHuyuaMSomGVMT 8mrORL86dPBK5AGvU4NJSAF145MYE9DQ5j/VJe4JEFaY3vu0DHlfeJSF3 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10866"; a="389855113" X-IronPort-AV: E=Sophos;i="6.03,234,1694761200"; d="scan'208";a="389855113" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Oct 2023 02:49:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10866"; a="760162781" X-IronPort-AV: E=Sophos;i="6.03,234,1694761200"; d="scan'208";a="760162781" Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.36]) by fmsmga007.fm.intel.com with ESMTP; 18 Oct 2023 02:49:35 -0700 From: Zhao Liu To: John Snow , Cleber Rosa , Vladimir Sementsov-Ogievskiy , qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= , Zhenyu Wang , Zhao Liu Subject: [PATCH] scripts/cpu-x86-uarch-abi.py: Fix parameter error of cmd Date: Wed, 18 Oct 2023 18:00:11 +0800 Message-Id: <20231018100011.685867-1-zhao1.liu@linux.intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Received-SPF: none client-ip=134.134.136.65; envelope-from=zhao1.liu@linux.intel.com; helo=mgamail.intel.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Wed, 18 Oct 2023 08:45:43 -0400 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Zhao Liu When run this script, there's the error: python3 scripts/cpu-x86-uarch-abi.py /tmp/qmp Traceback (most recent call last): File "/path-to-qemu/qemu/scripts/cpu-x86-uarch-abi.py", line 96, in cpu = shell.cmd("query-cpu-model-expansion", TypeError: QEMUMonitorProtocol.cmd() takes 2 positional arguments but 3 were given Commit 7f521b023bc28 ("scripts/cpu-x86-uarch-abi.py: use .command() instead of .cmd()") converts the the original .cmd() to .command() (which was later renamed to "cmd" to replace the original one). But the new .cmd() only accepts typing.Mapping as the parameter instead of typing.Dict (see _qmp.execute()). Change the paremeters of "query-cpu-model-expansion" to typing.Mapping format to fix this error. Fixes: 7f521b023bc28 ("scripts/cpu-x86-uarch-abi.py: use .command() instead of .cmd()") Signed-off-by: Zhao Liu Reviewed-by: Daniel P. Berrangé --- scripts/cpu-x86-uarch-abi.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/cpu-x86-uarch-abi.py b/scripts/cpu-x86-uarch-abi.py index f6baeeff2400..052ddd751424 100644 --- a/scripts/cpu-x86-uarch-abi.py +++ b/scripts/cpu-x86-uarch-abi.py @@ -94,8 +94,8 @@ for name in sorted(names): cpu = shell.cmd("query-cpu-model-expansion", - { "type": "static", - "model": { "name": name }}) + type="static", + model={ "name": name }) got = {} for (feature, present) in cpu["model"]["props"].items():