Fix Issue#3: cset fails to create cpu sets if some cpus are offline

Problem was in cset.rescan() where if certain cpus are offline the all
cpu mask turns into a complex expression.  The split of this
expression did not account for commas and thus threw an exception if
commas were present.  This patch fixes that problem and accounts for
complex cpu expression.  Also added a couple of targets to the
Makefile.
python3
Alex Tsariounov 14 years ago
parent 6c3a137e28
commit 24a7538453

@ -5,6 +5,15 @@ PYTHON ?= python
all:
$(PYTHON) setup.py build
rpm:
$(PYTHON) setup.py bdist_rpm
srcrpm:
$(PYTHON) setup.py bdist_rpm
srcdist:
$(PYTHON) setup.py sdist
install:
$(PYTHON) setup.py install --prefix=$(PREFIX) --root=$(DESTDIR)

11
NEWS

@ -1,3 +1,14 @@
============================================================
Cpuset 1.5.5 Pre-release (XXX, 2010)
http://code.google.com/p/cpuset
http://download.opensuse.org/repositories/home:/tsariounov:/cpuset/
Maintenance update to 1.5.4 includes fixes as follows.
* Fix for Issue#3: cset fails to create cpu sets if some cpus are offline
Problem in cset.rescan() for maxcpu if root cpuset cpus are complex
pattern due to offlining cpus.
============================================================
Cpuset 1.5.4 (May 7, 2010)
http://code.google.com/p/cpuset

@ -16,7 +16,7 @@
# norootforbuild
Name: cpuset
Version: 1.5.4
Version: 1.5.4.2
Release: 1
License: GPL v2 only
BuildRoot: %{_tmppath}/%{name}-%{version}-build

@ -343,8 +343,11 @@ def rescan():
global RootSet, maxcpu, allcpumask
RootSet = CpuSet()
# figure out system properties
maxcpu = int(RootSet.cpus.split('-')[-1])
log.debug("rescan: all cpus = %s", RootSet.cpus)
maxcpu = int(RootSet.cpus.split('-')[-1].split(',')[-1])
log.debug(" max cpu = %s", maxcpu)
allcpumask = calc_cpumask(maxcpu)
log.debug(" allcpumask = %s", allcpumask)
def cpuspec_check(cpuspec, usemax=True):
"""check format of cpuspec for validity"""

Loading…
Cancel
Save