Hello community,
here is the log from the commit of package cpuset for openSUSE:Factory checked in at 2014-06-01 19:41:25
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/cpuset (Old)
and /work/SRC/openSUSE:Factory/.cpuset.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "cpuset"
Changes:
--------
--- /work/SRC/openSUSE:Factory/cpuset/cpuset.changes 2011-09-23 01:54:11.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.cpuset.new/cpuset.changes 2014-06-01 19:41:45.000000000 +0200
@@ -1,0 +2,13 @@
+Wed May 28 02:40:03 UTC 2014 - mgalbraith@suse.com
+
+- Explicitly state that the previous commit..
+
+ "Make cset handle cgroup/cpuset mount types"
+
+..added patch cset-make-it-handle-cgroup-mounts.patch
+-------------------------------------------------------------------
+Tue May 27 07:38:24 UTC 2014 - mgalbraith@suse.com
+
+- Make cset handle cgroup/cpuset mount types (SUSE bnc#625079, SUSE bnc#834223)
+
+-------------------------------------------------------------------
New:
----
cset-make-it-handle-cgroup-mounts.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ cpuset.spec ++++++
--- /var/tmp/diff_new_pack.KJ6vtN/_old 2014-06-01 19:41:47.000000000 +0200
+++ /var/tmp/diff_new_pack.KJ6vtN/_new 2014-06-01 19:41:47.000000000 +0200
@@ -1,7 +1,7 @@
#
# spec file for package cpuset
#
-# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2008-2011 Novell, Inc. Waltham, MA, USA
#
# All modifications and additions to the file contributed by third parties
@@ -17,16 +17,16 @@
#
-
Name: cpuset
Version: 1.5.6
-Release: 1
-License: GPL-2.0
+Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Url: http://code.google.com/p/cpuset
-Group: System/Management
Summary: Allows manipulation of cpusets on system and provides higher level functions
+License: GPL-2.0
+Group: System/Management
Source: %{name}-%{version}.tar.gz
+Patch0: cset-make-it-handle-cgroup-mounts.patch
BuildRequires: python-devel
%if 0%{?suse_version} > 0
%py_requires
@@ -42,6 +42,7 @@
%prep
%setup
+%patch0 -p1
%build
CFLAGS="%{optflags}" \
++++++ cset-make-it-handle-cgroup-mounts.patch ++++++
Subject: cset, make it handle cgroup mounts
From: Mike Galbraith
Date: Wed Sep 4 08:09:38 CEST 2013
References: bnc#625079, bnc#834223
When cpuset has been mounted as a cgroup controller, files are prefixes
with "cpuset.", leading to expected files not existing. Change cset's
filename expectations depending on mount type.
Signed-off-by: Mike Galbraith
---
cpuset/cset.py | 46 +++++++++++++++++++++++++++++++++++-----------
1 file changed, 35 insertions(+), 11 deletions(-)
--- a/cpuset/cset.py
+++ b/cpuset/cset.py
@@ -36,6 +36,11 @@ RootSet = None
# a relative path from this basepath.
sets = {}
basepath = ''
+ cpus_path = '/cpus'
+ mems_path = '/mems'
+ cpu_exclusive_path = '/cpu_exclusive'
+ mem_exclusive_path = '/mem_exclusive'
+ tasks_path = '/tasks'
def __init__(self, path=None):
log.debug("initializing CpuSet")
@@ -56,6 +61,14 @@ RootSet = None
del CpuSet.sets
CpuSet.sets = {}
CpuSet.sets[self.path] = self
+
+ # if mounted as a cgroup controller, switch file name format
+ if not os.access(path + CpuSet.cpus_path, os.F_OK):
+ CpuSet.cpus_path = '/cpuset.cpus'
+ CpuSet.mems_path = '/cpuset.mems'
+ CpuSet.cpu_exclusive_path = '/cpuset.cpu_exclusive'
+ CpuSet.mem_exclusive_path = '/cpuset.mem_exclusive'
+
# bottom-up search otherwise links will not exist
log.debug("starting bottom-up discovery walk...")
for dir, dirs, files in os.walk(path, topdown=False):
@@ -104,7 +117,7 @@ RootSet = None
log.debug("the cpuset %s already exists, skipping", path)
self = CpuSet.sets[path] # questionable....
return
- cpus = CpuSet.basepath + path + "/cpus"
+ cpus = CpuSet.basepath + path + CpuSet.cpus_path
if not os.access(cpus, os.F_OK):
# not a cpuset directory
str = '%s is not a cpuset directory' % (CpuSet.basepath + path)
@@ -118,6 +131,8 @@ RootSet = None
log.debug("locating cpuset filesystem...")
cpuset = re.compile(r"none (/.+) cpuset .+")
cgroup = re.compile(r"none (/.+) cgroup .+")
+ cpuset1 = re.compile(r"cpuset (/.+) cpuset .+")
+ cgroup1 = re.compile(r"cgroup (/.+) cgroup .+")
path = None
f = file("/proc/mounts")
for line in f:
@@ -125,12 +140,21 @@ RootSet = None
if res:
path = res.group(1)
break
+ res = cpuset1.search(line)
+ if res:
+ path = res.group(1)
+ break
else:
if cgroup.search(line):
groups = line.split()
if re.search("cpuset", groups[3]):
path = groups[1]
break
+ if cgroup1.search(line):
+ groups = line.split()
+ if re.search("cpuset", groups[3]):
+ path = groups[1]
+ break
f.close()
if not path:
@@ -158,36 +182,36 @@ RootSet = None
raise AttributeError, "deletion of properties not allowed"
def getcpus(self):
- f = file(CpuSet.basepath+self.path+"/cpus")
+ f = file(CpuSet.basepath+self.path+CpuSet.cpus_path)
return f.readline()[:-1]
def setcpus(self, newval):
cpuspec_check(newval)
- f = file(CpuSet.basepath+self.path+"/cpus",'w')
+ f = file(CpuSet.basepath+self.path+CpuSet.cpus_path,'w')
f.write(str(newval))
f.close()
log.debug("-> prop_set %s.cpus = %s", self.path, newval)
cpus = property(fget=getcpus, fset=setcpus, fdel=delprop, doc="CPU specifier")
def getmems(self):
- f = file(CpuSet.basepath+self.path+"/mems")
+ f = file(CpuSet.basepath+self.path+CpuSet.mems_path)
return f.readline()[:-1]
def setmems(self, newval):
# FIXME: check format for correctness
- f = file(CpuSet.basepath+self.path+"/mems",'w')
+ f = file(CpuSet.basepath+self.path+CpuSet.mems_path,'w')
f.write(str(newval))
f.close()
log.debug("-> prop_set %s.mems = %s", self.path, newval)
mems = property(getmems, setmems, delprop, "Mem node specifier")
def getcpuxlsv(self):
- f = file(CpuSet.basepath+self.path+"/cpu_exclusive")
+ f = file(CpuSet.basepath+self.path+CpuSet.cpu_exclusive_path)
if f.readline()[:-1] == '1':
return True
else:
return False
def setcpuxlsv(self, newval):
log.debug("-> prop_set %s.cpu_exclusive = %s", self.path, newval)
- f = file(CpuSet.basepath+self.path+"/cpu_exclusive",'w')
+ f = file(CpuSet.basepath+self.path+CpuSet.cpu_exclusive_path,'w')
if newval:
f.write('1')
else:
@@ -197,14 +221,14 @@ RootSet = None
"CPU exclusive flag")
def getmemxlsv(self):
- f = file(CpuSet.basepath+self.path+"/mem_exclusive")
+ f = file(CpuSet.basepath+self.path+CpuSet.mem_exclusive_path)
if f.readline()[:-1] == '1':
return True
else:
return False
def setmemxlsv(self, newval):
log.debug("-> prop_set %s.mem_exclusive = %s", self.path, newval)
- f = file(CpuSet.basepath+self.path+"/mem_exclusive",'w')
+ f = file(CpuSet.basepath+self.path+CpuSet.mem_exclusive_path,'w')
if newval:
f.write('1')
else:
@@ -214,7 +238,7 @@ RootSet = None
"Memory exclusive flag")
def gettasks(self):
- f = file(CpuSet.basepath+self.path+"/tasks")
+ f = file(CpuSet.basepath+self.path+CpuSet.tasks_path)
lst = []
for task in f: lst.append(task[:-1])
return lst
@@ -229,7 +253,7 @@ RootSet = None
prog = False
for task in tasklist:
try:
- f = file(CpuSet.basepath+self.path+"/tasks",'w')
+ f = file(CpuSet.basepath+self.path+CpuSet.tasks_path,'w')
f.write(task)
f.close()
except Exception, err:
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org