From nobody Mon May 13 08:47:20 2024 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=1667471999; cv=none; d=zohomail.com; s=zohoarc; b=PXU9dcZfnr8lZ5ij1U2tHKqjxnqp+iuJhYCBnAo04IRwOH4NLYNZtAuvUFT8MJTcjXKlySRMaierH0pz3baRBQ4QJR6HpirASAANumP9zbQ+Wky4Vd/24INauouorRuT0/+wKCueEaqqTwDz/ni34OE6umJz2tAaEu71vSo0iMk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1667471999; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=iCA3TvzOpzGSwYUA21kDCPvpG/UnlIYQVfMFoKVgdOw=; b=exSbsZBoY+hNrptx+/iRm0slMPO57qqeB+RkK8yy2XINe6golAL4fNFgbZL5F1XUvZISzElvaSyvIirlqx6/c+rzXwxf5BQemuZxbloBb1WUDVWEFqASLHEAv/9HId6X+Cs1zb3oqGB9E9v/tsUU6fukgV3jyGrWS8ClG96ZroU= 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 1667471999205948.2905655896825; Thu, 3 Nov 2022 03:39:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oqXcl-0003rV-B0; Thu, 03 Nov 2022 06:39:03 -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 1oqXci-0003pE-Cr for qemu-devel@nongnu.org; Thu, 03 Nov 2022 06:39:00 -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 1oqXce-0005Op-7Y for qemu-devel@nongnu.org; Thu, 03 Nov 2022 06:39:00 -0400 Received: from myt5-70c90f7d6d7d.qloud-c.yandex.net (myt5-70c90f7d6d7d.qloud-c.yandex.net [IPv6:2a02:6b8:c12:3e2c:0:640:70c9:f7d]) by forwardcorp1c.mail.yandex.net (Yandex) with ESMTP id 550FD5E629; Thu, 3 Nov 2022 13:28:06 +0300 (MSK) Received: from davydov-max-nux.yandex-team.ru (unknown [2a02:6b8:b081:b685::1:2c]) by myt5-70c90f7d6d7d.qloud-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id 3zS6WKEiGd-S5NGt5YN; Thu, 03 Nov 2022 13:28:05 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1667471285; bh=iCA3TvzOpzGSwYUA21kDCPvpG/UnlIYQVfMFoKVgdOw=; h=Message-Id:Date:In-Reply-To:Cc:Subject:References:To:From; b=f3wHXlSUMfDIuokH1uu0lJdnooHtpXg5BBpI9k8O+/TKSk7d3voL/Urz+3K2yqa6p ubxV+8/H7u2ewEcchK+xHeQ6Ow8PNj4Vvsl0NaAN5do7S+da5K+BN+5zMp33lBQnBd dy0qo67A68ILCQSS97lX7pvwiqK0FmrA3t4EL9VA= Authentication-Results: myt5-70c90f7d6d7d.qloud-c.yandex.net; dkim=pass header.i=@yandex-team.ru From: Maksim Davydov To: qemu-devel@nongnu.org Cc: davydov-max@yandex-team.ru, vsementsov@yandex-team.ru, eduardo@habkost.net, marcel.apfelbaum@gmail.com, philmd@linaro.org, wangyanan55@huawei.com, jsnow@redhat.com, crosa@redhat.com, bleal@redhat.com, eblake@redhat.com, armbru@redhat.com, pbonzini@redhat.com, berrange@redhat.com, alxndr@bu.edu, bsd@redhat.com, stefanha@redhat.com, thuth@redhat.com, darren.kenny@oracle.com, Qiuhao.Li@outlook.com, lvivier@redhat.com Subject: [PATCH v3 1/4] qom: add default value Date: Thu, 3 Nov 2022 13:27:37 +0300 Message-Id: <20221103102741.11201-2-davydov-max@yandex-team.ru> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221103102741.11201-1-davydov-max@yandex-team.ru> References: <20221103102741.11201-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.200; envelope-from=davydov-max@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, 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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @yandex-team.ru) X-ZM-MESSAGEID: 1667472000435100001 Content-Type: text/plain; charset="utf-8" qmp_qom_list_properties can print default values if they are available as qmp_device_list_properties does, because both of them use the ObjectPropertyInfo structure with default_value field. This can be useful when working with "not device" types. Signed-off-by: Maksim Davydov Reviewed-by: Vladimir Sementsov-Ogievskiy --- qom/qom-qmp-cmds.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qom/qom-qmp-cmds.c b/qom/qom-qmp-cmds.c index 2e63a4c184..1d7867dc19 100644 --- a/qom/qom-qmp-cmds.c +++ b/qom/qom-qmp-cmds.c @@ -217,6 +217,8 @@ ObjectPropertyInfoList *qmp_qom_list_properties(const c= har *typename, info->type =3D g_strdup(prop->type); info->has_description =3D !!prop->description; info->description =3D g_strdup(prop->description); + info->default_value =3D qobject_ref(prop->defval); + info->has_default_value =3D !!info->default_value; =20 QAPI_LIST_PREPEND(prop_list, info); } --=20 2.25.1 From nobody Mon May 13 08:47:20 2024 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=1667471975; cv=none; d=zohomail.com; s=zohoarc; b=E8JVmIH473/MGGDhzYZoVf2axwaugzF7tb6t1PxlcXlg/fwq7U8wirLfTwmsl1LouuKOF1ctIyQFQyBYvZpjk1zJhbGN5lVvbGzXMtAHXVlwsRjmznCi2V1TqGxdhL5ZVt6/yvO6366EDmJxECnfcpOgCblh0d0a0NMwNjEQqFc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1667471975; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=OYeiWRd2PeTtBWfHgsi6/ymkA79L1SXo5pYvkeFy1nw=; b=TGFhKH8VYBsP0FnA/XuFw9y40Ompp2ukFjyHV7AQd0HyVWQglmGUcUHErBMDhLud89Lt/90aM7KNxQRGDWVwLc3h3p21K4gmYtwX3JY8cci2bc9LIBQWSKND0DVzL1dwOjnC/I/HkUMVn3smMziwYopWd/nwHdMWAuofuRGBCyk= 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 1667471975044679.0149423040763; Thu, 3 Nov 2022 03:39:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oqXck-0003qW-Ej; Thu, 03 Nov 2022 06:39:02 -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 1oqXci-0003pG-CO for qemu-devel@nongnu.org; Thu, 03 Nov 2022 06:39:00 -0400 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 1oqXce-0005P0-HY for qemu-devel@nongnu.org; Thu, 03 Nov 2022 06:39:00 -0400 Received: from myt5-70c90f7d6d7d.qloud-c.yandex.net (myt5-70c90f7d6d7d.qloud-c.yandex.net [IPv6:2a02:6b8:c12:3e2c:0:640:70c9:f7d]) by forwardcorp1b.mail.yandex.net (Yandex) with ESMTP id 9EE185FF72; Thu, 3 Nov 2022 13:28:08 +0300 (MSK) Received: from davydov-max-nux.yandex-team.ru (unknown [2a02:6b8:b081:b685::1:2c]) by myt5-70c90f7d6d7d.qloud-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id 3zS6WKEiGd-S7NGGaE8; Thu, 03 Nov 2022 13:28:07 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1667471288; bh=OYeiWRd2PeTtBWfHgsi6/ymkA79L1SXo5pYvkeFy1nw=; h=Message-Id:Date:In-Reply-To:Cc:Subject:References:To:From; b=A3cWCN2Wst1VB1vL3qGwhLa3EZx7UqA3N/cLVNyO8XoBIXEbBOnOJmw6Xx5OmRS7B TqZcpreznBwecgPfwDz8BobuJZ9EjX8wuHe4GfLkyRcvtcXzvPkn+MUVDg2W9q/nze wCZ2hvOxn/a+V7n1As8xIwsFBoN5bbrbfWqL4GqQ= Authentication-Results: myt5-70c90f7d6d7d.qloud-c.yandex.net; dkim=pass header.i=@yandex-team.ru From: Maksim Davydov To: qemu-devel@nongnu.org Cc: davydov-max@yandex-team.ru, vsementsov@yandex-team.ru, eduardo@habkost.net, marcel.apfelbaum@gmail.com, philmd@linaro.org, wangyanan55@huawei.com, jsnow@redhat.com, crosa@redhat.com, bleal@redhat.com, eblake@redhat.com, armbru@redhat.com, pbonzini@redhat.com, berrange@redhat.com, alxndr@bu.edu, bsd@redhat.com, stefanha@redhat.com, thuth@redhat.com, darren.kenny@oracle.com, Qiuhao.Li@outlook.com, lvivier@redhat.com Subject: [PATCH v3 2/4] python/qmp: increase read buffer size Date: Thu, 3 Nov 2022 13:27:38 +0300 Message-Id: <20221103102741.11201-3-davydov-max@yandex-team.ru> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221103102741.11201-1-davydov-max@yandex-team.ru> References: <20221103102741.11201-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, 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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @yandex-team.ru) X-ZM-MESSAGEID: 1667471976102100001 Content-Type: text/plain; charset="utf-8" After modification of "query-machines" command the buffer size should be more than 452kB to contain output with compat-props. Signed-off-by: Maksim Davydov Reviewed-by: Vladimir Sementsov-Ogievskiy --- python/qemu/qmp/qmp_client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/qemu/qmp/qmp_client.py b/python/qemu/qmp/qmp_client.py index 5dcda04a75..659fe4d98c 100644 --- a/python/qemu/qmp/qmp_client.py +++ b/python/qemu/qmp/qmp_client.py @@ -197,8 +197,8 @@ async def run(self, address=3D'/tmp/qemu.socket'): #: Logger object used for debugging messages. logger =3D logging.getLogger(__name__) =20 - # Read buffer limit; large enough to accept query-qmp-schema - _limit =3D (256 * 1024) + # Read buffer limit; large enough to accept query-machines + _limit =3D (512 * 1024) =20 # Type alias for pending execute() result items _PendingT =3D Union[Message, ExecInterruptedError] --=20 2.25.1 From nobody Mon May 13 08:47:20 2024 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=1667471993; cv=none; d=zohomail.com; s=zohoarc; b=By04NUizqcMLaM4kJxmMDd8FPvOt4WNFX+nMzF2eSQd4KpWhaRGd0CKg52cRzBUIiy+5lHzJ0rSF0xcWCZh6vBlwv1b8lkSU6t6fplz+kn8Z8HhvgQnnFDifjo9KyR3ebFhHy+TOLoVDKEGygQrB8KeQBVFdM5dJDRdYo1CiQAw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1667471993; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=er7XAOF1viGrXb9aBN/JKB3o6LVoAcS1Kk9+43oujYI=; b=Bn+GQP67HyIXK/6PAxUnKhptWueEikXL1sZuxT3Z+QqJNPSRhD2dwNzeuVh/AbJUOjutM05Xib5dE3L67zXiFXkhiWdWZ8rvnXRgia4xzP/wGoCVx+m2O/QC5kNkjh/NCit9gJMYdaQikZfEH8xcYo9t+KvQn5z7GpDVw+Bm8UU= 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 1667471993203346.1972442228613; Thu, 3 Nov 2022 03:39:53 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oqXcp-0003tb-6u; Thu, 03 Nov 2022 06:39:07 -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 1oqXcn-0003sb-Kc for qemu-devel@nongnu.org; Thu, 03 Nov 2022 06:39:05 -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 1oqXcd-0005On-W8 for qemu-devel@nongnu.org; Thu, 03 Nov 2022 06:39:05 -0400 Received: from myt5-70c90f7d6d7d.qloud-c.yandex.net (myt5-70c90f7d6d7d.qloud-c.yandex.net [IPv6:2a02:6b8:c12:3e2c:0:640:70c9:f7d]) by forwardcorp1c.mail.yandex.net (Yandex) with ESMTP id 2237F5F1BD; Thu, 3 Nov 2022 13:28:11 +0300 (MSK) Received: from davydov-max-nux.yandex-team.ru (unknown [2a02:6b8:b081:b685::1:2c]) by myt5-70c90f7d6d7d.qloud-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id 3zS6WKEiGd-S9NGTCqu; Thu, 03 Nov 2022 13:28:10 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1667471290; bh=er7XAOF1viGrXb9aBN/JKB3o6LVoAcS1Kk9+43oujYI=; h=Message-Id:Date:In-Reply-To:Cc:Subject:References:To:From; b=RQSGR3eygSkUGs604WanEFYKGUvflru43yEKEzr6RJKLtrN349y+pr6XxUpJ0HxXB mCcFtQ1tK2Y2esBNtoBgSnRQ/N0JaVBeygjvw0KP7htrdhWCig+tEvhWforYCEr6zV Lk+1OXux5+D8FUk8E6PPxb6hZH3BkDyPAGWVzicQ= Authentication-Results: myt5-70c90f7d6d7d.qloud-c.yandex.net; dkim=pass header.i=@yandex-team.ru From: Maksim Davydov To: qemu-devel@nongnu.org Cc: davydov-max@yandex-team.ru, vsementsov@yandex-team.ru, eduardo@habkost.net, marcel.apfelbaum@gmail.com, philmd@linaro.org, wangyanan55@huawei.com, jsnow@redhat.com, crosa@redhat.com, bleal@redhat.com, eblake@redhat.com, armbru@redhat.com, pbonzini@redhat.com, berrange@redhat.com, alxndr@bu.edu, bsd@redhat.com, stefanha@redhat.com, thuth@redhat.com, darren.kenny@oracle.com, Qiuhao.Li@outlook.com, lvivier@redhat.com Subject: [PATCH v3 3/4] qmp: add dump machine type compatible properties Date: Thu, 3 Nov 2022 13:27:39 +0300 Message-Id: <20221103102741.11201-4-davydov-max@yandex-team.ru> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221103102741.11201-1-davydov-max@yandex-team.ru> References: <20221103102741.11201-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.200; envelope-from=davydov-max@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, 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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @yandex-team.ru) X-ZM-MESSAGEID: 1667471994602100005 Content-Type: text/plain; charset="utf-8" To control that creating new machine type doesn't affect the previous types (their compat_props) and to check complex compat_props inheritance we need qmp command to print machine type compatible properties. This patch adds the ability to get list of all the compat_props of the corresponding supported machines for their comparison via new optional argument of "query-machines" command. Signed-off-by: Maksim Davydov Reviewed-by: Vladimir Sementsov-Ogievskiy --- hw/core/machine-qmp-cmds.c | 22 ++++++++++++++- qapi/machine.json | 54 +++++++++++++++++++++++++++++++++++-- tests/qtest/fuzz/qos_fuzz.c | 2 +- 3 files changed, 74 insertions(+), 4 deletions(-) diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c index 4f4ab30f8c..a6fc387439 100644 --- a/hw/core/machine-qmp-cmds.c +++ b/hw/core/machine-qmp-cmds.c @@ -74,7 +74,8 @@ CpuInfoFastList *qmp_query_cpus_fast(Error **errp) return head; } =20 -MachineInfoList *qmp_query_machines(Error **errp) +MachineInfoList *qmp_query_machines(bool has_compat_props, bool compat_pro= ps, + Error **errp) { GSList *el, *machines =3D object_class_get_list(TYPE_MACHINE, false); MachineInfoList *mach_list =3D NULL; @@ -107,6 +108,25 @@ MachineInfoList *qmp_query_machines(Error **errp) info->default_ram_id =3D g_strdup(mc->default_ram_id); info->has_default_ram_id =3D true; } + if (compat_props && mc->compat_props) { + int i; + info->compat_props =3D NULL; + CompatPropertyList **tail =3D &(info->compat_props); + info->has_compat_props =3D true; + + for (i =3D 0; i < mc->compat_props->len; i++) { + GlobalProperty *mt_prop =3D g_ptr_array_index(mc->compat_p= rops, + i); + CompatProperty *prop; + + prop =3D g_malloc0(sizeof(*prop)); + prop->driver =3D g_strdup(mt_prop->driver); + prop->property =3D g_strdup(mt_prop->property); + prop->value =3D g_strdup(mt_prop->value); + + QAPI_LIST_APPEND(tail, prop); + } + } =20 QAPI_LIST_PREPEND(mach_list, info); } diff --git a/qapi/machine.json b/qapi/machine.json index b9228a5e46..07d3b01358 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -127,6 +127,25 @@ ## { 'command': 'query-cpus-fast', 'returns': [ 'CpuInfoFast' ] } =20 +## +# @CompatProperty: +# +# Machine type compatible property. It's based on GlobalProperty and creat= ed +# for machine type compat properties (see scripts) +# +# @driver: name of the driver that has GlobalProperty +# +# @property: global property name +# +# @value: global property value +# +# Since: 7.2 +## +{ 'struct': 'CompatProperty', + 'data': { 'driver': 'str', + 'property': 'str', + 'value': 'str' } } + ## # @MachineInfo: # @@ -155,6 +174,9 @@ # # @default-ram-id: the default ID of initial RAM memory backend (since 5.2) # +# @compat-props: List of compatible properties that defines machine type +# (since 7.2) +# # Since: 1.2 ## { 'struct': 'MachineInfo', @@ -162,18 +184,46 @@ '*is-default': 'bool', 'cpu-max': 'int', 'hotpluggable-cpus': 'bool', 'numa-mem-supported': 'bool', 'deprecated': 'bool', '*default-cpu-type': 'str', - '*default-ram-id': 'str' } } + '*default-ram-id': 'str', '*compat-props': ['CompatProperty'] = } } =20 ## # @query-machines: # # Return a list of supported machines # +# @compat-props: if true return will contain information about machine type +# compatible properties (since 7.2) +# # Returns: a list of MachineInfo # # Since: 1.2 +# +# Example: +# +# -> { "execute": "query-machines", "arguments": { "compat-props": true } } +# <- { "return": [ +# { +# "hotpluggable-cpus": true, +# "name": "pc-q35-6.2", +# "compat-props": [ +# { +# "driver": "virtio-mem", +# "property": "unplugged-inaccessible", +# "value": "off" +# } +# ], +# "numa-mem-supported": false, +# "default-cpu-type": "qemu64-x86_64-cpu", +# "cpu-max": 288, +# "deprecated": false, +# "default-ram-id": "pc.ram" +# }, +# ... +# } ## -{ 'command': 'query-machines', 'returns': ['MachineInfo'] } +{ 'command': 'query-machines', + 'data': { '*compat-props': 'bool' }, + 'returns': ['MachineInfo'] } =20 ## # @CurrentMachineParams: diff --git a/tests/qtest/fuzz/qos_fuzz.c b/tests/qtest/fuzz/qos_fuzz.c index 3a3d9c16dd..9420f950fd 100644 --- a/tests/qtest/fuzz/qos_fuzz.c +++ b/tests/qtest/fuzz/qos_fuzz.c @@ -46,7 +46,7 @@ static void qos_set_machines_devices_available(void) MachineInfoList *mach_info; ObjectTypeInfoList *type_info; =20 - mach_info =3D qmp_query_machines(&error_abort); + mach_info =3D qmp_query_machines(false, false, &error_abort); machines_apply_to_node(mach_info); qapi_free_MachineInfoList(mach_info); =20 --=20 2.25.1 From nobody Mon May 13 08:47:20 2024 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=1667471992; cv=none; d=zohomail.com; s=zohoarc; b=hc4yWSkiBWOTx43Z4nJuApe2pXGm4ECmQwkzXwUu6pd4RcI3YQZas0haCq1kEhc8NcDhGs/ESelHAgRYSvYGkAlXjS4mPCQyVAwWg5Sfv0pYTJZJIif3c/3+/SYSUo8lhuySPBv6jUIleuT6UeEj8VF6HYt8GeRNzEXKISk7SRc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1667471992; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=zTYKplbsefH5RrdlEaZUIQ/+SCEfYmAnPEkCvaDk6Bs=; b=YrBSnwVl8bv1tgDw8TaO5203b8NJ6dGg1IN8Ie0/FCA11uOK1CtsvLjSU5LpanKMaVne9OocC7yarixjk5PlHwV8UZC2R9AZwW7iiih6DxgzIDZDeWReEer9mAvDwZq7Y4bL/eNE1jhsWmIB0vgOiGP42bNB4gIl7gT4/z7xyDc= 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 1667471992959547.9748719630046; Thu, 3 Nov 2022 03:39:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oqXcj-0003qG-GB; Thu, 03 Nov 2022 06:39:01 -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 1oqXch-0003oX-A9 for qemu-devel@nongnu.org; Thu, 03 Nov 2022 06:38:59 -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 1oqXcd-0005Os-MS for qemu-devel@nongnu.org; Thu, 03 Nov 2022 06:38:58 -0400 Received: from myt5-70c90f7d6d7d.qloud-c.yandex.net (myt5-70c90f7d6d7d.qloud-c.yandex.net [IPv6:2a02:6b8:c12:3e2c:0:640:70c9:f7d]) by forwardcorp1c.mail.yandex.net (Yandex) with ESMTP id 2874A5E714; Thu, 3 Nov 2022 13:28:14 +0300 (MSK) Received: from davydov-max-nux.yandex-team.ru (unknown [2a02:6b8:b081:b685::1:2c]) by myt5-70c90f7d6d7d.qloud-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id 3zS6WKEiGd-SBNGvdUO; Thu, 03 Nov 2022 13:28:12 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1667471292; bh=zTYKplbsefH5RrdlEaZUIQ/+SCEfYmAnPEkCvaDk6Bs=; h=Cc:Message-Id:References:Date:In-Reply-To:Subject:To:From; b=tcK5ShP2B6PwbAjZJP53KzVUeKCeJ2yRYsrrQTiU7kuF29jQGaYdhXafh9sqQRNc6 uKOMWQZPsPCahKwwQCha/n8lKRuzd6ih5DkbCM4iC0la0W9nMMMTNVXye1BKANYODr 1IELROnObEbberSoNy8lYaDtwJonBSoEbKc22BDU= Authentication-Results: myt5-70c90f7d6d7d.qloud-c.yandex.net; dkim=pass header.i=@yandex-team.ru From: Maksim Davydov To: qemu-devel@nongnu.org Cc: davydov-max@yandex-team.ru, vsementsov@yandex-team.ru, eduardo@habkost.net, marcel.apfelbaum@gmail.com, philmd@linaro.org, wangyanan55@huawei.com, jsnow@redhat.com, crosa@redhat.com, bleal@redhat.com, eblake@redhat.com, armbru@redhat.com, pbonzini@redhat.com, berrange@redhat.com, alxndr@bu.edu, bsd@redhat.com, stefanha@redhat.com, thuth@redhat.com, darren.kenny@oracle.com, Qiuhao.Li@outlook.com, lvivier@redhat.com Subject: [PATCH v3 4/4] scripts: add script to compare compatible properties Date: Thu, 3 Nov 2022 13:27:40 +0300 Message-Id: <20221103102741.11201-5-davydov-max@yandex-team.ru> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221103102741.11201-1-davydov-max@yandex-team.ru> References: <20221103102741.11201-1-davydov-max@yandex-team.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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.200; envelope-from=davydov-max@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, 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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @yandex-team.ru) X-ZM-MESSAGEID: 1667471994667100007 This script run QEMU to obtain compat_props of machines and default values of different types and produce appropriate table. This table can be used to compare machine types to choose the most suitable machine. Also this table in json or csv format should be used to check that new machine doesn't affect previous ones by comparing tables with and without new machine. Default values of properties are needed to fill "holes" in the table (one machine has these properties and another not. For instance, 2.12 mt has `{ "EPYC-" TYPE_X86_CPU, "xlevel", "0x8000000a" }`, but compat_pros of 3.1 mt doesn't have it. So, to compare these machines we need to fill unknown value of "EPYC-x86_64-cpu-xlevel" for 3.1 mt. This unknown value in the table I called "hole". To get values (default values) for these "holes" the script uses list of appropriate methods.) Notes: * some init values from the devices can't be available like properties from virtio-9p when configure has --disable-virtfs. This situations will be seen in the table as "unavailable driver". * Default values can be obtained in an unobvious way, like x86 features. If the script doesn't know how to get property default value to compare one machine with another it fills "holes" with "unavailable method". This is done because script uses whitelist model to get default values of different types. It means that the method that can't be applied to a new type that can crash this script. It is better to get an "unavailable driver" when creating a new machine with new compatible properties than to break this script. So it turns out a more stable and generic script. * If the default value can't be obtained because this property doesn't exist or because this property can't have default value, appropriate "hole" will be filled by "unknown property" or "no default value" * If the property is applied to the abstract class, the script collects default values from all child classes (set of default values) Example: ./scripts/compare_mt.py --mt pc-q35-3.1 pc-q35-4.0 =E2=95=92=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2= =95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95= =90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90= =E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2= =95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95= =90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90= =E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2= =95=90=E2=95=90=E2=95=A4=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95= =90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90= =E2=95=A4=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2= =95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95= =90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=95 =E2=94=82 =E2=94= =82 pc-q35-3.1 =E2=94=82 pc-q35-4.0 =E2=94=82 =E2=95=9E=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2= =95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95= =90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90= =E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2= =95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95= =90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90= =E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2= =95=90=E2=95=90=E2=95=AA=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95= =90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90= =E2=95=AA=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2= =95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95= =90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=A1 =E2=94=82 Cascadelake-Server-x86_64-cpu:mpx =E2=94= =82 True =E2=94=82 False =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=A4 =E2=94=82 Cascadelake-Server-x86_64-cpu:stepping =E2=94= =82 5 =E2=94=82 6 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=A4 =E2=94=82 Icelake-Client-x86_64-cpu:mpx =E2=94= =82 True =E2=94=82 unavailable driver =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=A4 =E2=94=82 Icelake-Server-x86_64-cpu:mpx =E2=94= =82 True =E2=94=82 False =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=A4 =E2=94=82 Opteron_G3-x86_64-cpu:rdtscp =E2=94= =82 False =E2=94=82 True =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=A4 =E2=94=82 Opteron_G4-x86_64-cpu:rdtscp =E2=94= =82 False =E2=94=82 True =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=A4 =E2=94=82 Opteron_G5-x86_64-cpu:rdtscp =E2=94= =82 False =E2=94=82 True =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=A4 =E2=94=82 Skylake-Client-IBRS-x86_64-cpu:mpx =E2=94= =82 True =E2=94=82 False =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=A4 =E2=94=82 Skylake-Client-x86_64-cpu:mpx =E2=94= =82 True =E2=94=82 False =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=A4 =E2=94=82 Skylake-Server-IBRS-x86_64-cpu:mpx =E2=94= =82 True =E2=94=82 False =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=A4 =E2=94=82 Skylake-Server-x86_64-cpu:mpx =E2=94= =82 True =E2=94=82 False =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=A4 =E2=94=82 intel-iommu:dma-drain =E2=94= =82 False =E2=94=82 True =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=A4 =E2=94=82 memory-backend-file:x-use-canonical-path-for-ramblock-id =E2=94= =82 True =E2=94=82 no default value =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=A4 =E2=94=82 memory-backend-memfd:x-use-canonical-path-for-ramblock-id =E2=94= =82 True =E2=94=82 no default value =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=A4 =E2=94=82 pcie-root-port:x-speed =E2=94= =82 2_5 =E2=94=82 16 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=A4 =E2=94=82 pcie-root-port:x-width =E2=94= =82 1 =E2=94=82 32 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=A4 =E2=94=82 pcie-root-port-base:disable-acs =E2=94= =82 True =E2=94=82 False =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=A4 =E2=94=82 tpm-crb:ppi =E2=94= =82 False =E2=94=82 True =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=A4 =E2=94=82 tpm-tis:ppi =E2=94= =82 False =E2=94=82 True =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=A4 =E2=94=82 usb-kbd:serial =E2=94= =82 42 =E2=94=82 no default value =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=A4 =E2=94=82 usb-mouse:serial =E2=94= =82 42 =E2=94=82 no default value =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=A4 =E2=94=82 usb-tablet:serial =E2=94= =82 42 =E2=94=82 no default value =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=A4 =E2=94=82 virtio-balloon-device:qemu-4-0-config-size =E2=94= =82 False =E2=94=82 True =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=A4 =E2=94=82 virtio-blk-device:discard =E2=94= =82 False =E2=94=82 True =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=A4 =E2=94=82 virtio-blk-device:write-zeroes =E2=94= =82 False =E2=94=82 True =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=A4 =E2=94=82 x86_64-cpu:x-intel-pt-auto-level =E2=94= =82 False =E2=94=82 True =E2=94=82 =E2=95=98=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2= =95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95= =90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90= =E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2= =95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95= =90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90= =E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2= =95=90=E2=95=90=E2=95=A7=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95= =90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90= =E2=95=A7=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2= =95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95= =90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=9B Signed-off-by: Maksim Davydov --- scripts/compare_mt.py | 440 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 440 insertions(+) create mode 100755 scripts/compare_mt.py diff --git a/scripts/compare_mt.py b/scripts/compare_mt.py new file mode 100755 index 0000000000..31ac86dddd --- /dev/null +++ b/scripts/compare_mt.py @@ -0,0 +1,440 @@ +#!/usr/bin/env python3 +# +# Script to compare machine type compatible properties (include/hw/boards.= h). +# compat_props are applied to the driver during initialization to change +# default values, for instance, to maintain compatibility. +# This script constructs table with machines and values of their compat_pr= ops +# to compare and to find places for improvements or places with bugs. If +# during the comparision, some machine type doesn't have a property (it is= in +# the comparision table because another machine type has it), then the +# appropriate method will be used to obtain the default value of this driv= er +# property via qmp command (e.g. query-cpu-model-expansion for x86_64-cpu). +# These methods are defined below in qemu_propery_methods. +# +# Copyright (c) Yandex Technologies LLC, 2022 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . + +from tabulate import tabulate +import sys +from os import path +from argparse import ArgumentParser, RawTextHelpFormatter, Namespace +import pandas as pd +from typing import Callable, List, Dict, Set, Generator, Tuple, Union, Any + +try: + qemu_dir =3D path.abspath(path.dirname(path.dirname(__file__))) + sys.path.append(path.join(qemu_dir, 'python')) + from qemu.machine import QEMUMachine +except ModuleNotFoundError as exc: + print(f"Module '{exc.name}' not found.") + print("Try export PYTHONPATH=3Dtop-qemu-dir/python or run from top-qem= u-dir") + sys.exit(1) + + +default_cmd_line =3D 'build/qemu-system-x86_64 -enable-kvm -machine none' + + +# Methods to get right values of drivers props +# +# Use these methods as a 'whitelist' and add entries only if necessary. It= 's +# important to be stable and predictable in analysis and tests. +# Be careful: +# * Names should be in qom-list-types format (486-x86_64-cpu, not 486) +# * Specialization always wins (from 'device' and 'x86_64-cpu', 'x86_64-cp= u' +# will be used for '486-x86_64-cpu') + +# It's default stub for all undefined in property_methods drivers because = all +# QEMU types are inherited from Object +def get_object_prop(vm: QEMUMachine, device: str, prop_name: str): + return 'Unavailable method' + + +def get_device_prop(vm: QEMUMachine, device: str, prop_name: str) -> str: + device_props =3D vm.command('device-list-properties', typename=3Ddevic= e) + for prop in device_props: + if prop['name'] =3D=3D prop_name: + return str(prop.get('default-value', 'No default value')) + + return 'Unknown property' + + +def get_x86_64_cpu_prop(vm: QEMUMachine, device: str, prop_name: str) -> s= tr: + # crop last 11 chars '-x86_64-cpu' + props =3D vm.command('query-cpu-model-expansion', type=3D'full', + model=3D{'name': device[:-11]})['model']['props'] + return str(props.get(prop_name, 'Unknown property')) + + +# Now it's stub, because all memory_backend types don't have default values +# but this behaviour can be changed +def get_memory_backend_prop(vm: QEMUMachine, driver: str, + prop_name: str) -> str: + memory_backend_props =3D vm.command('qom-list-properties', typename=3D= driver) + for prop in memory_backend_props: + if prop['name'] =3D=3D prop_name: + return str(prop.get('default-value', 'No default value')) + + return 'Unknown property' + + +class GetPropMethod: + def __init__(self, driver_name: str, + method: Callable[[QEMUMachine, str, str], str]) -> None: + self.name =3D driver_name + self.get_prop =3D method + + +qemu_property_methods =3D [ + GetPropMethod('device', get_device_prop), + GetPropMethod('x86_64-cpu', get_x86_64_cpu_prop), + GetPropMethod('memory-backend', get_memory_backend_prop) +] + +# all types in QEMU are inherited from Object +qemu_default_method =3D GetPropMethod('object', get_object_prop) +# End of methods definition + + +class Driver: + def __init__(self, driver_defs: Dict, driver_name: str, parent_name: s= tr, + is_abstr: bool, list_of_children: List[str], + get_prop_method: GetPropMethod) -> None: + self.driver_defs =3D driver_defs + self.name =3D driver_name + self.parent =3D parent_name + self.abstract =3D is_abstr + self.children =3D list_of_children + self.method =3D get_prop_method + + + def is_parent(self, driver_name: str) -> bool: + if driver_name not in self.driver_defs: + return False + + cur_parent =3D self.parent + while cur_parent: + if driver_name =3D=3D cur_parent: + return True + cur_parent =3D self.driver_defs[cur_parent].parent + + return False + + + def set_prop_method(self, prop_method: GetPropMethod) -> None: + if prop_method.name !=3D self.name: + return + + self.method =3D prop_method + if not self.abstract: + return + + for child in self.children: + # specialization always wins + if self.is_parent(self.driver_defs[child].method.name): + self.driver_defs[child].method =3D prop_method + + +class DriverDefinitions: + def __init__(self, vm: QEMUMachine, default_method: GetPropMethod, + property_methods: List[GetPropMethod]) -> None: + self.driver_defs: Dict[str, Driver] =3D {} + self.default_method =3D default_method + self.property_methods =3D property_methods + self.vm =3D vm + + qom_all_types =3D vm.command('qom-list-types', abstract=3DTrue) + for obj_type in qom_all_types: + # parent of Object is None + parent =3D obj_type.get('parent', None) + abstr =3D obj_type.get('abstract', False) + name =3D obj_type['name'] + if abstr: + list_child_objs =3D vm.command('qom-list-types', implement= s=3Dname, + abstract=3DTrue) + child_list =3D [child['name'] for child in list_child_objs] + self.driver_defs[name] =3D Driver(self.driver_defs, name, = parent, + abstr, child_list, + default_method) + else: + self.driver_defs[name] =3D Driver(self.driver_defs, name, = parent, + abstr, [], default_method) + + for prop_method in property_methods: + # skipping other architectures and etc + if prop_method.name not in self.driver_defs: + continue + self.driver_defs[prop_method.name].set_prop_method(prop_method) + + + def add_prop_value(self, driver: str, prop: str, prop_list: list) -> N= one: + # wrong driver name or disabled in config driver + if driver not in self.driver_defs: + prop_list.append('Unavailable driver') + return + + if not self.driver_defs[driver].abstract: + prop_list.append(self.driver_defs[driver].method.get_prop(self= .vm, + driv= er, + prop= )) + return + + # if abstract we need to collect default values from all children + values =3D set() + for child in self.driver_defs[driver].children: + if self.driver_defs[child].abstract: + continue + + values.add(self.driver_defs[child].method.get_prop(self.vm, ch= ild, + prop)) + + prop_list.append(list(values)) + + +class Machine: + # raw_mt_dict - dict produced by `query-machines` + def __init__(self, raw_mt_dict: dict) -> None: + self.name =3D raw_mt_dict['name'] + self.compat_props: Dict[str, Dict[str, str]] =3D {} + # properties are applied sequentially and can rewrite values as in= QEMU + for prop in raw_mt_dict['compat-props']: + if prop['driver'] not in self.compat_props: + self.compat_props[prop['driver']] =3D {} + self.compat_props[prop['driver']][prop['property']] =3D prop['= value'] + + +script_desc=3D"""Script to compare machine types (their compat_props). + +If a property applies to an abstract class this script collects default \ +values of all child classes and prints them as a set. + +"Unavailable method" - means that this script doesn't know how to get \ +default values of the driver. To add method use the construction described= \ +at the top of the script. +"Unavailable driver" - means that this script doesn't know this driver. \ +For instance, this can happen if you configure QEMU without this device or= \ +if machine type definition has error. +"No default value" - means that the appropriate method can't get the defau= lt \ +value and most likely that this property doesn't have it. +"Unknown property" - means that the appropriate method can't find property= \ +with this name.""" + + +def parse_args() -> Namespace: + parser =3D ArgumentParser(formatter_class=3DRawTextHelpFormatter, + description=3Dscript_desc) + parser.add_argument('--format', choices=3D['human-readable', 'json', '= csv'], + default=3D'human-readable', + help=3D'returns table in json format') + parser.add_argument('--raw', action=3D'store_true', + help=3D'prints ALL defined properties without valu= e ' + 'transformation. By default, only properties ' + 'with different values will be printed and wi= th ' + 'value transformation(e.g. "on" -> True)') + parser.add_argument('--cmd-line', default=3Ddefault_cmd_line, + help=3D'command line to start qemu. ' + f'Default: "{default_cmd_line}"') + + mt_args_group =3D parser.add_mutually_exclusive_group() + mt_args_group.add_argument('--all', action=3D'store_true', + help=3D'prints all available machine types = (list ' + 'of machine types will be ignored). ' + 'Execution may take several minutes!') + mt_args_group.add_argument('--mt', nargs=3D"*", type=3Dstr, + help=3D'list of Machine Types ' + 'that will be compared') + + return parser.parse_args() + + +# return socket_name, major version, minor version, revision +def mt_comp(mt: Machine) -> Tuple[str, int, int, int]: + # none, microvm, x-remote and etc. + if '-' not in mt.name or '.' not in mt.name: + return mt.name, 0, 0, 0 + + socket, ver =3D mt.name.rsplit('-', 1) + ver_list =3D list(map(int, ver.split('.', 2))) + ver_list +=3D [0] * (3 - len(ver_list)) + return socket, ver_list[0], ver_list[1], ver_list[2] + + +# construct list of machine type definitions (primarily compat_props) from= QEMU +def get_mt_definitions(vm: QEMUMachine) -> List[Machine]: + raw_mt_defs =3D vm.command('query-machines', compat_props=3DTrue) + mt_defs: List[Machine] =3D [] + for raw_mt in raw_mt_defs: + mt_defs.append(Machine(raw_mt)) + + mt_defs.sort(key=3Dmt_comp) + return mt_defs + + +def get_req_mt(vm: QEMUMachine, args: Namespace) -> List[Machine]: + mt_defs =3D get_mt_definitions(vm) + if args.all: + return mt_defs + + list_mt =3D [mt.name for mt in mt_defs] + + if args.mt is None: + print('Enter machine types for comparision or use --help') + print('List of available machine types:') + print(*list_mt, sep=3D'\n') + sys.exit(1) + + for mt in args.mt: + if mt not in list_mt: + print('Wrong machine type name') + print('List of available machine types:') + print(*list_mt, sep=3D'\n') + sys.exit(1) + + requested_mt =3D [] + for mt in mt_defs: + if mt.name in args.mt: + requested_mt.append(mt) + + return requested_mt + + +# method to iterate through all requested properties in machine definitions +def get_req_props(mt_defs: list) -> Generator[Tuple[str, str], None, None]: + driver_props: Dict[str, Set[str]] =3D {} + for mt in mt_defs: + compat_props =3D mt.compat_props + for driver, prop in compat_props.items(): + if driver not in driver_props: + driver_props[driver] =3D set() + driver_props[driver].update(prop.keys()) + + for driver, props in sorted(driver_props.items()): + for prop in sorted(props): + yield driver, prop + + +def transform_value(value: str) -> Union[str, bool]: + true_list =3D ['true', 'on'] + false_list =3D ['false', 'off'] + + out =3D value.lower() + + if out in true_list: + return True + + if out in false_list: + return False + + return out + + +def transform_number(value: str) -> Union[int, None]: + try: + # C doesn't work with underscore ('2_5' !=3D 25) + if '_' in value: + raise ValueError + + return int(value, 0) + + except ValueError: + return None + + +# delete rows with the same values for all mt and transform values to make= it +# easier to compare +def transform_table(table: Dict, mt_names: List[str]) -> pd.DataFrame: + new_table: Dict[str, List] =3D {} + for full_prop_name, prop_values in table.items(): + new_row: List[Any] =3D [] + all_values =3D set() + # original number format if not all values are the same in the row + numeric_values =3D set() + for mt_prop_val in prop_values: + if type(mt_prop_val) is list: + transformed_val_list =3D list(map(transform_value, mt_prop= _val)) + if len(transformed_val_list) =3D=3D 1: + new_row.append(transformed_val_list[0]) + else: + new_row.append(transformed_val_list) + + numeric_values.update(set(map(transform_number, mt_prop_va= l))) + all_values.update(set(transformed_val_list)) + else: + transformed_val =3D transform_value(mt_prop_val) + new_row.append(transformed_val) + numeric_values.add(transform_number(mt_prop_val)) + all_values.add(transformed_val) + + if len(mt_names) > 1: + if len(all_values) =3D=3D 1: + continue + + if None not in numeric_values and len(numeric_values) =3D=3D 1: + continue + + new_table[full_prop_name] =3D new_row + + return pd.DataFrame.from_dict(new_table, orient=3D'index', columns=3Dm= t_names) + + +def fill_prop_table(mt_list: List[Machine], + qemu_drivers: DriverDefinitions, + is_raw: bool) -> pd.DataFrame: + table: Dict[str, List] =3D {} + for driver, prop in get_req_props(mt_list): + name =3D f'{driver}:{prop}' + table[name] =3D [] + for mt in mt_list: + if driver in mt.compat_props: + # values from QEMU machine type definitions + if prop in mt.compat_props[driver]: + table[name].append(mt.compat_props[driver][prop]) + continue + + # values from QEMU type definitions + qemu_drivers.add_prop_value(driver, prop, table[name]) + + headers =3D [mt.name for mt in mt_list] + + if is_raw: + return pd.DataFrame.from_dict(table, orient=3D'index', columns=3Dh= eaders) + + return transform_table(table, headers) + + +def print_table(table: pd.DataFrame, table_format: str) -> None: + if table_format =3D=3D 'json': + print(comp_table.to_json()) + elif table_format =3D=3D 'csv': + print(comp_table.to_csv()) + else: + print(tabulate(comp_table, showindex=3DTrue, stralign=3D'center', + colalign=3D('left',), tablefmt=3D'fancy_grid', + headers=3D'keys', disable_numparse=3DTrue)) + + +if __name__ =3D=3D '__main__': + args =3D parse_args() + qemu_arg_list =3D args.cmd_line.split(' ') + with QEMUMachine(binary=3Dqemu_arg_list[0], + qmp_timer=3D15, args=3Dqemu_arg_list[1:]) as vm: + vm.launch() + + req_mt =3D get_req_mt(vm, args) + qemu_drivers =3D DriverDefinitions(vm, qemu_default_method, + qemu_property_methods) + comp_table =3D fill_prop_table(req_mt, qemu_drivers, args.raw) + print_table(comp_table, args.format) + + vm.shutdown() --=20 2.25.1