Skip to content

Commit

Permalink
[backend] Pass threads option to build
Browse files Browse the repository at this point in the history
KVM on power uses advanced format to specify number of cpus and threads
to be used, like -smp 4,threads=8

Signed-off-by: Dinar Valeev <dvaleev@suse.com>
  • Loading branch information
Dinar Valeev authored and adrianschroeter committed Oct 21, 2013
1 parent 5868ca9 commit 6e8bd35
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dist/obsworker
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ fi
if [ -n "$OBS_WORKER_JOBS" ]; then
OBS_JOBS="--jobs $OBS_WORKER_JOBS"
fi
if [ -n "$OBS_WORKER_THREADS" ]; then
OBS_THREADS="--threads $OBS_WORKER_THREADS"
fi
if [ -n "$OBS_WORKER_NICE_LEVEL" ]; then
OBS_NICE=$OBS_WORKER_NICE_LEVEL
else
Expand Down Expand Up @@ -323,7 +326,7 @@ case "$1" in
fi
echo "screen -t $WORKERID nice -n $OBS_NICE ./bs_worker $vmopt $port --root $R" \
"--statedir $workerdir/$I --id $WORKERID $REPO_PARAM $HUGETLBFS $HOSTLABELS" \
"$HOSTOWNER $OBS_JOBS $OBS_TEST $OBS_WORKER_OPT $TMPFS $DEVICE $SWAP $MEMORY" \
"$HOSTOWNER $OBS_JOBS $OBS_THREADS $OBS_TEST $OBS_WORKER_OPT $TMPFS $DEVICE $SWAP $MEMORY" \
"$ARCH $EMULATOR" \
>> $screenrc
mkdir -p $workerdir/$I
Expand Down
9 changes: 9 additions & 0 deletions src/backend/bs_worker
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ my @hostlabel;
my $getbinariesproxy;

my $jobs;
my $threads;
my $cachedir;
my $cachesize;

Expand Down Expand Up @@ -264,6 +265,8 @@ Usage: $0 [OPTION] --root <directory> --statedir <directory>
--jobs <nr> : hand over the number of parallel jobs to build
--threads <nr> : sets number of threads for KVM
--oneshot <seconds>
: just build one package, do not wait more then
<seconds> seconds if nothing is available
Expand Down Expand Up @@ -491,6 +494,11 @@ while (@ARGV) {
$jobs = shift @ARGV;
next;
}
if ($ARGV[0] eq '--threads') {
shift @ARGV;
$treads = shift @ARGV;
next;
}
if ($ARGV[0] eq '--cachedir') {
shift @ARGV;
$cachedir = shift @ARGV;
Expand Down Expand Up @@ -2253,6 +2261,7 @@ sub dobuild {
push @args, '--debug' if $buildinfo->{'debuginfo'};
push @args, '--arch', $arch;
push @args, '--jobs', $jobs if $jobs;
push @args, '--threads', $threads if $treads;
push @args, '--reason', "Building $packid for project '$projid' repository '$repoid' arch '$arch' srcmd5 '$buildinfo->{'srcmd5'}'";
push @args, '--disturl', $disturl;
push @args, '--linksources' if $localkiwi;
Expand Down

0 comments on commit 6e8bd35

Please sign in to comment.