From nobody Mon Feb 9 12:15:32 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1666198652; cv=none; d=zohomail.com; s=zohoarc; b=iolVx6u96JaaWKr5MaiGeLauDhEVy/OAQs0YnBYB4arLjrkeYl0VyZMXFoT0Neg6k3ttfQxTnACyno01CSyf7Rz4uXQ1994V05UhN9NRNzDfUCM8XqXkQDmNLxCdMCrCdN8RRtGcUFmmcqoKQWw3g24GtEwmxO7Tz9mXxrlyj0s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1666198652; 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=HAvVeE2RmC7mTh0PH1FnTWMEwjTfBdxRAtb1CCj3y4Y=; b=h67vGTJKHUwOpKw3vYxJ7fkdSyQPuEcL9yYNeJoAqLahzUiubM3wraR6+p7Po/y09yCUJoPwPUyanHMnzhsu6h2dnOsZ2mHeB7qkZs9oRjnSCNKIRVBwjwWZNky/EHSb6uINBf88rDQr3TfHk7Tmvx44J70a9usPfQFCPBmsa5U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1666198652593370.9223956217147; Wed, 19 Oct 2022 09:57:32 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-626-QnT07znlPE2MJJX9K5dvhg-1; Wed, 19 Oct 2022 12:57:30 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 072E73C6EAD3; Wed, 19 Oct 2022 16:56:46 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id C4D47492B05; Wed, 19 Oct 2022 16:56:45 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 2AD181946A42; Wed, 19 Oct 2022 16:56:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id BABDD19465B8 for ; Wed, 19 Oct 2022 16:56:33 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 111D1111E3ED; Wed, 19 Oct 2022 16:56:32 +0000 (UTC) Received: from work.fritz.box (unknown [10.39.195.58]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8FE711121319; Wed, 19 Oct 2022 16:56:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666198651; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=HAvVeE2RmC7mTh0PH1FnTWMEwjTfBdxRAtb1CCj3y4Y=; b=ThVGJp8RwHYej2lYEll/rGWz1kVhRGNulj0JuTv9EQFXCZgHAMzx1NqQO39UVxdLJJumTv U2WRI5rOQx4GA5NykpC08y/hJVdY6FldXP92tE8h/BlJIdtjhOhLMtIqR812QK6fJxA16/ N38ZWA54YuCop46du1RrEEoi0Z7bvqQ= X-MC-Unique: QnT07znlPE2MJJX9K5dvhg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 01/28] cpu-data.py: Allow for more than child in feature nodes Date: Wed, 19 Oct 2022 18:56:01 +0200 Message-Id: <20221019165628.321092-2-twiederh@redhat.com> In-Reply-To: <20221019165628.321092-1-twiederh@redhat.com> References: <20221019165628.321092-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tim Wiederhake Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1666198653437100001 Content-Type: text/plain; charset="utf-8"; x-default="true" cpu-data.py assumes that all "feature" nodes have exactly one child. This assumption will no longer be true when the cpumap includes alias- names for features. Signed-off-by: Tim Wiederhake Reviewed-by: Jiri Denemark --- tests/cputestdata/cpu-data.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/cputestdata/cpu-data.py b/tests/cputestdata/cpu-data.py index 0200db7a78..498e07b2f7 100755 --- a/tests/cputestdata/cpu-data.py +++ b/tests/cputestdata/cpu-data.py @@ -445,12 +445,15 @@ def parseMap(): =20 cpuMap =3D dict() for f in xml.etree.ElementTree.parse(path).getroot().iter("feature"): - if f[0].tag not in ("cpuid", "msr"): + data =3D f.find("cpuid") + if data is None: + data =3D f.find("msr") + if data is None: continue =20 - feature =3D {"type": f[0].tag} - for reg in _KEYS[f[0].tag] + _REGS[f[0].tag]: - feature[reg] =3D int(f[0].attrib.get(reg, "0"), 0) + feature =3D {"type": data.tag} + for reg in _KEYS[data.tag] + _REGS[data.tag]: + feature[reg] =3D int(data.attrib.get(reg, "0"), 0) cpuMap[f.attrib["name"]] =3D feature return cpuMap =20 --=20 2.36.1