From nobody Wed Apr 24 07:26:54 2024 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=1669298871; cv=none; d=zohomail.com; s=zohoarc; b=fTZFeOwUB38W7UPHGpxrwiVm1C8qJHv6+Hq1Pe21KwbSWzbGLWfBysalFHNlMK6NxfVDwTWwrM6+VnULR0GeSkyzEcJRl5Z16vyx8+RIG/cSe+hBKlhLJOwW7jrM+5A1ABLFWvcmSjGI4xb0x8Udqj2irvsQvACHWEbqzDZOcOM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1669298871; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=64DfYOmihmBJVpjEmProBDNEy5ZGbMfBVlVwykOBUGs=; b=OWXz6FP3UUZB2ktYKkUxK7D92yHD1TIFnCJtzb1OxBG/Ptj1KL2Yhy4pji0QPsFlfaF4cBDzIxYo8bRAU4ir8AuqHNlMYHzfRsnpoWUIL4yDzKWoZ9+kg0srbkOeLCKHnhpf2nMJoLrpZuLM/AeEEtvl+FSA2/wN6es9uYC51Gc= 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 1669298871357604.9595568668689; Thu, 24 Nov 2022 06:07:51 -0800 (PST) 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-91-N7zGtZkgO0eVPtkKHRryPA-1; Thu, 24 Nov 2022 09:07:46 -0500 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 71C34803533; Thu, 24 Nov 2022 14:07:44 +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 BF0444EA4E; Thu, 24 Nov 2022 14:07:43 +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 A24CE1946589; Thu, 24 Nov 2022 14:07:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id BCABB1946587 for ; Thu, 24 Nov 2022 14:07:38 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id A0B80492B09; Thu, 24 Nov 2022 14:07:38 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.204]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8CF4D492B04; Thu, 24 Nov 2022 14:07:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669298870; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=64DfYOmihmBJVpjEmProBDNEy5ZGbMfBVlVwykOBUGs=; b=DGjIq/PBqCy720iQsUXmOZJl1RjppLY+oaY8eojyvLzTDXde9fcK91rT9x9OUAZimIyuwq wcKpojqTIH728fOtkaq/a4RvB5KcpfW8OVmsdpWvq8iUFxpvsAK9wZbMhAkk8oFr77o4qL Sq3jbBkFTMf4Yz1UDMoPGLurwnr43EQ= X-MC-Unique: N7zGtZkgO0eVPtkKHRryPA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Thomas Huth To: libvir-list@redhat.com Subject: [PATCH] cpu_s390: Implement getVendorForModel for IBM Z Date: Thu, 24 Nov 2022 15:07:33 +0100 Message-Id: <20221124140733.74033-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 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: Boris Fiuczynski 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: 1669298872792100001 Content-Type: text/plain; charset="utf-8"; x-default="true" When running "virsh domcapabilities" on a s390x host, all the CPU models show up with vendor=3D'unknown' - which sounds kind of weird since the vendor of these mainframe CPUs is well known: IBM. All CPUs starting with either "z" or "gen" match a real mainframe CPU by IBM, so let's return the string "IBM" for those now. The only remaining ones are now the artifical "qemu" and "max" models from QEMU itself, so it should be OK to get an "unknown" vendor for those two. Signed-off-by: Thomas Huth Reviewed-by: Boris Fiuczynski --- src/cpu/cpu_s390.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/cpu/cpu_s390.c b/src/cpu/cpu_s390.c index d908a83928..7416ec6dc5 100644 --- a/src/cpu/cpu_s390.c +++ b/src/cpu/cpu_s390.c @@ -109,6 +109,16 @@ virCPUs390ValidateFeatures(virCPUDef *cpu) } =20 =20 +static const char * +virCPUs390GetVendorForModel(const char *modelName) +{ + if (modelName[0] =3D=3D 'z' || STREQLEN(modelName, "gen", 3)) + return "IBM"; + + return NULL; +} + + struct cpuArchDriver cpuDriverS390 =3D { .name =3D "s390", .arch =3D archs, @@ -119,4 +129,5 @@ struct cpuArchDriver cpuDriverS390 =3D { .baseline =3D NULL, .update =3D virCPUs390Update, .validateFeatures =3D virCPUs390ValidateFeatures, + .getVendorForModel =3D virCPUs390GetVendorForModel, }; --=20 2.31.1