From nobody Sun Feb 8 11:54:02 2026 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=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1560224087; cv=none; d=zoho.com; s=zohoarc; b=heOPiFfrZsEFiokzQFgApIylr5EG2KqOVYjLqpTwhfayFa1e3nNxYSz/UahPMg4YoEAnjbEQOg7Vccth4zz/Ch/WUFtM4Zupr2lO/4Oasc7ppstTSS3e+8HhcIr4xhNHPJRYS7CzU4PskmYU4ZII13WVTo4sJf/4LjXrx+H/BHk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560224087; 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:ARC-Authentication-Results; bh=vv6eVRD1xzWgHeD4SNmOxor+pfEiEMvUKeM3F0sslqw=; b=c1OnArNBm4VDhEdkVOHq8PY2yWB4o/sW5o0rBZKbc9VulgyAJ0UMGU8f9VIdY5jDJ9+WMYsWTLEuGomJSc4F+pMOztPJQsaKjh1z10z/psb8ZD23PYycHhQ5NxZ48fZYBP3zcYBR4N25Aknu2Aocg5wDbW7T3BRyyIUdOwCQvas= 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 1560224087319110.37907168235381; Mon, 10 Jun 2019 20:34:47 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7FF20C0578FA; Tue, 11 Jun 2019 03:34:45 +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 2DB951001DEE; Tue, 11 Jun 2019 03:34:45 +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 C327B206D8; Tue, 11 Jun 2019 03:34:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x5B3Xk5S022188 for ; Mon, 10 Jun 2019 23:33:46 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8A66060C05; Tue, 11 Jun 2019 03:33:46 +0000 (UTC) Received: from mx1.redhat.com (ext-mx02.extmail.prod.ext.phx2.redhat.com [10.5.110.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8577460BF1 for ; Tue, 11 Jun 2019 03:33:44 +0000 (UTC) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (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 B04C987633 for ; Tue, 11 Jun 2019 03:33:43 +0000 (UTC) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Jun 2019 20:33:43 -0700 Received: from david-unc.bj.intel.com ([10.238.145.63]) by fmsmga001.fm.intel.com with ESMTP; 10 Jun 2019 20:33:42 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 From: Wang Huaqiang To: libvir-list@redhat.com Date: Tue, 11 Jun 2019 11:31:11 +0800 Message-Id: <1560223876-28816-7-git-send-email-huaqiang.wang@intel.com> In-Reply-To: <1560223876-28816-1-git-send-email-huaqiang.wang@intel.com> References: <1560223876-28816-1-git-send-email-huaqiang.wang@intel.com> X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 216 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 11 Jun 2019 03:33:43 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 11 Jun 2019 03:33:43 +0000 (UTC) for IP:'134.134.136.31' DOMAIN:'mga06.intel.com' HELO:'mga06.intel.com' FROM:'huaqiang.wang@intel.com' RCPT:'' X-RedHat-Spam-Score: -2.3 (RCVD_IN_DNSWL_MED, SPF_HELO_NONE, SPF_PASS) 134.134.136.31 mga06.intel.com 134.134.136.31 mga06.intel.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.26 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: huaqiang.wang@intel.com, tao.su@intel.com Subject: [libvirt] [PATCHv2 06/11] conf: Append 'resctrl' object according to number of monitor group directly 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.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 11 Jun 2019 03:34:46 +0000 (UTC) Content-Type: text/plain; charset="utf-8" 'virResctrlAllocIsEmpty' checks if cache allocation or memory bandwidth allocation settings are specified in configuration file. It is not proper to be used in checking memory bandwidth allocation is specified in XML settings because this function could not distinguish memory bandwidth allocations from cache allocations. Here using the local variable @n, which indicates the cache allocation groups or memory bandwidth groups depending on the context it is in, to decide if append a new @resctrl object. If @n is zero and no monitors groups specified in XML, then we should not append a new @resctrl object to @def->resctrls. This kind of replacement is also more efficient and avoiding a long function calling path. Signed-off-by: Wang Huaqiang --- src/conf/domain_conf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index ca2dba9..676a2ac 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -19359,7 +19359,7 @@ virDomainCachetuneDefParse(virDomainDefPtr def, =20 /* If no element or element in , do not * append any resctrl element */ - if (!resctrl->nmonitors && virResctrlAllocIsEmpty(alloc)) { + if (!resctrl->nmonitors && n =3D=3D 0) { ret =3D 0; goto cleanup; } @@ -19548,7 +19548,7 @@ virDomainMemorytuneDefParse(virDomainDefPtr def, return -1; } =20 - if (virResctrlAllocIsEmpty(alloc)) + if (n =3D=3D 0) return 0; =20 /* --=20 2.7.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list