From nobody Tue Apr 7 11:34:43 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=yandex-team.ru ARC-Seal: i=1; a=rsa-sha256; t=1771604466; cv=none; d=zohomail.com; s=zohoarc; b=S1kRaFhoUe5uOXgCKO3SW+lgE6sy/fXcbg53bSvxtkLMk4lEtzJkSPKEavsXJY3AxsMNq0iC2/oYB5jiEQciNPDN/BTKduvc/cc/1hblsxcA2GkvfcTe/mQC/YnepzDlneqirX9XJQ+eHSIrm8a3Sy8kDwzeeERtt4q01IXMgQE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771604466; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=80ZLSdJEGOdmB3+Gx17c04s5VeF/wq+YcUTUX89iUTs=; b=YYd36hoKvQCiBx6Yj+718w5TUpwFoLnOC4NjdRDMSB4K6/Eqyly9UfKaVPniCtoOGt31TQb1vA1L/OCzobzbnxp7CS+dktJu4NJUZ1mG/Pb6s+TusmnMIFoqfYEPw8hShJuasQCe6NkNzUzpCokMOYJOAFAL8dR/THQAxu1QneI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1771604465997834.8743698182889; Fri, 20 Feb 2026 08:21:05 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vtTFH-0000NG-H5; Fri, 20 Feb 2026 11:20:47 -0500 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 1vtTFF-0000Mu-3W for qemu-devel@nongnu.org; Fri, 20 Feb 2026 11:20:45 -0500 Received: from forwardcorp1b.mail.yandex.net ([178.154.239.136]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vtTFD-000160-H5 for qemu-devel@nongnu.org; Fri, 20 Feb 2026 11:20:44 -0500 Received: from mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net (mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net [IPv6:2a02:6b8:c37:8aa5:0:640:e6ae:0]) by forwardcorp1b.mail.yandex.net (Yandex) with ESMTPS id 724498075A; Fri, 20 Feb 2026 19:20:40 +0300 (MSK) Received: from davydov-max-lin.yandex.net (unknown [2a02:6bf:8011:f00:b5ad:46f:80fc:2732]) by mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id vJfuXW4AvuQ0-BnJuEb6G; Fri, 20 Feb 2026 19:20:40 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1771604440; bh=80ZLSdJEGOdmB3+Gx17c04s5VeF/wq+YcUTUX89iUTs=; h=Message-Id:Date:In-Reply-To:Cc:Subject:References:To:From; b=iuTi2S5hD2FVt3kdheRNBQfvpq12doVWCTjHOKH1xHNocrHrHb6MuA5jqDGvgbAkb sME4HmqXM/sacfsPL1HAj274l7V6pyPCmrP4Wd6GYwLqAz+xmjF5j8se5aqsordfag fdg8yPz570vAgsOuda1i/Ut8d0khGcaxs0geiadE= Authentication-Results: mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net; dkim=pass header.i=@yandex-team.ru From: Maksim Davydov To: qemu-devel@nongnu.org Cc: crosa@redhat.com, jsnow@redhat.com, philmd@linaro.org, vsementsov@yandex-team.ru, davydov-max@yandex-team.ru Subject: [PATCH v2 1/2] scripts/compare-mt: add confidential computing getter Date: Fri, 20 Feb 2026 19:19:47 +0300 Message-Id: <20260220161948.213380-2-davydov-max@yandex-team.ru> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260220161948.213380-1-davydov-max@yandex-team.ru> References: <20260220161948.213380-1-davydov-max@yandex-team.ru> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=178.154.239.136; envelope-from=davydov-max@yandex-team.ru; helo=forwardcorp1b.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_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @yandex-team.ru) X-ZM-MESSAGEID: 1771604471440154100 Content-Type: text/plain; charset="utf-8" "sev-guest" option was added to the 9.0 machines. So, the script has to be able to get default values of properties of this type. Unfortunatelly, some default values are set during instance initialization but not during class initialization. Thus, they can't be easily accessed. Based on the above, "qom-list-properties" command was choosen for getting default values, but now it always returns nothing usefull. Maybe, in the future we will have a more appropriate command for "sev-guest". Signed-off-by: Maksim Davydov Reviewed-by: Vladimir Sementsov-Ogievskiy --- scripts/compare-machine-types.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/scripts/compare-machine-types.py b/scripts/compare-machine-typ= es.py index b4f899082a..96ee7e9ee6 100755 --- a/scripts/compare-machine-types.py +++ b/scripts/compare-machine-types.py @@ -154,6 +154,26 @@ def get_prop(self, driver: str, prop_name: str) -> str: return 'Unknown property' =20 =20 +# A stub to print default values of all types whose parent is +# 'confidential-guest-support'. Some properties have default values +# but can't be accessed without an instance initialization (e.g. +# "policy" of "sev-snp-guest"). +class QEMUConfidentialGuestSupport(QEMUObject): + def __init__(self, vm: QEMUMachine) -> None: + super().__init__(vm, 'confidential-guest-support') + self.cached: Dict[str, List[Dict[str, Any]]] =3D {} + + def get_prop(self, driver: str, prop_name: str) -> str: + if driver not in self.cached: + self.cached[driver] =3D self.vm.cmd('qom-list-properties', + typename=3Ddriver) + for prop in self.cached[driver]: + if prop['name'] =3D=3D prop_name: + return str(prop.get('default-value', 'No default value')) + + return 'Unknown property' + + def new_driver(vm: QEMUMachine, name: str, is_abstr: bool) -> Driver: if name =3D=3D 'object': return QEMUObject(vm, 'object') @@ -163,6 +183,8 @@ def new_driver(vm: QEMUMachine, name: str, is_abstr: bo= ol) -> Driver: return QEMUx86CPU(vm) elif name =3D=3D 'memory-backend': return QEMUMemoryBackend(vm) + elif name =3D=3D 'confidential-guest-support': + return QEMUConfidentialGuestSupport(vm) else: return Driver(vm, name, is_abstr) # End of methods definition --=20 2.34.1 From nobody Tue Apr 7 11:34:43 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=yandex-team.ru ARC-Seal: i=1; a=rsa-sha256; t=1771604470; cv=none; d=zohomail.com; s=zohoarc; b=KIsPzL/4ph/y2Mj4OH4jebH5VCivRpoJGvcLZ3o7abwG1NbYBJszxYnG6TRSYXJdKVo420Ma/g8/+kq6k43APvMbr1RP/Qw01Hb44KhONwKZQABHdkGTtjERx0z0YhhlTGJ9+uCRBDMmboACOiNiBbawFTOKA/od1Jp5ld4qAZk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771604470; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=rh39e7ox5gmtRN14OjKi5+QqX/5k2SEGor/ss5/Ybsc=; b=jVet0ldAcUiBqrP3URLdqpThQLZnwJ8dQReN+nTLevQv+MOB2xzURM1SqTIsM8XfnSHAjz7ZY32Vc+rh1JQmDHGe458b8zAkqHeuixcrF39yzi2mvqGJBKttw2K2NANAcei+adQdeOY2tpz3pcZi48fywLcziCZ7OcE35RdKOIk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1771604470084392.5744929633237; Fri, 20 Feb 2026 08:21:10 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vtTFP-0000PP-AQ; Fri, 20 Feb 2026 11:20:55 -0500 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 1vtTFO-0000P2-69 for qemu-devel@nongnu.org; Fri, 20 Feb 2026 11:20:54 -0500 Received: from forwardcorp1b.mail.yandex.net ([178.154.239.136]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vtTFM-00017J-CN for qemu-devel@nongnu.org; Fri, 20 Feb 2026 11:20:53 -0500 Received: from mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net (mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net [IPv6:2a02:6b8:c37:8aa5:0:640:e6ae:0]) by forwardcorp1b.mail.yandex.net (Yandex) with ESMTPS id 1A95980855; Fri, 20 Feb 2026 19:20:51 +0300 (MSK) Received: from davydov-max-lin.yandex.net (unknown [2a02:6bf:8011:f00:b5ad:46f:80fc:2732]) by mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id vJfuXW4AvuQ0-mKVhfrRv; Fri, 20 Feb 2026 19:20:50 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1771604450; bh=rh39e7ox5gmtRN14OjKi5+QqX/5k2SEGor/ss5/Ybsc=; h=Message-Id:Date:In-Reply-To:Cc:Subject:References:To:From; b=mnzthTfVjCi4Tx57MXK75Asd/fauKkcsBFzon85oZYoYTz/lXtLoa6DpVeTbWEU6p XBDbBWVtNj7psMR7ZqfyAHDh8jY5TebUBu+gEwk46Zdr+Rjc2QyQL+g1otNl8r+kaN dpo5MTDXAqQwadLsJMhEq66hjWIMPTGVRqiqlWLU= Authentication-Results: mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net; dkim=pass header.i=@yandex-team.ru From: Maksim Davydov To: qemu-devel@nongnu.org Cc: crosa@redhat.com, jsnow@redhat.com, philmd@linaro.org, vsementsov@yandex-team.ru, davydov-max@yandex-team.ru Subject: [PATCH v2 2/2] scripts/compare-mt: stop using global variables Date: Fri, 20 Feb 2026 19:19:48 +0300 Message-Id: <20260220161948.213380-3-davydov-max@yandex-team.ru> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260220161948.213380-1-davydov-max@yandex-team.ru> References: <20260220161948.213380-1-davydov-max@yandex-team.ru> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=178.154.239.136; envelope-from=davydov-max@yandex-team.ru; helo=forwardcorp1b.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_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @yandex-team.ru) X-ZM-MESSAGEID: 1771604474148158500 Content-Type: text/plain; charset="utf-8" All variables inside the main if-structure are global that can be confusing or be the reason of an issue. So, all code inside this structure was moved to the separate function to detect all usages of these global variables. All these usages were deleted. Also Configuration._qemu_args was removed as unused. Signed-off-by: Maksim Davydov Reviewed-by: Vladimir Sementsov-Ogievskiy --- scripts/compare-machine-types.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/scripts/compare-machine-types.py b/scripts/compare-machine-typ= es.py index 96ee7e9ee6..5dfaafef89 100755 --- a/scripts/compare-machine-types.py +++ b/scripts/compare-machine-types.py @@ -264,7 +264,6 @@ def __init__(self, vm: QEMUMachine, req_mt: List[str], all_mt: bool) -> None: self._vm =3D vm self._binary =3D vm.binary - self._qemu_args =3D args.qemu_args.split(' ') =20 self._qemu_drivers =3D VMPropertyGetter(vm) self.req_mt =3D get_req_mt(self._qemu_drivers, vm, req_mt, all_mt) @@ -482,17 +481,17 @@ def fill_prop_table(configs: List[Configuration], =20 def print_table(table: pd.DataFrame, table_format: str) -> None: if table_format =3D=3D 'json': - print(comp_table.to_json()) + print(table.to_json()) elif table_format =3D=3D 'csv': - print(comp_table.to_csv()) + print(table.to_csv()) else: - print(comp_table.to_markdown(index=3DFalse, stralign=3D'center', - colalign=3D('center',), headers=3D'ke= ys', - tablefmt=3D'fancy_grid', - disable_numparse=3DTrue)) + print(table.to_markdown(index=3DFalse, stralign=3D'center', + colalign=3D('center',), headers=3D'keys', + tablefmt=3D'fancy_grid', + disable_numparse=3DTrue)) =20 =20 -if __name__ =3D=3D '__main__': +def main() -> None: args =3D parse_args() with ExitStack() as stack: vms =3D [stack.enter_context(QEMUMachine(binary=3Dbinary, qmp_time= r=3D15, @@ -506,3 +505,7 @@ def print_table(table: pd.DataFrame, table_format: str)= -> None: comp_table =3D fill_prop_table(configurations, args.raw) if not comp_table.empty: print_table(comp_table, args.format) + + +if __name__ =3D=3D '__main__': + main() --=20 2.34.1