From nobody Fri Dec 19 07:47:57 2025 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=1667576634; cv=none; d=zohomail.com; s=zohoarc; b=Y2QuLjPP4oLySFDComO17YlcQUPwm1KM65Cmp/uHrljGVWVnuR5KQidTxcSrv1PxAkKLZ4tgW1sPL2ZXf7OWIP3JlDx/VQk77VzVD5YWuV9xTTvMX/LxS1vv+IpaO//QCFn9d5Y9uvVKpF/4LqQOrEumUhWuYqXl0PXRjQmURV4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1667576634; 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=ZUsLRlIWYeVomEN84n65H73mNfLb3FKLHxcrNHbdqPA=; b=DT2rDAXLGXr+KeRcBNC1Y1QqEW/mra6E9QIBbpgzIbYVOXb17wyvztrczTf5YgebJGeckMeu8SczoxZkmu5AcDyeSzIMmShNEQSdTxtWWlatvVm+lEuUv0OmIirkeKJkrihXAomkXc+riViyejuorD38pOctfuqKDjQA6QzC3rw= 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 1667576634071303.361279974632; Fri, 4 Nov 2022 08:43:54 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-402--rvUsfc4OUKnaC07piFqew-1; Fri, 04 Nov 2022 11:43:51 -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 C7CF3101A52A; Fri, 4 Nov 2022 15:43:48 +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 B42DE4021BD; Fri, 4 Nov 2022 15:43:48 +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 A5EC61946588; Fri, 4 Nov 2022 15:43:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id DDBFE1946586 for ; Fri, 4 Nov 2022 15:43:46 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id D2879C2DF63; Fri, 4 Nov 2022 15:43:46 +0000 (UTC) Received: from work.fritz.box (unknown [10.39.193.200]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2BB66C2C8DD; Fri, 4 Nov 2022 15:43:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667576633; 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=ZUsLRlIWYeVomEN84n65H73mNfLb3FKLHxcrNHbdqPA=; b=NRG4Y5+ZlfQGgACTsl5ETtzpqrVv8wymUreibWl3BPxhvx2n6IIVQZZjAMDPwUhM87sMAE Wox/iuqRldKtkZ0/nfEeuarnrz56NlEZsydeyZ7TbtfiK0d+xYc1k+I+chpeMhnfqBP+j4 keiHLEibUgs4/08QwycY7iXnLSM30SI= X-MC-Unique: -rvUsfc4OUKnaC07piFqew-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v3 01/24] cpu-data.py: Allow for more than child in feature nodes Date: Fri, 4 Nov 2022 16:43:21 +0100 Message-Id: <20221104154344.213211-2-twiederh@redhat.com> In-Reply-To: <20221104154344.213211-1-twiederh@redhat.com> References: <20221104154344.213211-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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: Jiri Denemark , 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: 1667576634643100003 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