On 10/22/18 4:01 AM, Wang Huaqiang wrote:
Add interfaces monitor group to support operations such
as add PID, set ID, remove group ... etc.
Signed-off-by: Wang Huaqiang <huaqiang.wang(a)intel.com>
---
src/libvirt_private.syms | 5 +++++
src/util/virresctrl.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++
src/util/virresctrl.h | 14 ++++++++++++++
3 files changed, 66 insertions(+)
[...]
+int
+virResctrlMonitorRemove(virResctrlMonitorPtr monitor)
+{
+ int ret = 0;
+
+ if (!monitor->path)
+ return 0;
Similar to patch1 - if we are using a default path, then we don't want
to removed even if it exists, so I *think* (but you need to confirm for
me) that the following should be done:
if (STREQ(monitor->path, monitor->alloc->path))
return 0;
Although I wonder if a !monitor->alloc guard should be used as well.
Whether it's part of a || !monitor->path return 0 or this check should
be "if (monitor->alloc && STREQ(...))"... Thoughts?
+
+ VIR_DEBUG("Removing resctrl monitor%s", monitor->path);
s/monitor%s/monitor path='%s'
+ if (rmdir(monitor->path) != 0 && errno != ENOENT) {
+ ret = -errno;
+ VIR_ERROR(_("Unable to remove %s (%d)"), monitor->path, errno);
+ }
+
+ return ret;
+}
I can make the changes - just let me know your preferred way to proceed...
Reviewed-by: John Ferlan <jferlan(a)redhat.com>
John
[...]