From nobody Mon Feb 9 11:47:07 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=1606140897; cv=none; d=zohomail.com; s=zohoarc; b=Qz2OKLcd/Oz09Zh7yhZo15gzL7HodS+BxwuyzPFUEhRT2KzKvWIgWuGceUA08WuP1mbUlPx7nb256rPMDnSa8cSVOzmMRm7+HoPItHMsSwvPbEs5nSx0cPfC8jVJmql6P+2BNQvt90RLOXB9uCkN6nPp9QG2r4VgBGKfXfIvOIg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606140897; 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=fLYyFZUneVNHhkrVHrqQOe1aevnz9avFMD1R3YTXHUE=; b=G/eauTIeycWJ5E0jYrMmtuElMNMre7F5f41eApfegLePG04ECUXNGW+h1XFaOXQkPgRlKsPqGRI6/OBVh4pvCasm/+nwRWIotYdPUL4XUY9ZL3VaFM2XyviU7aIZqmBh/s733L8UtdSe66/Z1xILIl43WoFxPlqlzZX02C97/qQ= 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 1606140897177570.0306192516814; Mon, 23 Nov 2020 06:14:57 -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-39-7CgV3hmHM5ukrie-nF9q_g-1; Mon, 23 Nov 2020 09:14:50 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D752A100C607; Mon, 23 Nov 2020 14:14:42 +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 B3BB15C1C4; Mon, 23 Nov 2020 14:14:42 +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 7D29F1809CA0; Mon, 23 Nov 2020 14:14:42 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0ANEEdq1002350 for ; Mon, 23 Nov 2020 09:14:39 -0500 Received: by smtp.corp.redhat.com (Postfix) id 17F3B19D80; Mon, 23 Nov 2020 14:14:39 +0000 (UTC) Received: from work.redhat.com (ovpn-112-182.ams2.redhat.com [10.36.112.182]) by smtp.corp.redhat.com (Postfix) with ESMTP id 597F219D7C; Mon, 23 Nov 2020 14:14:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606140894; 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=fLYyFZUneVNHhkrVHrqQOe1aevnz9avFMD1R3YTXHUE=; b=FDhWvXhOJmzwtK2igqoTvDrnYLHXraBmHna5NPqpkUvQvNrSjT5/MNshfoXUeOVRpQWNrl WtXb8CA0PC+C5BtIDxSR/0lf4Dz3dC3FV+FVIUqmCmarE0SKzPrSvMlISYZI+weKhj4qS7 8julhKFil2Tf8lpD9movRcaP5dui0p0= X-MC-Unique: 7CgV3hmHM5ukrie-nF9q_g-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v3 01/10] cpu_map: sync_qemu_cpu_i386: Factor out translation of vendors Date: Mon, 23 Nov 2020 15:14:24 +0100 Message-Id: <20201123141433.35515-2-twiederh@redhat.com> In-Reply-To: <20201123141433.35515-1-twiederh@redhat.com> References: <20201123141433.35515-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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.16 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 8deda869df..f86cdf969f 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