From nobody Sun May 5 18:16:57 2024 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; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1600993423; cv=none; d=zohomail.com; s=zohoarc; b=cXrMds3HdnY/j6RbALah0lI6iFJidYeV32UngZONSpqVSQuEOIUs+T8cTh1JBwFgwoRg0YjopXfAWar7obDmeHyijhGhHa47z+8nPyc1Xn/xRFAbn+3PGVT4Xe7ChBXgQ0oijBhRcI3VvRlzN8YhT8aUm1fNgTn/KaBR7A1W+9I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600993423; 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=RZFuLD3awQO5VsCqD8ICyeqLuP30h+rHjrj4o0Du64U=; b=RXyoztsa1mJd2sjU2gkMcNL6uvkLMcYXTDgbnABw9NZ3sqq5K30UZ+MT8vLNzk2wt3e1g3taRwyYvG7d2T5ilRjHNtxbwZtfW8W9HnqZJhv0OlTLY54tWqh0OKq1RSN1QFU9zBaa0uTngd0wWVCmP/oNOWXKJ5yU0gWGkeHfLxY= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail 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 1600993423817489.1234875561639; Thu, 24 Sep 2020 17:23:43 -0700 (PDT) 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-219-2mK5EVHLNPW6VbemCamtWg-1; Thu, 24 Sep 2020 20:23:40 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 74F1D85EE95; Fri, 25 Sep 2020 00:23:34 +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 4ECF31A4D7; Fri, 25 Sep 2020 00:23:34 +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 164731826D32; Fri, 25 Sep 2020 00:23:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08P0NWPB006353 for ; Thu, 24 Sep 2020 20:23:32 -0400 Received: by smtp.corp.redhat.com (Postfix) id E9CCD100BCA5; Fri, 25 Sep 2020 00:23:31 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E1875109EF96 for ; Fri, 25 Sep 2020 00:23:29 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9A949811E79 for ; Fri, 25 Sep 2020 00:23:29 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-228-d79vUnSqNLOO10FkLADwaQ-1; Thu, 24 Sep 2020 20:23:05 -0400 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 08P01gHK125858; Thu, 24 Sep 2020 20:23:04 -0400 Received: from ppma03wdc.us.ibm.com (ba.79.3fa9.ip4.static.sl-reverse.com [169.63.121.186]) by mx0b-001b2d01.pphosted.com with ESMTP id 33s4aq23xs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 24 Sep 2020 20:23:04 -0400 Received: from pps.filterd (ppma03wdc.us.ibm.com [127.0.0.1]) by ppma03wdc.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 08P0BmS3011039; Fri, 25 Sep 2020 00:23:04 GMT Received: from b03cxnp08025.gho.boulder.ibm.com (b03cxnp08025.gho.boulder.ibm.com [9.17.130.17]) by ppma03wdc.us.ibm.com with ESMTP id 33n9m9mn7e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 25 Sep 2020 00:23:04 +0000 Received: from b03ledav005.gho.boulder.ibm.com (b03ledav005.gho.boulder.ibm.com [9.17.130.236]) by b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 08P0Mx2v60555666 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 25 Sep 2020 00:22:59 GMT Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4856DBE051; Fri, 25 Sep 2020 00:23:03 +0000 (GMT) Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CDD92BE04F; Fri, 25 Sep 2020 00:23:02 +0000 (GMT) Received: from localhost.localdomain.com (unknown [9.85.153.71]) by b03ledav005.gho.boulder.ibm.com (Postfix) with ESMTP; Fri, 25 Sep 2020 00:23:02 +0000 (GMT) X-MC-Unique: 2mK5EVHLNPW6VbemCamtWg-1 X-MC-Unique: d79vUnSqNLOO10FkLADwaQ-1 From: Collin Walling To: libvir-list@redhat.com Subject: [PATCH v2 1/5] qemu: check for model-expansion cap before baselining Date: Thu, 24 Sep 2020 20:22:35 -0400 Message-Id: <20200925002239.61628-2-walling@linux.ibm.com> In-Reply-To: <20200925002239.61628-1-walling@linux.ibm.com> References: <20200925002239.61628-1-walling@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-09-24_18:2020-09-24, 2020-09-24 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 malwarescore=0 phishscore=0 mlxlogscore=588 priorityscore=1501 mlxscore=0 suspectscore=1 adultscore=0 lowpriorityscore=0 spamscore=0 bulkscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009240170 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 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Cc: jdenemar@redhat.com, twiederh@redhat.com 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.84 on 10.5.11.23 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 Content-Type: text/plain; charset="utf-8" Hypervisor-cpu-baseline requires the cpu-model-expansion capability when expanding CPU model features if the --features flag is provided. Signed-off-by: Collin Walling Reviewed-by: Jiri Denemark --- src/qemu/qemu_driver.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 1cecef01f7..0b68b33af8 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -12563,7 +12563,8 @@ qemuConnectBaselineHypervisorCPU(virConnectPtr conn, (const char **)features, migratable))) goto cleanup; } else if (ARCH_IS_S390(arch) && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_QUERY_CPU_MODEL_BASELINE= )) { + virQEMUCapsGet(qemuCaps, QEMU_CAPS_QUERY_CPU_MODEL_BASELINE= ) && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_QUERY_CPU_MODEL_EXPANSIO= N)) { bool expand_features =3D (flags & VIR_CONNECT_BASELINE_CPU_EXPAND_= FEATURES); =20 if (!(cpu =3D qemuConnectCPUModelBaseline(qemuCaps, cfg->libDir, --=20 2.26.2 From nobody Sun May 5 18:16:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1600993409; cv=none; d=zohomail.com; s=zohoarc; b=n65n4KWNoD1lNiPKQfCrzWEscH5BQFltbE0n+Y3v3UIWoKhUniFhHz8e/Y9TvYmRcz6MeNYyqgxLAy6abXWzxnHAiX7/gcfa2wTkBJOogMirZUbMVk6Q4b2KAjOEZIOtKqtktKMz5oAChXmIInxo4BDZVY8j3HFJhmgFllvMlp4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600993409; 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=UHrsVjZltS5pVMLhjMoj8SphqGtg8lAdygHBORzs4hY=; b=HiK9EQbYb5bU9/D4AXUcMAQabod3ZF0+bgLOtSaREijSFJAync1pxa8ELnPYPxYYDnRpjw4E2VVoRaMPy5qw8UkkyiOmsT7xlP6AgYVXwEFN7ta9iHG23j2G4Ii6xv1r8wnanOuQpSS+pgLfLUAiKhIyfE/w/qsB4YQXz38XivQ= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1600993409263863.9516398150117; Thu, 24 Sep 2020 17:23:29 -0700 (PDT) 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-516-OXrvbgTYP5G-E4vOftzzDQ-1; Thu, 24 Sep 2020 20:23:25 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A5203805EE4; Fri, 25 Sep 2020 00:23:19 +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 D4CE47368C; Fri, 25 Sep 2020 00:23:17 +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 2426D1826D2B; Fri, 25 Sep 2020 00:23:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08P0NBU4006279 for ; Thu, 24 Sep 2020 20:23:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3E517100BCA3; Fri, 25 Sep 2020 00:23:11 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 39399100BFEC for ; Fri, 25 Sep 2020 00:23:09 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E0C2C186E120 for ; Fri, 25 Sep 2020 00:23:08 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-132-tyZ3sdOwMxmUWxQxmBkK4Q-1; Thu, 24 Sep 2020 20:23:06 -0400 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 08P02MKh191785; Thu, 24 Sep 2020 20:23:05 -0400 Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0b-001b2d01.pphosted.com with ESMTP id 33s4g9svrv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 24 Sep 2020 20:23:05 -0400 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 08P0D8rR008910; Fri, 25 Sep 2020 00:23:05 GMT Received: from b03cxnp08025.gho.boulder.ibm.com (b03cxnp08025.gho.boulder.ibm.com [9.17.130.17]) by ppma02dal.us.ibm.com with ESMTP id 33n9m9yqry-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 25 Sep 2020 00:23:05 +0000 Received: from b03ledav005.gho.boulder.ibm.com (b03ledav005.gho.boulder.ibm.com [9.17.130.236]) by b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 08P0N0Q861473116 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 25 Sep 2020 00:23:00 GMT Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DBE13BE054; Fri, 25 Sep 2020 00:23:03 +0000 (GMT) Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 671E6BE04F; Fri, 25 Sep 2020 00:23:03 +0000 (GMT) Received: from localhost.localdomain.com (unknown [9.85.153.71]) by b03ledav005.gho.boulder.ibm.com (Postfix) with ESMTP; Fri, 25 Sep 2020 00:23:03 +0000 (GMT) X-MC-Unique: OXrvbgTYP5G-E4vOftzzDQ-1 X-MC-Unique: tyZ3sdOwMxmUWxQxmBkK4Q-1 From: Collin Walling To: libvir-list@redhat.com Subject: [PATCH v2 2/5] qemu: fix one instance of rc check styling in baseline Date: Thu, 24 Sep 2020 20:22:36 -0400 Message-Id: <20200925002239.61628-3-walling@linux.ibm.com> In-Reply-To: <20200925002239.61628-1-walling@linux.ibm.com> References: <20200925002239.61628-1-walling@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-09-24_18:2020-09-24, 2020-09-24 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 adultscore=0 mlxlogscore=883 mlxscore=0 impostorscore=0 lowpriorityscore=0 malwarescore=0 priorityscore=1501 clxscore=1015 suspectscore=1 phishscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009240170 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 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Cc: jdenemar@redhat.com, twiederh@redhat.com 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.13 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 Content-Type: text/plain; charset="utf-8" Signed-off-by: Collin Walling Reviewed-by: Jiri Denemark --- src/qemu/qemu_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 0b68b33af8..92684a9876 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -12470,7 +12470,7 @@ qemuConnectCPUModelBaseline(virQEMUCapsPtr qemuCaps, if (VIR_ALLOC(baseline) < 0) return NULL; =20 - if (virCPUDefCopyModel(baseline, cpus[0], false)) + if (virCPUDefCopyModel(baseline, cpus[0], false) < 0) return NULL; =20 for (i =3D 1; i < ncpus; i++) { --=20 2.26.2 From nobody Sun May 5 18:16:57 2024 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; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1600993420; cv=none; d=zohomail.com; s=zohoarc; b=Ip5JidtxkuYP33f7L1V7OpNMhRGtu5+rbrrvfaytwt8/lX4IqDEncuQ6GWJYF2v7TTL2Vbv6UjLS3aMVEMbMYLDYZhG4ON1j7T8mWdbZ92e/fuO02whkMf4OUlTySSVGJHP9Lzpx1zicF6D4xoIXvArgaelJtaYK9kc8e3JzkSw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600993420; 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=TdnvSR+vIsfo1OvlkHPPzSkvAni1z+m6t9TAJivNZmA=; b=i4LgcSy7tqCzCvbqSmNyAgaQjt7Ttixteoi5Ami9AMUu3Xxm6E0WUCAwnXGBdqN3B9BL4SLVToIerthDDfRi3dX+8cys7RGPyP+lnp+pS8AF0g6ZzzYq2N25QTBK61Arx6qu535h1zDOazmScW8CQ4FQoYsTlUPMlZWO359I9YA= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail 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 1600993420730668.951573610818; Thu, 24 Sep 2020 17:23:40 -0700 (PDT) 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-477-pkTMmmREOnuCL_JGbZy_5g-1; Thu, 24 Sep 2020 20:23:37 -0400 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 D4BAA81F007; Fri, 25 Sep 2020 00:23:31 +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 AF9415C1DC; Fri, 25 Sep 2020 00:23:31 +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 7AE241826D30; Fri, 25 Sep 2020 00:23:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08P0NEHT006309 for ; Thu, 24 Sep 2020 20:23:14 -0400 Received: by smtp.corp.redhat.com (Postfix) id 47FDF119005; Fri, 25 Sep 2020 00:23:14 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 430AF1182F3 for ; Fri, 25 Sep 2020 00:23:12 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 16A89811E78 for ; Fri, 25 Sep 2020 00:23:12 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-412-ZF62JVYAOJKBtA8k0E2vPA-1; Thu, 24 Sep 2020 20:23:07 -0400 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 08P01UdQ011673; Thu, 24 Sep 2020 20:23:06 -0400 Received: from ppma01dal.us.ibm.com (83.d6.3fa9.ip4.static.sl-reverse.com [169.63.214.131]) by mx0a-001b2d01.pphosted.com with ESMTP id 33s5j3gku2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 24 Sep 2020 20:23:06 -0400 Received: from pps.filterd (ppma01dal.us.ibm.com [127.0.0.1]) by ppma01dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 08P0Ck5K031284; Fri, 25 Sep 2020 00:23:05 GMT Received: from b03cxnp08026.gho.boulder.ibm.com (b03cxnp08026.gho.boulder.ibm.com [9.17.130.18]) by ppma01dal.us.ibm.com with ESMTP id 33n9ma7qkj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 25 Sep 2020 00:23:05 +0000 Received: from b03ledav005.gho.boulder.ibm.com (b03ledav005.gho.boulder.ibm.com [9.17.130.236]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 08P0MwwB66126130 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 25 Sep 2020 00:22:58 GMT Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 547A0BE051; Fri, 25 Sep 2020 00:23:04 +0000 (GMT) Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 00F78BE04F; Fri, 25 Sep 2020 00:23:04 +0000 (GMT) Received: from localhost.localdomain.com (unknown [9.85.153.71]) by b03ledav005.gho.boulder.ibm.com (Postfix) with ESMTP; Fri, 25 Sep 2020 00:23:03 +0000 (GMT) X-MC-Unique: pkTMmmREOnuCL_JGbZy_5g-1 X-MC-Unique: ZF62JVYAOJKBtA8k0E2vPA-1 From: Collin Walling To: libvir-list@redhat.com Subject: [PATCH v2 3/5] qemu: report error if missing model name when baselining Date: Thu, 24 Sep 2020 20:22:37 -0400 Message-Id: <20200925002239.61628-4-walling@linux.ibm.com> In-Reply-To: <20200925002239.61628-1-walling@linux.ibm.com> References: <20200925002239.61628-1-walling@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-09-24_18:2020-09-24, 2020-09-24 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 impostorscore=0 spamscore=0 mlxscore=0 malwarescore=0 adultscore=0 priorityscore=1501 phishscore=0 bulkscore=0 clxscore=1015 suspectscore=1 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009240170 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 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: jdenemar@redhat.com, twiederh@redhat.com 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 Content-Type: text/plain; charset="utf-8" When executing the hypervisor-cpu-baseline command and the XML file contains a CPU definition without a model name, or an invalid CPU definition, then the commands will fail and return an error message from the QMP response. Let's clean this up by checking for a valid definition and presence of a model name. This code is copied from virCPUBaseline. Signed-off-by: Collin Walling Reviewed-by: Jiri Denemark --- src/qemu/qemu_driver.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 92684a9876..1c5b1dcfee 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -12460,6 +12460,19 @@ qemuConnectCPUModelBaseline(virQEMUCapsPtr qemuCap= s, qemuMonitorCPUModelInfoPtr result =3D NULL; size_t i; =20 + for (i =3D 0; i < ncpus; i++) { + if (!cpus[i]) { + virReportError(VIR_ERR_INVALID_ARG, + _("invalid CPU definition at index %zu"), i); + return NULL; + } + if (!cpus[i]->model) { + virReportError(VIR_ERR_INVALID_ARG, + _("no CPU model specified at index %zu"), i); + return NULL; + } + } + if (!(proc =3D qemuProcessQMPNew(virQEMUCapsGetBinary(qemuCaps), libDir, runUid, runGid, false))) return NULL; --=20 2.26.2 From nobody Sun May 5 18:16:57 2024 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; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1600993408; cv=none; d=zohomail.com; s=zohoarc; b=TdSh9A4Mxoz6NO5vJEev18szDW+h6FQ35ip96Q8Rz6gtprzGyc0PWZeoNVgeY2KVgy910ihHOndGFf8Z+G0viQ9ULYOxZLQnCgqDD33/wX7wf/ExPm2I9311uV+E+gk7WW8grDSEtjRylZoEXothNGQLk86+Pt01QvxVKqNrnL8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600993408; 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=DVQL/yz+4aIahrMUDPscAAbouXZYl5wVpROKT+Z0iIc=; b=Cy4+AFcTLhPC6y+hYZNaiVBMoJtscN2Dpyk8hUe3+Oqlq5SYe0GXS864eNHnu3tIa1bCZbl4lLbW4WWmeL8zV2Zf962PIo0fYsynUawR6d33HfGgZJi5NCFtZte2JBaVkFnavNa+XvLohkC54ydIzC8c1MQSrtYcAskARsdFuJI= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail 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 1600993408941116.13866056275333; Thu, 24 Sep 2020 17:23:28 -0700 (PDT) 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-395-vBFoHO8POtWhaftU7ammeQ-1; Thu, 24 Sep 2020 20:23:24 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B9F3C1DE13; Fri, 25 Sep 2020 00:23:18 +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 D4C677368B; Fri, 25 Sep 2020 00:23:17 +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 23CBE1826D29; Fri, 25 Sep 2020 00:23:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08P0NBVP006278 for ; Thu, 24 Sep 2020 20:23:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3E71E100BCA5; Fri, 25 Sep 2020 00:23:11 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 38839100BFE9 for ; Fri, 25 Sep 2020 00:23:09 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D8019811E79 for ; Fri, 25 Sep 2020 00:23:09 +0000 (UTC) Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-211-LG1O2gKzOTqWmXz5ddRbmQ-1; Thu, 24 Sep 2020 20:23:07 -0400 Received: from pps.filterd (m0127361.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 08P01cB4177005; Thu, 24 Sep 2020 20:23:07 -0400 Received: from ppma04wdc.us.ibm.com (1a.90.2fa9.ip4.static.sl-reverse.com [169.47.144.26]) by mx0a-001b2d01.pphosted.com with ESMTP id 33s5kw0fkv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 24 Sep 2020 20:23:06 -0400 Received: from pps.filterd (ppma04wdc.us.ibm.com [127.0.0.1]) by ppma04wdc.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 08P0CBXe006142; Fri, 25 Sep 2020 00:23:05 GMT Received: from b03cxnp08026.gho.boulder.ibm.com (b03cxnp08026.gho.boulder.ibm.com [9.17.130.18]) by ppma04wdc.us.ibm.com with ESMTP id 33r5e8ns8y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 25 Sep 2020 00:23:05 +0000 Received: from b03ledav005.gho.boulder.ibm.com (b03ledav005.gho.boulder.ibm.com [9.17.130.236]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 08P0MxZZ48431554 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 25 Sep 2020 00:22:59 GMT Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C900ABE054; Fri, 25 Sep 2020 00:23:04 +0000 (GMT) Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6E2F1BE04F; Fri, 25 Sep 2020 00:23:04 +0000 (GMT) Received: from localhost.localdomain.com (unknown [9.85.153.71]) by b03ledav005.gho.boulder.ibm.com (Postfix) with ESMTP; Fri, 25 Sep 2020 00:23:04 +0000 (GMT) X-MC-Unique: vBFoHO8POtWhaftU7ammeQ-1 X-MC-Unique: LG1O2gKzOTqWmXz5ddRbmQ-1 From: Collin Walling To: libvir-list@redhat.com Subject: [PATCH v2 4/5] qemu: check if cpu model is supported before baselining Date: Thu, 24 Sep 2020 20:22:38 -0400 Message-Id: <20200925002239.61628-5-walling@linux.ibm.com> In-Reply-To: <20200925002239.61628-1-walling@linux.ibm.com> References: <20200925002239.61628-1-walling@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-09-24_18:2020-09-24, 2020-09-24 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 spamscore=0 bulkscore=0 impostorscore=0 priorityscore=1501 suspectscore=1 malwarescore=0 lowpriorityscore=0 mlxlogscore=610 phishscore=0 clxscore=1015 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009240170 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 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Cc: jdenemar@redhat.com, twiederh@redhat.com 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.13 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 Content-Type: text/plain; charset="utf-8" Check the provided CPU models against the CPU models known by the hypervisor before baselining and print an error if an unrecognized model is found. Signed-off-by: Collin Walling Reviewed-by: Jiri Denemark --- src/qemu/qemu_driver.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 1c5b1dcfee..fe572b13e1 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -12453,12 +12453,13 @@ qemuConnectCPUModelBaseline(virQEMUCapsPtr qemuCa= ps, gid_t runGid, bool expand_features, virCPUDefPtr *cpus, - int ncpus) + int ncpus, + virDomainCapsCPUModelsPtr cpuModels) { g_autoptr(qemuProcessQMP) proc =3D NULL; g_autoptr(virCPUDef) baseline =3D NULL; qemuMonitorCPUModelInfoPtr result =3D NULL; - size_t i; + size_t i, j; =20 for (i =3D 0; i < ncpus; i++) { if (!cpus[i]) { @@ -12471,6 +12472,16 @@ qemuConnectCPUModelBaseline(virQEMUCapsPtr qemuCap= s, _("no CPU model specified at index %zu"), i); return NULL; } + for (j =3D 0; j < cpuModels->nmodels; j++) { + if (STREQ(cpus[i]->model, cpuModels->models[j].name)) + break; + } + if (j =3D=3D cpuModels->nmodels) { + virReportError(VIR_ERR_INVALID_ARG, + _("CPU model '%s' not supported by hypervisor"), + cpus[i]->model); + return NULL; + } } =20 if (!(proc =3D qemuProcessQMPNew(virQEMUCapsGetBinary(qemuCaps), @@ -12582,7 +12593,8 @@ qemuConnectBaselineHypervisorCPU(virConnectPtr conn, =20 if (!(cpu =3D qemuConnectCPUModelBaseline(qemuCaps, cfg->libDir, cfg->user, cfg->group, - expand_features, cpus, ncp= us))) + expand_features, cpus, ncp= us, + cpuModels))) goto cleanup; } else { virReportError(VIR_ERR_OPERATION_UNSUPPORTED, --=20 2.26.2 From nobody Sun May 5 18:16:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1600993420; cv=none; d=zohomail.com; s=zohoarc; b=fEALWvspCvXy8P693NSZvQV/v+QT4YbNhwKamGvXocjhORpZSMsKgLRniPJ0PJgz34tDYdhFIujBDtzAOugg6idZ4P1L1NvvxLqe7Vzh46TWrKgETCDeS5Q0rPukXyT3cyruy/SsnXhYq00IDmw9fSzgzelCMK+aANU1GVURzHY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600993420; 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=ZymoePT34iiSpznM55YEmulCuqkslfVy/z5mW8r5Awo=; b=G3FHGntlyxRRku1vLs2jla9UWC+6N2RgTlC9HXoGNEqZhF6eie70Dzp2+CJ6jG+/ipEIKa7AHlDyc3/u8R9xa5IYKOM1xceyTQutxIaG3TREj0WnGmQBBwBi3az0QzF0EL6GGl9XeGQqNLBxh5CPaEo5riiVCuHB3lZa3Qy/dDc= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 160099342097577.66061535063966; Thu, 24 Sep 2020 17:23:40 -0700 (PDT) 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-344-3b59fcrgNcWVDrEFvbCjPg-1; Thu, 24 Sep 2020 20:23:36 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D0E3A1005E7C; Fri, 25 Sep 2020 00:23:31 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id ACFBE7368B; Fri, 25 Sep 2020 00:23:31 +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 7AA428C7A2; Fri, 25 Sep 2020 00:23:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08P0NBDF006289 for ; Thu, 24 Sep 2020 20:23:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id A809D100BFE9; Fri, 25 Sep 2020 00:23:11 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A36D9100BCBE for ; Fri, 25 Sep 2020 00:23:11 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8A309858294 for ; Fri, 25 Sep 2020 00:23:11 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-247-ILtaznVcNhyvzbD8HizADg-1; Thu, 24 Sep 2020 20:23:09 -0400 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 08P02qib045074; Thu, 24 Sep 2020 20:23:07 -0400 Received: from ppma03wdc.us.ibm.com (ba.79.3fa9.ip4.static.sl-reverse.com [169.63.121.186]) by mx0a-001b2d01.pphosted.com with ESMTP id 33s4xhhbb8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 24 Sep 2020 20:23:07 -0400 Received: from pps.filterd (ppma03wdc.us.ibm.com [127.0.0.1]) by ppma03wdc.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 08P0BmZT011042; Fri, 25 Sep 2020 00:23:06 GMT Received: from b03cxnp08027.gho.boulder.ibm.com (b03cxnp08027.gho.boulder.ibm.com [9.17.130.19]) by ppma03wdc.us.ibm.com with ESMTP id 33n9m9mn7n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 25 Sep 2020 00:23:06 +0000 Received: from b03ledav005.gho.boulder.ibm.com (b03ledav005.gho.boulder.ibm.com [9.17.130.236]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 08P0N1nW24969834 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 25 Sep 2020 00:23:01 GMT Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 71990BE051; Fri, 25 Sep 2020 00:23:05 +0000 (GMT) Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E190ABE04F; Fri, 25 Sep 2020 00:23:04 +0000 (GMT) Received: from localhost.localdomain.com (unknown [9.85.153.71]) by b03ledav005.gho.boulder.ibm.com (Postfix) with ESMTP; Fri, 25 Sep 2020 00:23:04 +0000 (GMT) X-MC-Unique: 3b59fcrgNcWVDrEFvbCjPg-1 X-MC-Unique: ILtaznVcNhyvzbD8HizADg-1 From: Collin Walling To: libvir-list@redhat.com Subject: [PATCH v2 5/5] qemu: fix error message when baselining with a single cpu Date: Thu, 24 Sep 2020 20:22:39 -0400 Message-Id: <20200925002239.61628-6-walling@linux.ibm.com> In-Reply-To: <20200925002239.61628-1-walling@linux.ibm.com> References: <20200925002239.61628-1-walling@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-09-24_18:2020-09-24, 2020-09-24 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 clxscore=1015 malwarescore=0 phishscore=0 impostorscore=0 bulkscore=0 adultscore=0 priorityscore=1501 mlxlogscore=865 lowpriorityscore=0 spamscore=0 suspectscore=1 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009240174 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 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Cc: jdenemar@redhat.com, twiederh@redhat.com 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.13 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 Content-Type: text/plain; charset="utf-8" When executing the hypervisor-cpu-baseline command and if there is only a single CPU definition present in the XML file, then libvirt will print an unhelpful message: "error: An error occurred, but the cause is unknown" This is due to no CPU definition ever being "baselined", since the API expects at least two CPU models. Let's fix this by performing a CPU model expansion on the single CPU definition and returning the result to the caller. This will also ensure the CPU model is sane. Signed-off-by: Collin Walling Reviewed-by: Jiri Denemark --- src/qemu/qemu_driver.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index fe572b13e1..bc823fc585 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -12459,6 +12459,7 @@ qemuConnectCPUModelBaseline(virQEMUCapsPtr qemuCaps, g_autoptr(qemuProcessQMP) proc =3D NULL; g_autoptr(virCPUDef) baseline =3D NULL; qemuMonitorCPUModelInfoPtr result =3D NULL; + qemuMonitorCPUModelExpansionType expansion_type; size_t i, j; =20 for (i =3D 0; i < ncpus; i++) { @@ -12506,9 +12507,11 @@ qemuConnectCPUModelBaseline(virQEMUCapsPtr qemuCap= s, return NULL; } =20 - if (expand_features) { - if (qemuMonitorGetCPUModelExpansion(proc->mon, - QEMU_MONITOR_CPU_MODEL_EXPANSI= ON_FULL, + if (expand_features || ncpus =3D=3D 1) { + expansion_type =3D expand_features ? QEMU_MONITOR_CPU_MODEL_EXPANS= ION_FULL + : QEMU_MONITOR_CPU_MODEL_EXPANSIO= N_STATIC; + + if (qemuMonitorGetCPUModelExpansion(proc->mon, expansion_type, baseline, true, false, &result= ) < 0) return NULL; =20 --=20 2.26.2