From nobody Mon Oct 27 11:15:48 2025 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=1761238848; cv=none; d=zohomail.com; s=zohoarc; b=HW3wlBxSpM4wsPaKlJLJ1vqq/hfec253C3uLBrxNHvnj6s1kYAxus0aFEfQBbUp8SEpQVrQr81UPxtqKzVAmVpmdRq8HQ3NSZaY2LDvvkX49lDqzkClqj4Q4CdGFeR3Xx7gSAVRiaIS0OJ02brgPG5CV8h2j1pfzyLMjU/qpWzs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761238848; 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=l3Q5Jn0/ip5OA9uVWgOE4Exn6LjYQnH+//1CKa2kqlE=; b=EpdBgSsBpb7zZ5TDIMI0mdyjp1KeFFIGuNw+kwJOegvXaDeKPPHLVOJ54v+bkWjCa6X/GoMjGt2NRyNzCUD+ATAqCEOqi5SiT97Lb7h9pt7+IcFfoaQDrQDc4mtdJRuIukdtujwFEkDUrIZptGooKicNQyn4Dk+LuPfwLsKBb9o= 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 1761238848046592.2274935607438; Thu, 23 Oct 2025 10:00:48 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vByfY-0004pv-La; Thu, 23 Oct 2025 13:00:08 -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 1vByfV-0004li-VF for qemu-devel@nongnu.org; Thu, 23 Oct 2025 13:00:05 -0400 Received: from forwardcorp1d.mail.yandex.net ([2a02:6b8:c41:1300:1:45:d181:df01]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vByfS-0005i0-Vt for qemu-devel@nongnu.org; Thu, 23 Oct 2025 13:00:05 -0400 Received: from mail-nwsmtp-smtp-corp-main-56.klg.yp-c.yandex.net (mail-nwsmtp-smtp-corp-main-56.klg.yp-c.yandex.net [IPv6:2a02:6b8:c42:65a0:0:640:e1de:0]) by forwardcorp1d.mail.yandex.net (Yandex) with ESMTPS id 84CAF80867; Thu, 23 Oct 2025 20:00:00 +0300 (MSK) Received: from davydov-max-lin.yandex.net (unknown [2a02:6bf:8011:f00:ef9:2188:6644:f7b6]) by mail-nwsmtp-smtp-corp-main-56.klg.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id 8xbwbU0ImGk0-sICMexIH; Thu, 23 Oct 2025 20:00:00 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1761238800; bh=l3Q5Jn0/ip5OA9uVWgOE4Exn6LjYQnH+//1CKa2kqlE=; h=Message-Id:Date:In-Reply-To:Cc:Subject:References:To:From; b=kbAD80WNEv9eKOjxB9s3Te/XkWq06H/4wEXIAwBlHvtPPbjg2+8DJ63kKCZpX2y5P 9R+N5Oumaefh2Q5jgz4n7hb7u5IAfmJw5mJGYfMXE17IpWlbZ+YDr8rl0tRasrpFbF 2ilMjiLtYeiIp33aRAT0JX4Ua11kSM1smATCVPKI= Authentication-Results: mail-nwsmtp-smtp-corp-main-56.klg.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, davydov-max@yandex-team.ru, philmd@linaro.org, vsementsov@yandex-team.ru Subject: [PATCH 1/2] scripts/compare-mt: add confidential computing getter Date: Thu, 23 Oct 2025 19:58:45 +0300 Message-Id: <20251023165846.326295-2-davydov-max@yandex-team.ru> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20251023165846.326295-1-davydov-max@yandex-team.ru> References: <20251023165846.326295-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=2a02:6b8:c41:1300:1:45:d181:df01; envelope-from=davydov-max@yandex-team.ru; helo=forwardcorp1d.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, 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+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: 1761238853117158500 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 2af3995eb8..dba9e03548 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 Mon Oct 27 11:15:48 2025 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=1761238850; cv=none; d=zohomail.com; s=zohoarc; b=eWt9ih3mqRy4iIpcApaeGcHTZl94p1B1Ik/Qk4eDFTl++nWNxk6zPRaMFig/t8cymfaBJ1dyoJiT6KHnIcTzszE49Ry0rRUZYmBF0y2aEPC5G/mYUklmpqiIE8tkVqj7Fs/OKeG2ySbZqNkkUL6cECzni4s7pD1iFpizYk9YVcI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761238850; 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=2jgKdiMkswKfHdeVn84I4j71Yy3RosUUcW+e/xTiSbM=; b=eHPhllMv7DutFZbs0VsBL02p8eAmg4kcIfBOyvH6bfWRGcr6wIn9Mr0k/s9JMqPc0a0J2dgwkLHqeWWZgNNIX/Lk3vRSqbpqCmH9lOqlnJr7FoJR8+Uwr2yx62K/3HhhveKKiMbhDnwpHCNbCk9P+0IW57nPFxq3PHOuLY+QHPM= 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 1761238850061425.1325044196427; Thu, 23 Oct 2025 10:00:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vByfZ-0004qR-Ma; Thu, 23 Oct 2025 13:00:09 -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 1vByfW-0004lk-0B for qemu-devel@nongnu.org; Thu, 23 Oct 2025 13:00:06 -0400 Received: from forwardcorp1d.mail.yandex.net ([2a02:6b8:c41:1300:1:45:d181:df01]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vByfS-0005iC-VZ for qemu-devel@nongnu.org; Thu, 23 Oct 2025 13:00:05 -0400 Received: from mail-nwsmtp-smtp-corp-main-56.klg.yp-c.yandex.net (mail-nwsmtp-smtp-corp-main-56.klg.yp-c.yandex.net [IPv6:2a02:6b8:c42:65a0:0:640:e1de:0]) by forwardcorp1d.mail.yandex.net (Yandex) with ESMTPS id 0A46F8086B; Thu, 23 Oct 2025 20:00:01 +0300 (MSK) Received: from davydov-max-lin.yandex.net (unknown [2a02:6bf:8011:f00:ef9:2188:6644:f7b6]) by mail-nwsmtp-smtp-corp-main-56.klg.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id 8xbwbU0ImGk0-Jw1D5jFi; Thu, 23 Oct 2025 20:00:00 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1761238800; bh=2jgKdiMkswKfHdeVn84I4j71Yy3RosUUcW+e/xTiSbM=; h=Message-Id:Date:In-Reply-To:Cc:Subject:References:To:From; b=B8rEgs22F3d80qr6IzsN6kFdJ2xrvE2/6GqPh7W8yukM5Fs5zBWAyIZ5F94vhJdvO yODavFL/+3UVlMcCxU1QNsL3NCwBAi12JhPlcm2X7G9ecidoNFq9/hWZQRzhjRF3sd tLEW/M76sLfOzHrNGePLBvWw4BQgo8uc4RiAlil8= Authentication-Results: mail-nwsmtp-smtp-corp-main-56.klg.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, davydov-max@yandex-team.ru, philmd@linaro.org, vsementsov@yandex-team.ru Subject: [PATCH 2/2] scripts/compare-mt: stop using global variables Date: Thu, 23 Oct 2025 19:58:46 +0300 Message-Id: <20251023165846.326295-3-davydov-max@yandex-team.ru> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20251023165846.326295-1-davydov-max@yandex-team.ru> References: <20251023165846.326295-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=2a02:6b8:c41:1300:1:45:d181:df01; envelope-from=davydov-max@yandex-team.ru; helo=forwardcorp1d.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, 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+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: 1761238853367158500 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. 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 dba9e03548..e6fcea22e1 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