'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 <huaqiang.wang(a)intel.com>
---
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 = 0; j < ct->nmonitors; j++) {
mon = ct->monitors[j];
- if (virBitmapEqual(ct->vcpus, mon->vcpus))
+ if (virBitmapEqual(ct->vcpus, mon->vcpus) &&
+ !virResctrlAllocIsEmpty(ct->alloc))
continue;
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 monitor,
return -1;
}
- 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;
--
2.7.4