From nobody Tue Feb 10 08:26:59 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1605713091; cv=none; d=zohomail.com; s=zohoarc; b=Jq5/KmW5SarA2NUu6LgfAKfsZuhZ1oYkpLA0oT1N6futw7LwuO8VcXmotpYcrUFAPMer26Q27v6S3oXOaC8BMhtsFNOlqadG2ElCO1wHZA+GXXH4w9DAynGoBCIm88/HgPOfjYP8VUO4pXjCvnxL5/NlsF4C0T1X3WiAyJyndTo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605713091; 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=6JAjkxN5XWw6sAL5vRgTCjSQ47QspKHHLhg0FUa7w0o=; b=FzMOqvOgX+yX92TeYWp2gLvXhH1j7Vik75YrkRGH/ZIki5HDcyQZCUvd351LwHp144fZnHa/CrFgC1Wdzf/w2svQyQk5SBNxpyixVWMIzi9xf4B48kwCdz5pArgMtaU5IisvNMOC5BseiIUZL9y48gTNvL7aAxxYNhRFKl536LE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 16057130911851005.709845627097; Wed, 18 Nov 2020 07:24:51 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-457-ODXLNJuQNSGzZsfKaztE0w-1; Wed, 18 Nov 2020 10:24:47 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 75524814418; Wed, 18 Nov 2020 15:24:39 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2E8185D9CA; Wed, 18 Nov 2020 15:24:39 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id E50711809CA0; Wed, 18 Nov 2020 15:24:38 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0AIFOSVW020908 for ; Wed, 18 Nov 2020 10:24:28 -0500 Received: by smtp.corp.redhat.com (Postfix) id 8717860CD0; Wed, 18 Nov 2020 15:24:28 +0000 (UTC) Received: from work.redhat.com (ovpn-114-34.ams2.redhat.com [10.36.114.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id AA1DF60BE2; Wed, 18 Nov 2020 15:24:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605713090; 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=6JAjkxN5XWw6sAL5vRgTCjSQ47QspKHHLhg0FUa7w0o=; b=BiLN1XRohP+2TOxRQW4oLpDJAysBxAc35vQh5UjMiPQEgSymqi0XsuB1LlZeApSt7ljcj3 bXL5Vg1iTiGeqOvYnACvwQaaiAhVABXoDfE3IlKq5kApdXK5KO3T9Yj2yL2XeeLBnpaGwY lLT61w2PxqAiDR3GSbnZrmD5zyqqp+4= X-MC-Unique: ODXLNJuQNSGzZsfKaztE0w-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 2/9] cpu_map: sync_qemu_cpu_i386: Factor out translation of vendors Date: Wed, 18 Nov 2020 16:24:11 +0100 Message-Id: <20201118152418.115450-3-twiederh@redhat.com> In-Reply-To: <20201118152418.115450-1-twiederh@redhat.com> References: <20201118152418.115450-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake --- src/cpu_map/sync_qemu_i386.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/cpu_map/sync_qemu_i386.py b/src/cpu_map/sync_qemu_i386.py index 82413d831e..fe95f26511 100755 --- a/src/cpu_map/sync_qemu_i386.py +++ b/src/cpu_map/sync_qemu_i386.py @@ -8,11 +8,6 @@ import re =20 =20 T =3D { - # translating qemu -> libvirt cpu vendor names - "CPUID_VENDOR_AMD": "AMD", - "CPUID_VENDOR_INTEL": "Intel", - "CPUID_VENDOR_HYGON": "Hygon", - # translating qemu -> libvirt cpu feature names "CPUID_6_EAX_ARAT": "arat", "CPUID_7_0_EBX_ADX": "adx", @@ -152,6 +147,20 @@ T =3D { } =20 =20 +def translate_vendor(name): + T =3D { + "CPUID_VENDOR_AMD": "AMD", + "CPUID_VENDOR_INTEL": "Intel", + "CPUID_VENDOR_HYGON": "Hygon", + } + + if name in T: + return T[name] + + print("warning: Unknown vendor '{}'".format(name)) + return name + + def readline_cont(f): """Read one logical line from a file `f` i.e. continues lines that end= in a backslash.""" @@ -264,7 +273,7 @@ def expand_model(model): =20 result =3D { "name": model.pop(".name"), - "vendor": T[model.pop(".vendor")], + "vendor": translate_vendor(model.pop(".vendor")), "features": set(), "extra": dict()} =20 --=20 2.26.2