From patchwork Thu Oct 5 13:55:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 1843928 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=yandex-team.ru header.i=@yandex-team.ru header.a=rsa-sha256 header.s=default header.b=0XGfLq35; 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 4S1Y6g4nKpz1yqD for ; Fri, 6 Oct 2023 00:58:03 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoOpw-00004v-So; Thu, 05 Oct 2023 09:56:21 -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 1qoOpq-0008VN-KZ; Thu, 05 Oct 2023 09:56:14 -0400 Received: from forwardcorp1c.mail.yandex.net ([178.154.239.200]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qoOpn-0001wS-OQ; Thu, 05 Oct 2023 09:56:14 -0400 Received: from mail-nwsmtp-smtp-corp-main-11.iva.yp-c.yandex.net (mail-nwsmtp-smtp-corp-main-11.iva.yp-c.yandex.net [IPv6:2a02:6b8:c0c:7d8a:0:640:8fc3:0]) by forwardcorp1c.mail.yandex.net (Yandex) with ESMTP id D8D5B5E9F7; Thu, 5 Oct 2023 16:56:08 +0300 (MSK) Received: from vsementsov-lin.. (unknown [2a02:6b8:b081:b584::1:2f]) by mail-nwsmtp-smtp-corp-main-11.iva.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id qtYmoW4Oi4Y0-pij37J2y; Thu, 05 Oct 2023 16:56:08 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1696514168; bh=IKeqSfH0nYTKbyo+3Gpwbo88G/FIpSjB1bLtuFBlPV4=; h=Message-Id:Date:In-Reply-To:Cc:Subject:References:To:From; b=0XGfLq35Sf5NkwCgmhaXYCFnG1j8zBEcQimsmHV4HkHxMfng+TX848AcMzRyAq/U9 Fbi34mHmUOqEOUm2hp0j9MTNyt2+USthgHqnYuS04PVq1mQgSKwSf7z6iAveVSNDQF 6Xxzx8nY8R/gIUTvSR+R9UDXZwvJM9QeWBj6c5O8= Authentication-Results: mail-nwsmtp-smtp-corp-main-11.iva.yp-c.yandex.net; dkim=pass header.i=@yandex-team.ru From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, vsementsov@yandex-team.ru, jsnow@redhat.com, crosa@redhat.com, kwolf@redhat.com, hreitz@redhat.com Subject: [PATCH v6 03/14] scripts/cpu-x86-uarch-abi.py: use .command() instead of .cmd() Date: Thu, 5 Oct 2023 16:55:39 +0300 Message-Id: <20231005135550.331657-4-vsementsov@yandex-team.ru> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231005135550.331657-1-vsementsov@yandex-team.ru> References: <20231005135550.331657-1-vsementsov@yandex-team.ru> MIME-Version: 1.0 Received-SPF: pass client-ip=178.154.239.200; envelope-from=vsementsov@yandex-team.ru; helo=forwardcorp1c.mail.yandex.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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 Here we don't expect a failure. In case on failure we'll crash on trying to access ['return']. Let's better use .command() that clearly raise on failure. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake --- scripts/cpu-x86-uarch-abi.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/cpu-x86-uarch-abi.py b/scripts/cpu-x86-uarch-abi.py index 82ff07582f..893afd1b35 100644 --- a/scripts/cpu-x86-uarch-abi.py +++ b/scripts/cpu-x86-uarch-abi.py @@ -69,7 +69,7 @@ shell = QEMUMonitorProtocol(sock) shell.connect() -models = shell.cmd("query-cpu-definitions") +models = shell.command("query-cpu-definitions") # These QMP props don't correspond to CPUID fatures # so ignore them @@ -85,7 +85,7 @@ names = [] -for model in models["return"]: +for model in models: if "alias-of" in model: continue names.append(model["name"]) @@ -93,12 +93,12 @@ models = {} for name in sorted(names): - cpu = shell.cmd("query-cpu-model-expansion", - { "type": "static", - "model": { "name": name }}) + cpu = shell.command("query-cpu-model-expansion", + { "type": "static", + "model": { "name": name }}) got = {} - for (feature, present) in cpu["return"]["model"]["props"].items(): + for (feature, present) in cpu["model"]["props"].items(): if present and feature not in skip: got[feature] = True