From nobody Mon Dec 30 17:00:21 2024 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=fail(p=reject dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1694466579; cv=none; d=zohomail.com; s=zohoarc; b=MpTsdCRSZvTb+u2tgImHqQYvWdxHJcF+R0riJLsUofpj6/KlQ16affSE5J3pVmCuNSQHpFfHYlaw7vzpJniAegXGoZEZOK3adlsn6/pElLcfpULm4HMu+PeXDvzSKF/THH74r5SafqZYtnuUsv5B/EFEoUMyf251gaC+qLoi3bI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1694466579; 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=RvCfTY8NM64j55CE/Xf+OWAhxkjRaRsJQYNSCNghtTM=; b=cgm3wBqI9hqhbdwDZwHX0Nk4L5HFl8C845NfjFmTacHCiD5GxnB9QSzVGnApTv2qXQMzifGeH6JPZzReR8vNJTuy1ZUNCvqqFwm2Su5VZB0LuKYOLlyVNFkAbrdSWmHn7ZOEl8dlAZWc0EZTRxHU301Rd7X0iIui52YMeMapmiA= 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=fail header.from= (p=reject 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 1694466579189592.6640295506195; Mon, 11 Sep 2023 14:09:39 -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-156-oDPIH-AHNEm7TvuL867J6A-1; Mon, 11 Sep 2023 17:09:28 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7A544816514; Mon, 11 Sep 2023 21:09:22 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0EF0D1054FC3; Mon, 11 Sep 2023 21:09:22 +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 660F719465B7; Mon, 11 Sep 2023 21:09:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 73E3519465A4 for ; Mon, 11 Sep 2023 21:09:20 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 63AFC2027019; Mon, 11 Sep 2023 21:09:20 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5BDFA2026D4B for ; Mon, 11 Sep 2023 21:09:20 +0000 (UTC) Received: from us-smtp-inbound-delivery-1.mimecast.com (us-smtp-inbound-delivery-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3A6D4101FAA2 for ; Mon, 11 Sep 2023 21:09:20 +0000 (UTC) Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-182-Q-9V5IdCNA64K48KmWnSwg-1; Mon, 11 Sep 2023 17:09:18 -0400 Received: from pps.filterd (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38BKd6g6000531 for ; Mon, 11 Sep 2023 21:09:17 GMT Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3t29vg8yjb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 11 Sep 2023 21:09:17 +0000 Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 38BKrPSa024034 for ; Mon, 11 Sep 2023 21:09:16 GMT Received: from smtprelay01.wdc07v.mail.ibm.com ([172.16.1.68]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 3t131sx50n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 11 Sep 2023 21:09:16 +0000 Received: from smtpav04.dal12v.mail.ibm.com (smtpav04.dal12v.mail.ibm.com [10.241.53.103]) by smtprelay01.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 38BL9FAx35652064 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 11 Sep 2023 21:09:15 GMT Received: from smtpav04.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 52D2D58056; Mon, 11 Sep 2023 21:09:15 +0000 (GMT) Received: from smtpav04.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0D11558052; Mon, 11 Sep 2023 21:09:15 +0000 (GMT) Received: from li-d664314c-3171-11b2-a85c-fa8047ef35bd.ibm.com.com (unknown [9.67.49.93]) by smtpav04.dal12v.mail.ibm.com (Postfix) with ESMTP; Mon, 11 Sep 2023 21:09:14 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1694466577; 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=RvCfTY8NM64j55CE/Xf+OWAhxkjRaRsJQYNSCNghtTM=; b=D7Li+Y921j+2UE+8RqxV4iv16i5e3/mIG0Scax8VSC5omh2Z5ebtax6eSLZytg/OCkqImM ygoGuKyzet0wra1QB0MuX4w/2x0mWD14LNcHeGbyn2juJKgUHBvvsDRoPxUlum1wdn+lNE fxw7/MvP5HtLjq0ExlClpS9N+prkW0s= X-MC-Unique: oDPIH-AHNEm7TvuL867J6A-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: Q-9V5IdCNA64K48KmWnSwg-1 From: Collin Walling To: libvir-list@redhat.com Subject: [PATCH v1 6/9] domain: capabilities: report host-recommended CPU model Date: Mon, 11 Sep 2023 17:07:13 -0400 Message-ID: <20230911210716.75648-7-walling@linux.ibm.com> In-Reply-To: <20230911210716.75648-1-walling@linux.ibm.com> References: <20230911210716.75648-1-walling@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: xADgctp3SHttphnDHpTjZTk0mj8XrGAp X-Proofpoint-GUID: xADgctp3SHttphnDHpTjZTk0mj8XrGAp X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-09-11_16,2023-09-05_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 bulkscore=0 adultscore=0 mlxlogscore=941 spamscore=0 lowpriorityscore=0 clxscore=1015 impostorscore=0 priorityscore=1501 phishscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2308100000 definitions=main-2309110194 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 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.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: linux.ibm.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1694466643941100007 Content-Type: text/plain; charset="utf-8"; x-default="true" Report the host-recommended CPU definition in the domaincapabilities. Currently, only s390x supports this model, but the formatting remains open if other archs decide to support this as well. Signed-off-by: Collin Walling Reviewed-by: Boris Fiuczynski --- src/conf/domain_capabilities.c | 16 +++++++ src/conf/domain_capabilities.h | 1 + src/conf/schemas/domaincaps.rng | 24 ++++++++++ src/qemu/qemu_capabilities.c | 8 ++++ tests/domaincapsdata/qemu_8.1.0.s390x.xml | 55 +++++++++++++++++++++++ 5 files changed, 104 insertions(+) diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index 2fa5756184..4b9019f252 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -450,6 +450,22 @@ virDomainCapsCPUFormat(virBuffer *buf, virBufferAddLit(buf, "supported=3D'no'/>\n"); } =20 + if (cpu->hostRecommended) { + virBufferAsprintf(buf, "hostRecommended) { + virBufferAddLit(buf, "supported=3D'yes'>\n"); + virBufferAdjustIndent(buf, 2); + + virCPUDefFormatBuf(buf, cpu->hostRecommended); + + virBufferAdjustIndent(buf, -2); + virBufferAddLit(buf, "\n"); + } else { + virBufferAddLit(buf, "supported=3D'no'/>\n"); + } + } + virBufferAsprintf(buf, "custom && cpu->custom->nmodels) { diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h index 01bcfa2e39..893101ee97 100644 --- a/src/conf/domain_capabilities.h +++ b/src/conf/domain_capabilities.h @@ -201,6 +201,7 @@ struct _virDomainCapsCPU { bool maximum; virDomainCapsEnum maximumMigratable; virCPUDef *hostModel; + virCPUDef *hostRecommended; virDomainCapsCPUModels *custom; }; =20 diff --git a/src/conf/schemas/domaincaps.rng b/src/conf/schemas/domaincaps.= rng index 99ef148d44..91657555dd 100644 --- a/src/conf/schemas/domaincaps.rng +++ b/src/conf/schemas/domaincaps.rng @@ -93,6 +93,9 @@ + + + @@ -142,6 +145,27 @@ =20 + + + + host-recommended + + + + + + + + + + + + + + + + + diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index d7096a08c2..6ac8aaf248 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -6250,6 +6250,14 @@ virQEMUCapsFillDomainCPUCaps(virQEMUCaps *qemuCaps, domCaps->cpu.custom =3D NULL; } } + + if (virQEMUCapsIsCPUModeSupported(qemuCaps, hostarch, domCaps->virttyp= e, + VIR_CPU_MODE_HOST_RECOMMENDED, + domCaps->machine)) { + virCPUDef *cpu =3D virQEMUCapsGetHostModel(qemuCaps, domCaps->virt= type, + VIR_QEMU_CAPS_HOST_CPU_RE= COMMENDED); + domCaps->cpu.hostRecommended =3D virCPUDefCopy(cpu); + } } =20 =20 diff --git a/tests/domaincapsdata/qemu_8.1.0.s390x.xml b/tests/domaincapsda= ta/qemu_8.1.0.s390x.xml index 37c7c3b8bf..68a456645c 100644 --- a/tests/domaincapsdata/qemu_8.1.0.s390x.xml +++ b/tests/domaincapsdata/qemu_8.1.0.s390x.xml @@ -90,6 +90,61 @@ + + gen16a-base + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + gen16a-base gen16a --=20 2.41.0