From nobody Sun May 5 06:24:46 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1511510537920465.85387047615575; Fri, 24 Nov 2017 00:02:17 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 61A2DC059726; Fri, 24 Nov 2017 08:02:16 +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 B7CEC600C0; Fri, 24 Nov 2017 08:02:15 +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 B35E14BB79; Fri, 24 Nov 2017 08:02:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id vAO82D6F001828 for ; Fri, 24 Nov 2017 03:02:13 -0500 Received: by smtp.corp.redhat.com (Postfix) id 7D944600D5; Fri, 24 Nov 2017 08:02:13 +0000 (UTC) Received: from mx1.redhat.com (ext-mx05.extmail.prod.ext.phx2.redhat.com [10.5.110.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 77451600C0 for ; Fri, 24 Nov 2017 08:02:10 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 45199A7E7 for ; Fri, 24 Nov 2017 08:02:09 +0000 (UTC) Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id vAO7xQee106304 for ; Fri, 24 Nov 2017 03:02:08 -0500 Received: from e06smtp13.uk.ibm.com (e06smtp13.uk.ibm.com [195.75.94.109]) by mx0b-001b2d01.pphosted.com with ESMTP id 2eeeu3tan3-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 24 Nov 2017 03:02:08 -0500 Received: from localhost by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 24 Nov 2017 08:02:06 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp13.uk.ibm.com (192.168.101.143) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 24 Nov 2017 08:02:03 -0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id vAO822VV16515098; Fri, 24 Nov 2017 08:02:03 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B9D544C05E; Fri, 24 Nov 2017 07:57:05 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9CD464C050; Fri, 24 Nov 2017 07:57:05 +0000 (GMT) Received: from fiuczyvm.boeblingen.de.ibm.com (unknown [9.152.222.110]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 24 Nov 2017 07:57:05 +0000 (GMT) From: Boris Fiuczynski To: libvir-list@redhat.com Date: Fri, 24 Nov 2017 09:02:02 +0100 X-TM-AS-GCONF: 00 x-cbid: 17112408-0012-0000-0000-00000591145B X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17112408-0013-0000-0000-0000190BEEBC Message-Id: <20171124080202.8027-1-fiuczy@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-11-24_02:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1711240107 X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 207 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 24 Nov 2017 08:02:09 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 24 Nov 2017 08:02:09 +0000 (UTC) for IP:'148.163.158.5' DOMAIN:'mx0b-001b2d01.pphosted.com' HELO:'mx0a-001b2d01.pphosted.com' FROM:'fiuczy@linux.vnet.ibm.com' RCPT:'' X-RedHat-Spam-Score: -0.701 (RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2) 148.163.158.5 mx0b-001b2d01.pphosted.com 148.163.158.5 mx0b-001b2d01.pphosted.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.29 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: jjherne@linux.vnet.ibm.com Subject: [libvirt] [PATCH] s390: qemu-capabilities: Avoid error message when missing non-kvm host cpu info 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 24 Nov 2017 08:02:17 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: "Jason J. Herne" Libvirt prints an error on startup when it is missing host cpu model information for any queried qemu binary. On s390 we only have host cpu model information for kvm enabled qemu instances. So when virt type is not kvm, t= his is actually not an error on s390. This patch adds virt type as a parameter to virQEMUCapsInitCPUModelS390, an= d a new return code 2 for virQEMUCapsInitCPUModel and virQEMUCapsInitCPUModelS3= 90. If the virt type is not kvm then we skip printing the scary error message and return 2 because this case is actually expected behavior. The new return code is meant to differentiate between the failure case and the case where = we simply expect the cpu model information to be unattainable. Signed-off-by: Jason J. Herne Reviewed-by: Boris Fiuczynski Reviewed-by: Marc Hartmayer --- src/qemu/qemu_capabilities.c | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 3adea66..b073841 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -3306,22 +3306,28 @@ virQEMUCapsCPUFilterFeatures(const char *name, /** * Returns 0 when host CPU model provided by QEMU was filled in qemuCaps, * 1 when the caller should fall back to using virCapsPtr->host.c= pu, + * 2 when cpu model info is not supported for this configuration = and + * fall back should not be used. * -1 on error. */ static int virQEMUCapsInitCPUModelS390(virQEMUCapsPtr qemuCaps, qemuMonitorCPUModelInfoPtr modelInfo, virCPUDefPtr cpu, - bool migratable) + bool migratable, + virDomainVirtType type) { size_t i; =20 if (!modelInfo) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("missing host CPU model info from QEMU capabiliti= es " - "for binary %s"), - qemuCaps->binary); - return -1; + if (type =3D=3D VIR_DOMAIN_VIRT_KVM) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("missing host CPU model info from QEMU " + "capabilities for binary %s"), + qemuCaps->binary); + return -1; + } + return 2; } =20 if (VIR_STRDUP(cpu->model, modelInfo->name) < 0 || @@ -3429,6 +3435,8 @@ virQEMUCapsInitCPUModelX86(virQEMUCapsPtr qemuCaps, /** * Returns 0 when host CPU model provided by QEMU was filled in qemuCaps, * 1 when the caller should fall back to other methods + * 2 when cpu model info is not supported for this configuration = and + * fall back should not be used. * -1 on error. */ int @@ -3445,13 +3453,13 @@ virQEMUCapsInitCPUModel(virQEMUCapsPtr qemuCaps, =20 if (ARCH_IS_S390(qemuCaps->arch)) { ret =3D virQEMUCapsInitCPUModelS390(qemuCaps, cpuData->info, - cpu, migratable); + cpu, migratable, type); } else if (ARCH_IS_X86(qemuCaps->arch)) { ret =3D virQEMUCapsInitCPUModelX86(qemuCaps, type, cpuData->info, cpu, migratable); } =20 - if (ret =3D=3D 0) + if (ret =3D=3D 0 || ret =3D=3D 2) cpu->fallback =3D VIR_CPU_FALLBACK_FORBID; =20 return ret; @@ -3504,6 +3512,12 @@ virQEMUCapsInitHostCPUModel(virQEMUCapsPtr qemuCaps, virQEMUCapsCPUFilterFeatures, &qemuCaps->arch) < 0) goto error; + } else if (rc =3D=3D 2) { + VIR_DEBUG("Qemu does not provide cpu model for arch=3D%s virttype= =3D%s", + virArchToString(qemuCaps->arch), + virDomainVirtTypeToString(type)); + virCPUDefFree(cpu); + goto cleanup; } else if (type =3D=3D VIR_DOMAIN_VIRT_KVM && virCPUGetHostIsSupported(qemuCaps->arch)) { if (!(fullCPU =3D virCPUGetHost(qemuCaps->arch, VIR_CPU_TYPE_GUEST, --=20 2.9.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list