From nobody Fri Apr 19 05:25:03 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=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1560224032; cv=none; d=zoho.com; s=zohoarc; b=bZOT6IuGm2iomNL/IQCER24IdngG1A1i/VGyVPZJLQdk2E4H52Q0v926t21vEta2mo/DFFZMIGHTrXZdf0Dl6OTMzCiMnD7gMvpW4sN1S8zr/eW+ATu2+Q3Y8hiosH6C0mlhaF0jp5G1xmNUVSJpuuPSi31b0IajxyRVYHsAqe8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560224032; 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=jP81zUbYDVD/ZGISPiaA2MQ1t17uWkZUTAOLPLJ9Ky4=; b=Vfq/shbiA/jiuL4omEHeBPl0E8hMVmUYaJbDvMuVF0ULJRdWb8u8wunn72Gvc2m1j2wIefLUMBRk4pxUyxvDqZU0MrUkdNog6jYQfp7iKArbGWhk8H7LM0XhrBvLkXTqureuPM9HzGY4VQU6k+ecSDr4CC1359SAF5i52yJ9sPI= 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 1560224032212207.14594309184235; Mon, 10 Jun 2019 20:33:52 -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 0426D307D91F; Tue, 11 Jun 2019 03:33:48 +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 F2C8A5C226; Tue, 11 Jun 2019 03:33:46 +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 BC1E2C589; Tue, 11 Jun 2019 03:33:45 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x5B3XivA022152 for ; Mon, 10 Jun 2019 23:33:44 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0C4811001DD1; Tue, 11 Jun 2019 03:33:44 +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 07EAF1001DCC for ; Tue, 11 Jun 2019 03:33:41 +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 A567086658 for ; Tue, 11 Jun 2019 03:33:39 +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:38 -0700 Received: from david-unc.bj.intel.com ([10.238.145.63]) by fmsmga001.fm.intel.com with ESMTP; 10 Jun 2019 20:33:37 -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:06 +0800 Message-Id: <1560223876-28816-2-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:39 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 11 Jun 2019 03:33:39 +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.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: huaqiang.wang@intel.com, tao.su@intel.com Subject: [libvirt] [PATCHv2 01/11] util, conf: Handle default monitor group of an allocation properly 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Tue, 11 Jun 2019 03:33:48 +0000 (UTC) Content-Type: text/plain; charset="utf-8" 'default monitor of an allocation' is defined as the resctrl monitor group that created along with an resctrl allocation, which is created by resctrl file system. If the monitor group specified in domain configuration file is happened to be a default monitor group of an allocation, then it is not necessary to create monitor group since it is already created. But if an monitor group is not an allocation default group, you should create the group under folder '/sys/fs/resctrl/mon_groups' and fill the vcpu PIDs to 'tasks' file. Signed-off-by: Wang Huaqiang --- src/libvirt_private.syms | 1 + src/qemu/qemu_process.c | 3 ++- src/util/virresctrl.c | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 9099757..b95f958 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -2756,6 +2756,7 @@ virResctrlAllocForeachMemory; virResctrlAllocFormat; virResctrlAllocGetID; virResctrlAllocGetUnused; +virResctrlAllocIsEmpty; virResctrlAllocNew; virResctrlAllocRemove; virResctrlAllocSetCacheSize; diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 9046677..ed3b94c 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -5561,7 +5561,8 @@ qemuProcessSetupVcpu(virDomainObjPtr vm, for (j =3D 0; j < ct->nmonitors; j++) { mon =3D ct->monitors[j]; =20 - if (virBitmapEqual(ct->vcpus, mon->vcpus)) + if (virBitmapEqual(ct->vcpus, mon->vcpus) && + !virResctrlAllocIsEmpty(ct->alloc)) continue; =20 if (virBitmapIsBitSet(mon->vcpus, vcpuid)) { diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c index 90532cf..fb66ea3 100644 --- a/src/util/virresctrl.c +++ b/src/util/virresctrl.c @@ -2560,7 +2560,8 @@ virResctrlMonitorDeterminePath(virResctrlMonitorPtr m= onitor, return -1; } =20 - if (STREQ_NULLABLE(monitor->id, monitor->alloc->id)) { + if (!virResctrlAllocIsEmpty(monitor->alloc) && + STREQ_NULLABLE(monitor->id, monitor->alloc->id)) { if (VIR_STRDUP(monitor->path, monitor->alloc->path) < 0) return -1; return 0; --=20 2.7.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list