From nobody Mon Feb 9 13:57:16 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=1558604290; cv=none; d=zoho.com; s=zohoarc; b=P0pN3iAZ9AJMtd7XMQZpl5IxjTj3uloTE82R1m2ElfpZJ64pakbaKpqB912QUvHA6Ai9DpPJWyDbVDje8d7bqXDvwkMW5jobm+eWvK2V4vXdd3O4JHVEJFF4Fiqo4hVACtfGwtGlMIIJlX9evqOELkGe8AfXYpdU+Z3PP+momsU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558604290; 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=GP3ELK+8g0Ukq2mIZMdeZZR4Be3fVTySi6/4L8W9Ow4=; b=Ov2Hy/QhDjU2yQLRyCDqigr/0tGzJhe+HksQTl/FQwCnmi/8r/M+Ac+1ODk/PVAy5dv+DjKGMwxtnkwQ13yV8JNVXAtFWAYCFjhuHoYLU/4iW7gnSuFe3cj97p2iXvoh86DoobTgFWgUG69InyCVf3mtpmrnnRTBZQyTRy+LFWk= 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 1558604290545135.79699863644964; Thu, 23 May 2019 02:38:10 -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 4ED943082B64; Thu, 23 May 2019 09:38:09 +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 1F5801001E6F; Thu, 23 May 2019 09:38:09 +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 C473E5B424; Thu, 23 May 2019 09:38:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x4N9axkq028505 for ; Thu, 23 May 2019 05:36:59 -0400 Received: by smtp.corp.redhat.com (Postfix) id 307645D707; Thu, 23 May 2019 09:36:59 +0000 (UTC) Received: from mx1.redhat.com (ext-mx03.extmail.prod.ext.phx2.redhat.com [10.5.110.27]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2B74A5B681 for ; Thu, 23 May 2019 09:36:59 +0000 (UTC) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 BB4D081F25 for ; Thu, 23 May 2019 09:36:46 +0000 (UTC) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 May 2019 02:36:23 -0700 Received: from david-unc.bj.intel.com ([10.238.145.63]) by fmsmga002.fm.intel.com with ESMTP; 23 May 2019 02:36:22 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,502,1549958400"; d="scan'208";a="174692928" From: Wang Huaqiang To: libvir-list@redhat.com Date: Thu, 23 May 2019 17:34:14 +0800 Message-Id: <1558604060-30739-4-git-send-email-huaqiang.wang@intel.com> In-Reply-To: <1558604060-30739-1-git-send-email-huaqiang.wang@intel.com> References: <1558604060-30739-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.27]); Thu, 23 May 2019 09:36:51 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 23 May 2019 09:36:51 +0000 (UTC) for IP:'192.55.52.88' DOMAIN:'mga01.intel.com' HELO:'mga01.intel.com' FROM:'huaqiang.wang@intel.com' RCPT:'' X-RedHat-Spam-Score: -5.001 (RCVD_IN_DNSWL_HI, SPF_PASS) 192.55.52.88 mga01.intel.com 192.55.52.88 mga01.intel.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.27 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: huaqiang.wang@intel.com Subject: [libvirt] [PATCH 3/9] conf: check if vcpus matches with any 'existing' allocaiton 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.45]); Thu, 23 May 2019 09:38:09 +0000 (UTC) Content-Type: text/plain; charset="utf-8" In checking if vcpus matches with any exisitng resctrl allocation it should consider if the allocation exists or not. '@resctrl->alloc !=3D NULL' means an allocation exists. Signed-off-by: Wang Huaqiang --- src/conf/domain_conf.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index db25c1f..9c95467 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -19088,10 +19088,9 @@ virDomainCachetuneDefParseCache(xmlXPathContextPtr= ctxt, /* Checking if the monitor's vcpus is conflicted with existing allocation * and monitors. * - * Returns 1 if @vcpus equals to @resctrl->vcpus, then the monitor will - * share the underlying resctrl group with @resctrl->alloc. Returns - 1 - * if any conflict found. Returns 0 if no conflict and @vcpus is not equal - * to @resctrl->vcpus. + * Returns 1 if @vcpus equals to vcpus of an existing resctrl allocation g= roup. + * Returns -1 if any conflict found. Returns 0 if no conflict and @vcpus is + * not equal to any created resctrl allocation. */ static int virDomainResctrlMonValidateVcpus(virDomainResctrlDefPtr resctrl, @@ -19115,7 +19114,7 @@ virDomainResctrlMonValidateVcpus(virDomainResctrlDe= fPtr resctrl, } } =20 - if (virBitmapEqual(vcpus, resctrl->vcpus)) + if (virBitmapEqual(vcpus, resctrl->vcpus) && resctrl->alloc !=3D NULL) return 1; =20 for (i =3D 0; i < resctrl->nmonitors; i++) { --=20 2.7.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list