From nobody Thu Apr 25 15:47:08 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=yandex-team.ru ARC-Seal: i=1; a=rsa-sha256; t=1673537398; cv=none; d=zohomail.com; s=zohoarc; b=h7AOGV5x0fzy0I1cp6CZhkFKHsRzPUueKNJKrVXQopBFYjj7qWtvRoMSDvsjsaYPns/PZ40mUUcoxhPB9C3h3nc3Gu6T+MIz+XZ4nCQXtEOfiEWv1hvPqs8HYW+2NdBbhf1tDh5BwYcEJiVm2j5VPb1l28VzOdgZB18sVYHMP0M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673537398; 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=bcEqtTRvV6srWwHas9ft5oRh2juaO/kh/SLNTFtT1FM=; b=LjRHHcNZjIjK9HAUkhD17C43ViwbihdEidYwwWiO5t6k6PApdufisU/UUoInmfBVct/xsEcudWBCyD6+olGLYfmEGQkzOLHmRmpySU8drqUHi29gouKu5M/fFv/46AJWkSYdz75sfxTTRSN59mMb5lGxaPloUPSTCUty3esVpWo= 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+importer2=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 1673537398208105.82605487172009; Thu, 12 Jan 2023 07:29:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFzVk-0002ze-K7; Thu, 12 Jan 2023 10:29:00 -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 1pFzVP-0002lv-R0 for qemu-devel@nongnu.org; Thu, 12 Jan 2023 10:28:41 -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 1pFzVN-00040A-VL for qemu-devel@nongnu.org; Thu, 12 Jan 2023 10:28:39 -0500 Received: from sas1-7470331623bb.qloud-c.yandex.net (sas1-7470331623bb.qloud-c.yandex.net [IPv6:2a02:6b8:c08:bd1e:0:640:7470:3316]) by forwardcorp1b.mail.yandex.net (Yandex) with ESMTP id A8390604CB; Thu, 12 Jan 2023 18:28:31 +0300 (MSK) Received: from davydov-max-nux.yandex-team.ru (unknown [2a02:6b8:b081:b685::1:34]) by sas1-7470331623bb.qloud-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id AShxC80QhKo1-WBYBMhG6; Thu, 12 Jan 2023 18:28:30 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1673537310; bh=bcEqtTRvV6srWwHas9ft5oRh2juaO/kh/SLNTFtT1FM=; h=Message-Id:Date:In-Reply-To:Cc:Subject:References:To:From; b=a8dWTpxNMXefUza5zFCL5snrHGDXwukZBbx7iBOAOZnSrmZ0n9VrCx0NSI6isR/R0 53tuM44+EqaGv3skKkZzO7gEVMBRf489lQALnXt93aifUgaHKBqxjfbpKkoTAlpIEP bXrreVy1W0f9u3cPnScdJV2NKsgH12YPPtkw7pdY= Authentication-Results: sas1-7470331623bb.qloud-c.yandex.net; dkim=pass header.i=@yandex-team.ru From: Maksim Davydov To: qemu-devel@nongnu.org Cc: vsementsov@yandex-team.ru, jsnow@redhat.com, eduardo@habkost.net, marcel.apfelbaum@gmail.com, philmd@linaro.org, wangyanan55@huawei.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 v5 1/4] qom: add default value Date: Thu, 12 Jan 2023 18:28:02 +0300 Message-Id: <20230112152805.33109-2-davydov-max@yandex-team.ru> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230112152805.33109-1-davydov-max@yandex-team.ru> References: <20230112152805.33109-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+importer2=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: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @yandex-team.ru) X-ZM-MESSAGEID: 1673537400192100001 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 | 1 + 1 file changed, 1 insertion(+) diff --git a/qom/qom-qmp-cmds.c b/qom/qom-qmp-cmds.c index 7c087299de..e91a235347 100644 --- a/qom/qom-qmp-cmds.c +++ b/qom/qom-qmp-cmds.c @@ -212,6 +212,7 @@ ObjectPropertyInfoList *qmp_qom_list_properties(const c= har *typename, info->name =3D g_strdup(prop->name); info->type =3D g_strdup(prop->type); info->description =3D g_strdup(prop->description); + info->default_value =3D qobject_ref(prop->defval); =20 QAPI_LIST_PREPEND(prop_list, info); } --=20 2.25.1 From nobody Thu Apr 25 15:47:08 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=yandex-team.ru ARC-Seal: i=1; a=rsa-sha256; t=1673538254; cv=none; d=zohomail.com; s=zohoarc; b=miylzY7P2U+tP/Q5Zdi4qp14Ywfeq/kKRI1OD2SGQMYj6chWCBJOudPaT8SyzLGJPwwnMC6ra6xuyZDkIaQKJaIievRSTf5iU5kVizIHG3RIltjfRVE1lYnImiUMNesow22yyAoOfcY+q1tKkZhcp0Hxk1+/XJQR6b+56HVrBg8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673538254; 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=bQiLu4iPOPZQtc5YzMt+YWtl/aUSXlVvOepNpSxpz3E=; b=VSvY8h0ABWuF+B4w+3IOjFtuQ5pbbAbEMnwxQ1XDuaAWdZAeAEvmbtYiPIAI3k6IALljxn7NxUPyzMq2r/0JkEwq1cfQx90xzQrLtsDb661B/lXetfH3Ht5P2ut8oUNPO6V4O3NTm9oROUKrWYCUHrRqqtkY2W5PBZy9F6Edgtk= 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+importer2=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 SMTP id 1673538254449892.1919906554178; Thu, 12 Jan 2023 07:44:14 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFzVo-00033Z-Hd; Thu, 12 Jan 2023 10:29:04 -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 1pFzVQ-0002mE-HE for qemu-devel@nongnu.org; Thu, 12 Jan 2023 10:28:41 -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 1pFzVO-00040J-Mc for qemu-devel@nongnu.org; Thu, 12 Jan 2023 10:28:40 -0500 Received: from sas1-7470331623bb.qloud-c.yandex.net (sas1-7470331623bb.qloud-c.yandex.net [IPv6:2a02:6b8:c08:bd1e:0:640:7470:3316]) by forwardcorp1b.mail.yandex.net (Yandex) with ESMTP id 30F7F5FD0E; Thu, 12 Jan 2023 18:28:33 +0300 (MSK) Received: from davydov-max-nux.yandex-team.ru (unknown [2a02:6b8:b081:b685::1:34]) by sas1-7470331623bb.qloud-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id AShxC80QhKo1-58rqTmfg; Thu, 12 Jan 2023 18:28:32 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1673537312; bh=bQiLu4iPOPZQtc5YzMt+YWtl/aUSXlVvOepNpSxpz3E=; h=Message-Id:Date:In-Reply-To:Cc:Subject:References:To:From; b=WZS8m0Usyx+0IELSTWeboHbcIc/W6C4HODksU8QNIigvgdTx2NiKLlfDdk+ozUgWH rMrMMfTCK9gokw5Su1pNPBxg0g07at8soI6ewFCt67WIEcv6IqnLLpYfR65wIbOY9Q wDrEfo9pH3UN+tHOdR3BL854shaaV89LEBu03aJw= Authentication-Results: sas1-7470331623bb.qloud-c.yandex.net; dkim=pass header.i=@yandex-team.ru From: Maksim Davydov To: qemu-devel@nongnu.org Cc: vsementsov@yandex-team.ru, jsnow@redhat.com, eduardo@habkost.net, marcel.apfelbaum@gmail.com, philmd@linaro.org, wangyanan55@huawei.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 v5 2/4] python/qmp: increase read buffer size Date: Thu, 12 Jan 2023 18:28:03 +0300 Message-Id: <20230112152805.33109-3-davydov-max@yandex-team.ru> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230112152805.33109-1-davydov-max@yandex-team.ru> References: <20230112152805.33109-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+importer2=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: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @yandex-team.ru) X-ZM-MESSAGEID: 1673538255693100001 Content-Type: text/plain; charset="utf-8" Current 256KB is not enough for some real cases. As a possible solution limit can be chosen to be the same as libvirt (10MB) Signed-off-by: Maksim Davydov Reviewed-by: John Snow Acked-by: John Snow --- 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..b5772e7f32 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; 10MB like libvirt default + _limit =3D (10 * 1024 * 1024) =20 # Type alias for pending execute() result items _PendingT =3D Union[Message, ExecInterruptedError] --=20 2.25.1 From nobody Thu Apr 25 15:47:08 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=yandex-team.ru ARC-Seal: i=1; a=rsa-sha256; t=1673538939; cv=none; d=zohomail.com; s=zohoarc; b=EcQKnpKrD6ckYOEqa28DDg91qjAQc8YhgZ7cUNRnZQ8M9mdljuopDRWIOUxvu370hqZIUVk2Unca6dsfa/2zaiKezT54LYWlie3ff4u4Y2IZP/My+b+42OBgIeq2XQ3o+veg5xCbpYSDKWKxPqGNow2LmHV2nbpSoDi+lRj/uoQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673538939; 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=Ag4VFdzGJbyEOinaLxz0BJsmTuX+QRoVH9XeY52mEfk=; b=W4Nbu8BTW5v7Rqdy0SV536yEA0UpreolYIeB8Al6qZufcITajGxetJQddSga3sPzBy3H8S8U9Zrb/7hAMA5p2DPakqtAz//yvSJSYvim+4ulfDFyXlfj32Pu3ZkDQgsVjvRsXSzxuk55cg7s69tdiVRpgjy4wHvajiTtJAuat30= 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+importer2=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 SMTP id 1673538938866769.7072720588835; Thu, 12 Jan 2023 07:55:38 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFzVp-00036S-5M; Thu, 12 Jan 2023 10:29:05 -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 1pFzVR-0002mo-8t for qemu-devel@nongnu.org; Thu, 12 Jan 2023 10:28:43 -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 1pFzVP-00040T-Cq for qemu-devel@nongnu.org; Thu, 12 Jan 2023 10:28:41 -0500 Received: from sas1-7470331623bb.qloud-c.yandex.net (sas1-7470331623bb.qloud-c.yandex.net [IPv6:2a02:6b8:c08:bd1e:0:640:7470:3316]) by forwardcorp1b.mail.yandex.net (Yandex) with ESMTP id 097D26049E; Thu, 12 Jan 2023 18:28:35 +0300 (MSK) Received: from davydov-max-nux.yandex-team.ru (unknown [2a02:6b8:b081:b685::1:34]) by sas1-7470331623bb.qloud-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id AShxC80QhKo1-mtQaCoAg; Thu, 12 Jan 2023 18:28:34 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1673537314; bh=Ag4VFdzGJbyEOinaLxz0BJsmTuX+QRoVH9XeY52mEfk=; h=Message-Id:Date:In-Reply-To:Cc:Subject:References:To:From; b=QuVPAvlJdFLdPz45vFdibJjTK8J2pb6NgN64k+afZklp2DUV9FoC47V3lcYpp+IQu 6JCBj0DeN/STDoIcv83Usq2yC9Mkr/U82pl6fNMR/fBRotI39aQLHdS6mxXboKCKme UftcxSyDKb8TsY/pqeQ4LmyNt6NAy5mqlY/ky8qE= Authentication-Results: sas1-7470331623bb.qloud-c.yandex.net; dkim=pass header.i=@yandex-team.ru From: Maksim Davydov To: qemu-devel@nongnu.org Cc: vsementsov@yandex-team.ru, jsnow@redhat.com, eduardo@habkost.net, marcel.apfelbaum@gmail.com, philmd@linaro.org, wangyanan55@huawei.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 v5 3/4] qmp: add dump machine type compatible properties Date: Thu, 12 Jan 2023 18:28:04 +0300 Message-Id: <20230112152805.33109-4-davydov-max@yandex-team.ru> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230112152805.33109-1-davydov-max@yandex-team.ru> References: <20230112152805.33109-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+importer2=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: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @yandex-team.ru) X-ZM-MESSAGEID: 1673538942809100001 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 | 23 +++++++++++++++- qapi/machine.json | 54 +++++++++++++++++++++++++++++++++++-- tests/qtest/fuzz/qos_fuzz.c | 2 +- 3 files changed, 75 insertions(+), 4 deletions(-) diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c index 80d5e59651..aba6e49a90 100644 --- a/hw/core/machine-qmp-cmds.c +++ b/hw/core/machine-qmp-cmds.c @@ -73,7 +73,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; @@ -104,6 +105,26 @@ MachineInfoList *qmp_query_machines(Error **errp) info->default_ram_id =3D g_strdup(mc->default_ram_id); } =20 + 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); + } + } + QAPI_LIST_PREPEND(mach_list, info); } =20 diff --git a/qapi/machine.json b/qapi/machine.json index b9228a5e46..7c0bf13756 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: 8.0 +## +{ '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 8.0) +# # 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 8.0) +# # 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 e403d373a0..b71e945c5f 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 Thu Apr 25 15:47:08 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=yandex-team.ru ARC-Seal: i=1; a=rsa-sha256; t=1673538199; cv=none; d=zohomail.com; s=zohoarc; b=QKsGmzRgFnizmrqPqU2QfJmrCLn1CZ9mI3OHAILcrupuKmo5AZtWdyFBFMtOYA9bMgaMOBQp+eZYFA2VxdW52euTxx7Y1Bb+MnNRPswkmaHtMOc77tqq9KYqPYY1k7HMC1GKWWLow/yli7xcnkjh4WDZpBtkeH6LbmJnyS+/8D0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673538199; 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=J/xn/g/bYwumVz7Qw8z9w3fkSQ5QaPTmL5BsG0r637U=; b=c/X0UTYCENpKpoXfufRqGycV+ytGaxNk/8ote0T9N6xDpKGPj2ZCVA1eXh3CyB0gWtjJfOXA8o9piuKk+YBZ86wbbhXPpzVSIzLdSsf2QrNc0Mg0JPkKY1HeNXDlbNMSzas271443UOVy07cZMEsoehltOJ9sFvjzH4RkakYt78= 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+importer2=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 1673538199615619.914258450275; Thu, 12 Jan 2023 07:43:19 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFzVm-00030Y-LV; Thu, 12 Jan 2023 10:29:04 -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 1pFzVX-0002qm-5p for qemu-devel@nongnu.org; Thu, 12 Jan 2023 10:28:50 -0500 Received: from forwardcorp1b.mail.yandex.net ([2a02:6b8:c02:900: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 1pFzVT-00040u-9I for qemu-devel@nongnu.org; Thu, 12 Jan 2023 10:28:46 -0500 Received: from sas1-7470331623bb.qloud-c.yandex.net (sas1-7470331623bb.qloud-c.yandex.net [IPv6:2a02:6b8:c08:bd1e:0:640:7470:3316]) by forwardcorp1b.mail.yandex.net (Yandex) with ESMTP id 710D1604E3; Thu, 12 Jan 2023 18:28:37 +0300 (MSK) Received: from davydov-max-nux.yandex-team.ru (unknown [2a02:6b8:b081:b685::1:34]) by sas1-7470331623bb.qloud-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id AShxC80QhKo1-cZpsjK6K; Thu, 12 Jan 2023 18:28:36 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1673537316; bh=J/xn/g/bYwumVz7Qw8z9w3fkSQ5QaPTmL5BsG0r637U=; h=Cc:Message-Id:References:Date:In-Reply-To:Subject:To:From; b=eNaM1VG4JUAS+EZCiIy2E0TQC+y8EV3DAdyLrMJFFrG75cD2X9a8W8U5fxLDcWbgp X8d405k+/ZqF3iw3Cc9Rh7ISsnBUBbZL9sC2/zT64+xxksprIlsrjXqz+Kk+nFPg3c /k90GeoEsuXeKrEyvrX7rUeqeJJBZQSsyVkPi/NE= Authentication-Results: sas1-7470331623bb.qloud-c.yandex.net; dkim=pass header.i=@yandex-team.ru From: Maksim Davydov To: qemu-devel@nongnu.org Cc: vsementsov@yandex-team.ru, jsnow@redhat.com, eduardo@habkost.net, marcel.apfelbaum@gmail.com, philmd@linaro.org, wangyanan55@huawei.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 v5 4/4] scripts: add script to compare compatible properties Date: Thu, 12 Jan 2023 18:28:05 +0300 Message-Id: <20230112152805.33109-5-davydov-max@yandex-team.ru> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230112152805.33109-1-davydov-max@yandex-team.ru> References: <20230112152805.33109-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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a02:6b8:c02:900:1:45:d181:df01; 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: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @yandex-team.ru) X-ZM-MESSAGEID: 1673538201807100001 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 | 506 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 506 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..7d1234dbac --- /dev/null +++ b/scripts/compare_mt.py @@ -0,0 +1,506 @@ +#!/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 comparison, some machine type doesn't have a property (it is = in +# the comparison 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_property_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, Generator, Tuple, Union, Any, Set + +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 for gettig the right values of drivers properties +# +# 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: +# * Class must be inherited from 'PropQEMUObject' and its name has to start +# with 'PropQEMU' +# * Class constructor must set appropriate QEMU type name via QEMUObject +# constructor, the name must 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 prop_methods drivers because all +# QEMU types are inherited from Object +class PropQEMUObject(): + def __init__(self, name: str) -> None: + self.name =3D name + + def get_prop(self, vm: QEMUMachine, device: str, prop_name: str) -> st= r: + return 'Unavailable method' + + +class PropQEMUDevice(PropQEMUObject): + def __init__(self) -> None: + super().__init__('device') + self.cached: Dict[str, List[Dict[str, Any]]] =3D {} + + def get_prop(self, vm: QEMUMachine, device: str, prop_name: str) -> st= r: + if device not in self.cached: + self.cached[device] =3D vm.command('device-list-properties', + typename=3Ddevice) + for prop in self.cached[device]: + if prop['name'] =3D=3D prop_name: + return str(prop.get('default-value', 'No default value')) + + return 'Unknown property' + + +class PropQEMUx86CPU(PropQEMUObject): + def __init__(self) -> None: + super().__init__('x86_64-cpu') + self.cached: Dict[str, Dict[str, Any]] =3D {} + + + def get_prop(self, vm: QEMUMachine, device: str, prop_name: str) -> st= r: + if not device.endswith('-x86_64-cpu'): + return 'Wrong x86_64-cpu name' + + # crop last 11 chars '-x86_64-cpu' + name =3D device[:-11] + if name not in self.cached: + self.cached[name] =3D vm.command('query-cpu-model-expansion', + type=3D'full', + model=3D{'name': name} + )['model']['props'] + return str(self.cached[name].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 +class PropQEMUMemoryBackend(PropQEMUObject): + def __init__(self) -> None: + super().__init__('memory-backend') + self.cached: Dict[str, List[Dict[str, Any]]] =3D {} + + + def get_prop(self, vm: QEMUMachine, driver: str, prop_name: str) -> st= r: + if driver not in self.cached: + self.cached[driver] =3D vm.command('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' + + +# contains all property classes to associate them to the appropriate QEMU = types +class QEMUPropsAggregator(): + def __init__(self) -> None: + self.property_methods =3D {} + self.default =3D PropQEMUObject('object') + + for name, obj in globals().items(): + if not name.startswith('PropQEMU'): + continue + + # base class + if name =3D=3D ('PropQEMUObject'): + continue + + prop_obj =3D obj() + self.property_methods[prop_obj.name] =3D prop_obj + + + def get_class(self, driver_name: str) -> PropQEMUObject: + return self.property_methods.get(driver_name, self.default) + +##### End of methods definition + + +# implements description of a QEMU driver +class Driver: + def __init__(self, driver_defs: dict, driver_name: str, parent_name: s= tr, + is_abstr: bool, list_of_children: List[str], + get_method: PropQEMUObject) -> 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_method + + + # checks whether the driver is parent + 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 + + + # set property getting class based on QEMU types structure + def set_prop_method(self, prop_method: PropQEMUObject) -> None: + if prop_method.name !=3D self.name: + return + + self.method =3D prop_method + if not self.abstract: + return + + for child in self.children: + if not self.driver_defs[child].method: + self.driver_defs[child].method =3D prop_method + continue + + # specialization always wins + if self.is_parent(self.driver_defs[child].method.name): + self.driver_defs[child].method =3D prop_method + + +# implements the relationship between drivers and how to get their propert= ies +class DriverDefinitions: + def __init__(self, vm: QEMUMachine) -> None: + self.driver_defs: Dict[str, Driver] =3D {} + self.methods =3D QEMUPropsAggregator() + 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 not abstr: + self.driver_defs[name] =3D Driver(self.driver_defs, name, = parent, + abstr, [], + self.methods.get_class(nam= e)) + continue + + list_child_objs =3D vm.command('qom-list-types', implements=3D= name, + abstract=3DTrue) + child_list =3D [child['name'] for child in list_child_objs] + self.driver_defs[name] =3D Driver(self.driver_defs, name, pare= nt, + abstr, child_list, + self.methods.get_class(name)) + + # associating property getting class and QEMU types based on QEMU + # structure from 'qom-list-types' + for driver_name, prop_method in self.methods.property_methods.item= s(): + # skip other architectures and etc. + if prop_method.name not in self.driver_defs: + continue + self.driver_defs[driver_name].set_prop_method(prop_method) + + + # adds default values of the driver property to the given list. If the + # driver is abstract all possible default values of derived classes wi= ll + # be added + def add_prop_value(self, driver: str, prop: str, + prop_list: List[Any]) -> None: + # 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)) + + +# short QEMU machine type description. It contains only compat_props +class Machine: + # raw_mt_dict - dict produced by `query-machines` + def __init__(self, raw_mt_dict: Dict[str, Any]) -> None: + self.name =3D raw_mt_dict['name'] + self.compat_props: Dict[str, Any] =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)') + mt_args_group.add_argument('--mt', nargs=3D"*", type=3Dstr, + help=3D'list of Machine Types ' + 'that will be compared') + + return parser.parse_args() + + +# returns 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 =3D [] + for raw_mt in raw_mt_defs: + mt_defs.append(Machine(raw_mt)) + + mt_defs.sort(key=3Dmt_comp) + return mt_defs + + +# returns list of requested by user machines +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[Machine]) -> Generator[Tuple[str, str], + None, None]: + driver_props: Dict[str, Set[Any]] =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[str, List[Any]], + mt_names: List[str]) -> pd.DataFrame: + new_table =3D {} + for full_prop_name, prop_values in table.items(): + new_row =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 =3D list(map(transform_value, mt_prop_val)) + if len(transformed) =3D=3D 1: + new_row.append(transformed[0]) + else: + new_row.append(transformed) + + numeric_values.update(set(map(transform_number, mt_prop_va= l))) + all_values.update(set(transformed)) + else: + transformed =3D transform_value(mt_prop_val) + new_row.append(transformed) + numeric_values.add(transform_number(mt_prop_val)) + all_values.add(transformed) + + 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) + + +# constructs table in the format: +# +# | machine1 | machine2 | ... +# driver1:property1 | value1 | value2 | ... +# driver1:property2 | value3 | value4 | ... +# driver2:property1 | value5 | value6 | ... +# ... | ... | ... | ... +# +def fill_prop_table(mt_list: List[Machine], + qemu_drivers: DriverDefinitions, + is_raw: bool) -> pd.DataFrame: + table: Dict[str, List[Any]] =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) + comp_table =3D fill_prop_table(req_mt, qemu_drivers, args.raw) + if not comp_table.empty: + print_table(comp_table, args.format) + + vm.shutdown() --=20 2.25.1