From nobody Wed Dec 4 19:17:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 173204247132648.413406987436815; Tue, 19 Nov 2024 10:54:31 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 4552E1476; Tue, 19 Nov 2024 13:54:30 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 9AAFA148D; Tue, 19 Nov 2024 13:50:37 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id D103C137A; Tue, 19 Nov 2024 13:50:27 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 508E213DB for ; Tue, 19 Nov 2024 13:50:27 -0500 (EST) Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-467-2EqtbSKDNru2HHdDMl13Ig-1; Tue, 19 Nov 2024 13:50:25 -0500 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id DF345195608B for ; Tue, 19 Nov 2024 18:50:24 +0000 (UTC) Received: from orkuz (unknown [10.45.226.13]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6372030000DF for ; Tue, 19 Nov 2024 18:50:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1732042227; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=X9qQp32j7r/JdokpgV0jWWTm7lHTdlGi5TorOcwA3+o=; b=jLdgYIThmXmk27iyIBexQtyHj9tenwhrsfg6ycFZy4GuwpDf8VWcMQedAvZ67h6KHY0mfq FHKbV2sMAAZ40rFGI0ptoaDPF16ZrqAJJUtf+iyLTNQklf3Q2n1e3MCE5GQFCQOXit3973 0F7ILHnqKQV7r4niyKVPXl7A3Z124XI= X-MC-Unique: 2EqtbSKDNru2HHdDMl13Ig-1 X-Mimecast-MFC-AGG-ID: 2EqtbSKDNru2HHdDMl13Ig From: Jiri Denemark To: devel@lists.libvirt.org Subject: [PATCH 06/32] sync_qemu_models_i386: Add support for versioned CPU models Date: Tue, 19 Nov 2024 19:49:42 +0100 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: _rxiv69I7UvNnJqRV3lsgkZw4DwOdHlq9zwunX6Fjts_1732042225 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: QY4A7JXSPDMOEHIAQRUCZVWAZEJO5HDX X-Message-ID-Hash: QY4A7JXSPDMOEHIAQRUCZVWAZEJO5HDX X-MailFrom: jdenemar@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1732042471870116600 Content-Type: text/plain; charset="utf-8" Each CPU model with -v* suffix is defined as a standalone model copying all attributes of the previous version. The only difference is -v1 which are defined as identical to the possibly already existing non-versioned CPU model. The -v1 CPU models will never be used in either host or domain capabilities for describing the host CPU for better compatibility with older releases of libvirt. Signed-off-by: Jiri Denemark --- src/cpu_map/sync_qemu_models_i386.py | 45 ++++++++++++++++++++++++---- 1 file changed, 40 insertions(+), 5 deletions(-) diff --git a/src/cpu_map/sync_qemu_models_i386.py b/src/cpu_map/sync_qemu_m= odels_i386.py index 13f62780e6..f75d649fe0 100755 --- a/src/cpu_map/sync_qemu_models_i386.py +++ b/src/cpu_map/sync_qemu_models_i386.py @@ -454,11 +454,20 @@ def expand_model(model): versions =3D model.pop(".versions", []) for k, v in model.items(): result["extra"]["model" + k] =3D v + + print(result['name']) yield result =20 + name =3D result["name"] for version in versions: result =3D copy.deepcopy(result) - result["name"] =3D version.pop(".alias", result["name"]) + + ver =3D int(version.pop(".version")) + result["name"] =3D f"{name}-v{ver}" + + alias =3D version.pop(".alias", None) + if not alias and ver =3D=3D 1: + alias =3D name =20 props =3D version.pop(".props", dict()) for k, v in props: @@ -477,7 +486,25 @@ def expand_model(model): for k, v in version.items(): result["extra"]["version" + k] =3D v =20 - yield result + if ver =3D=3D 1: + print(f"v{ver}: {result['name']} =3D> {alias}") + yield { + "vendor": result["vendor"], + "name": result["name"], + "alias": alias, + "extra": None, + "features": [], + } + else: + if alias: + print(f"v{ver}: {result['name']}") + yield result + + result =3D copy.deepcopy(result) + result["name"] =3D alias + + print(f"v{ver}: {result['name']}") + yield result =20 =20 def output_model(f, model): @@ -487,11 +514,19 @@ def output_model(f, model): f.write(f" '{k}': '{v}'\n") f.write("-->\n") =20 + alias =3D "alias" in model + decode =3D "off" if alias else "on" + f.write("\n") f.write(f" \n") - f.write(" \n") - f.write(f" \n") - f.write(f" \n") + f.write(f" \n") + + if alias: + f.write(f" \n") + else: + f.write(f" \n") + f.write(f" \n") + for feature in sorted(model["features"]): f.write(f" \n") f.write(" \n") --=20 2.47.0