Change in vdsm[master]: cmdutils: enhance systemd_run
fromani at redhat.com
fromani at redhat.com
Thu Apr 21 15:47:01 UTC 2016
Francesco Romani has uploaded a new change for review.
Change subject: cmdutils: enhance systemd_run
......................................................................
cmdutils: enhance systemd_run
Change-Id: Id49be0d88d573958bf0884a254256bb2a745940a
TODO: explain
Signed-off-by: Francesco Romani <fromani at redhat.com>
---
M lib/vdsm/cmdutils.py
1 file changed, 12 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/74/56474/1
diff --git a/lib/vdsm/cmdutils.py b/lib/vdsm/cmdutils.py
index 8629e1c..0c02f81 100644
--- a/lib/vdsm/cmdutils.py
+++ b/lib/vdsm/cmdutils.py
@@ -69,7 +69,8 @@
return command
-def systemd_run(cmd, scope=False, unit=None, slice=None):
+def systemd_run(cmd, scope=False, unit=None, slice=None, accounting=False,
+ uid=None, gid=None):
command = [constants.EXT_SYSTEMD_RUN]
if scope:
command.append('--scope')
@@ -77,6 +78,16 @@
command.append('--unit=%s' % unit)
if slice:
command.append('--slice=%s' % slice)
+ if accounting:
+ command.extend([
+ '--property=CPUAccounting=1',
+ '--property=MemoryAccounting=1',
+ '--property=BlockIOAccounting=1',
+ ])
+ if uid is not None:
+ command.append('--uid=%i' % uid)
+ if gid is not None:
+ command.append('--gid=%i' % gid)
command.extend(cmd)
return command
--
To view, visit https://gerrit.ovirt.org/56474
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id49be0d88d573958bf0884a254256bb2a745940a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani at redhat.com>
More information about the vdsm-patches
mailing list