From nobody Fri Mar 29 14:51:37 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; dmarc=fail(p=none dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1565274510; cv=none; d=zoho.com; s=zohoarc; b=FcEcUEoAX8THYXSrSyLrrOjzXEjCpXMZTt5EOkxdn/6n9Q3GOWs7HSzHZU0bkxvr7PPw6uMMUEUup/8rIbsPuTJwtaAqKLHysHYrMw5zsEqgn3XFz9wmfx9zs8LOsvvSPu3EXRlQc1At0vW4libaU6ndAbq3eBmCz44D5uiLegQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565274510; 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:ARC-Authentication-Results; bh=N13pD7edoO7uO+JEkd3ZfBOI3im/gJNBhUsbK+yOSbo=; b=KumN+i7GZGBOBI8bA7MHXE70N/XYkBbRvf8BCISVGBcpd6JUGjJQqCDzjbXHqYoSTLJ+aVqDQg7MIoKqNsm+tCDDwYzFsCFwhC1nv5T/YeyMtBVBWVHU8Bwfxp2z7BvRP2TgfciXWRy1VPdgcUAOkxHOnsNsNbV3IKw4ktlTH1U= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1565274510119199.26662706982063; Thu, 8 Aug 2019 07:28:30 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id EDFAC30EA1B6; Thu, 8 Aug 2019 14:28:28 +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 9552A5C226; Thu, 8 Aug 2019 14:28:28 +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 2085F62D11; Thu, 8 Aug 2019 14:28:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x78EQhM2017442 for ; Thu, 8 Aug 2019 10:26:44 -0400 Received: by smtp.corp.redhat.com (Postfix) id E4AFE5C21F; Thu, 8 Aug 2019 14:26:43 +0000 (UTC) Received: from mx1.redhat.com (ext-mx18.extmail.prod.ext.phx2.redhat.com [10.5.110.47]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DE54A5C226 for ; Thu, 8 Aug 2019 14:26:41 +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 0548330A76BE for ; Thu, 8 Aug 2019 14:26:41 +0000 (UTC) Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x78EOnK6028816 for ; Thu, 8 Aug 2019 10:26:40 -0400 Received: from ppma04dal.us.ibm.com (7a.29.35a9.ip4.static.sl-reverse.com [169.53.41.122]) by mx0a-001b2d01.pphosted.com with ESMTP id 2u8nftr1ur-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 08 Aug 2019 10:26:40 -0400 Received: from pps.filterd (ppma04dal.us.ibm.com [127.0.0.1]) by ppma04dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id x78E7IsH003145 for ; Thu, 8 Aug 2019 14:26:39 GMT Received: from b03cxnp08028.gho.boulder.ibm.com (b03cxnp08028.gho.boulder.ibm.com [9.17.130.20]) by ppma04dal.us.ibm.com with ESMTP id 2u51w77j4n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 08 Aug 2019 14:26:39 +0000 Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x78EQbur63504738 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 8 Aug 2019 14:26:37 GMT Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7975B7808D; Thu, 8 Aug 2019 14:26:37 +0000 (GMT) Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DCAC97806E; Thu, 8 Aug 2019 14:26:36 +0000 (GMT) Received: from maxibm.br.ibm.com (unknown [9.18.235.190]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTP; Thu, 8 Aug 2019 14:26:36 +0000 (GMT) From: "Maxiwell S. Garcia" To: libvir-list@redhat.com Date: Thu, 8 Aug 2019 11:26:30 -0300 Message-Id: <20190808142630.23115-1-maxiwell@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-08-08_06:, , 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=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=869 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1908080145 X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Thu, 08 Aug 2019 14:26:41 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Thu, 08 Aug 2019 14:26:41 +0000 (UTC) for IP:'148.163.158.5' DOMAIN:'mx0b-001b2d01.pphosted.com' HELO:'mx0a-001b2d01.pphosted.com' FROM:'maxiwell@linux.ibm.com' RCPT:'' X-RedHat-Spam-Score: -0.7 (RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS) 148.163.158.5 mx0b-001b2d01.pphosted.com 148.163.158.5 mx0b-001b2d01.pphosted.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.47 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: "Maxiwell S. Garcia" Subject: [libvirt] [PATCH v2] qemu: check if numa cell's cpu range match with cpu topology count 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: , 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Thu, 08 Aug 2019 14:28:29 +0000 (UTC) Content-Type: text/plain; charset="utf-8" QEMU shows a warning message if partial NUMA mapping is set. This patch adds a warning message in libvirt when editing the XML. It must be an error in future, when QEMU remove this ability. Signed-off-by: Maxiwell S. Garcia Reviewed-by: Michal Privoznik --- src/qemu/qemu_domain.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 0555caa6ab..62dd428fca 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4621,15 +4621,24 @@ qemuDomainDefValidate(const virDomainDef *def, if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_QUERY_HOTPLUGGABLE_CPUS)) { unsigned int topologycpus; unsigned int granularity; + unsigned int numacpus; =20 /* Starting from QEMU 2.5, max vCPU count and overall vCPU topology * must agree. We only actually enforce this with QEMU 2.7+, due * to the capability check above */ - if (virDomainDefGetVcpusTopology(def, &topologycpus) =3D=3D 0 && - topologycpus !=3D virDomainDefGetVcpusMax(def)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("CPU topology doesn't match maximum vcpu coun= t")); - goto cleanup; + if (virDomainDefGetVcpusTopology(def, &topologycpus) =3D=3D 0) { + if (topologycpus !=3D virDomainDefGetVcpusMax(def)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("CPU topology doesn't match maximum vcpu = count")); + goto cleanup; + } + + numacpus =3D virDomainNumaGetCPUCountTotal(def->numa); + if ((numacpus !=3D 0) && (topologycpus !=3D numacpus)) { + VIR_WARN("CPU topology doesn't match numa CPU count; " + "partial NUMA mapping is obsoleted and will " + "be removed in future"); + } } =20 /* vCPU hotplug granularity must be respected */ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list