From nobody Mon Feb 9 11:29:33 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1666969630; cv=none; d=zohomail.com; s=zohoarc; b=WbRlGJLNcqxEs5zG6p974AxwZJomNyVmX5jVPEtA8K2esurlwrwIPSxA6amu4OnldPTAd9qz4V/gm+lMYYe+754ayP/Ly+jv4jsNEKrXu6OM/p6O9mF98BRofKi7M7vRksIqSuKt2HrMZnE6SSxVFAYTzEWCmAaASHRl02CrzcU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1666969630; 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=SvuQCbDGrdTayGDI0aGR9aMwd8dib8lypega50z1EuyY9dM0w2LKzj6FFttUR6jgSjCYJU01kMOYTXZyuRhaTtRUjX4Bc52PwMc8AmwTU/iPDhqOYGeGDMazJ16c/kyKo1fXNZnN+ZHVPrLXHmmTSlVGmJp+7cGB1Q3DL6S8BEc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 1666969630075315.57921972618783; Fri, 28 Oct 2022 08:07:10 -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-671-a4cgggJ3O0O_fLgSc7NC-A-1; Fri, 28 Oct 2022 11:07:04 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 77397858F17; Fri, 28 Oct 2022 15:07:01 +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 87EDF18EB4; Fri, 28 Oct 2022 15:07:00 +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 620071947073; Fri, 28 Oct 2022 15:06:59 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 5D0F91946586 for ; Fri, 28 Oct 2022 15:06:58 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 4D5A039DB3; Fri, 28 Oct 2022 15:06:58 +0000 (UTC) Received: from work.fritz.box (unknown [10.39.193.205]) by smtp.corp.redhat.com (Postfix) with ESMTP id AB5D517593; Fri, 28 Oct 2022 15:06:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666969628; 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=FlujGoCpPSqMz9dDNB376j2Pt4+KCxbUiChHRnQCQhXEc54dlzkShol+njbC1cRSoPfzLF 5wVtIuSpiiseSiutYNaBDHllA6cYI6dYED88rOOaUhv5UPJOJLtfoiRKOBp83FiTvp4Oui AjJDiLiqxeHBt9TbepBzGn8y59J9qKY= X-MC-Unique: a4cgggJ3O0O_fLgSc7NC-A-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 01/24] cpu-data.py: Allow for more than child in feature nodes Date: Fri, 28 Oct 2022 17:06:32 +0200 Message-Id: <20221028150655.17925-2-twiederh@redhat.com> In-Reply-To: <20221028150655.17925-1-twiederh@redhat.com> References: <20221028150655.17925-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 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.5 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: 1666969632637100001 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