Skip to content

Commit

Permalink
[backend] generic emulator support to be used as virtualization engine
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianschroeter committed Feb 3, 2013
1 parent 3293cc6 commit 62cb7f5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion dist/obsworker
Expand Up @@ -107,8 +107,12 @@ fi

vmopt=

ARCH=""
if [ -n "$OBS_VM_TYPE" -a "$OBS_VM_TYPE" != "auto" ] ; then
if [ "$OBS_VM_TYPE" != "none" ] ; then
if [ "${OBS_VM_TYPE#emulator:}" != "$OBS_VM_TYPE" ] ; then
vmopt="--emulator"
ARCH="--arch ${OBS_VM_TYPE#emulator:}"
elif [ "$OBS_VM_TYPE" != "none" ] ; then
vmopt="--$OBS_VM_TYPE"
fi
elif [ -e /dev/kvm ] ; then
Expand Down Expand Up @@ -230,6 +234,7 @@ case "$1" in
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" \
"$ARCH" \
>> $screenrc
mkdir -p $workerdir/$I
done
Expand Down
2 changes: 1 addition & 1 deletion dist/sysconfig.obs-server
Expand Up @@ -199,7 +199,7 @@ OBS_WORKER_NICE_LEVEL=18

## Path: Applications/OBS
## Description: Set used VM type by worker
## Type: ("auto" | "xen" | "kvm" | "lxc" | "none")
## Type: ("auto" | "xen" | "kvm" | "lxc" | "emulator:$arch" | "none")
## Default: "auto"
## Config: OBS
#
Expand Down
4 changes: 4 additions & 0 deletions src/backend/bs_worker
Expand Up @@ -2059,6 +2059,10 @@ sub dobuild {
push @args, '--vmdisk-clean'if $vmdisk_clean;
push @args, '--hugetlbfs', $hugetlbfs if $hugetlbfs;
push @args, '--statistics';
} elsif ($vm =~ /emulator/) {
push @args, '--root', "$buildroot/.mount";
push @args, '--vm-type', $vm;
push @args, '--statistics';
} elsif ($vm =~ /lxc/) {
push @args, '--root', $buildroot;
push @args, '--vm-type', $vm;
Expand Down

1 comment on commit 62cb7f5

@mmohring
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Adrian,

the change in src/backend/bs_worker is missing a --emulator switch in the command line options section, e.g.

@@ -302,6 +304,11 @@ while (@argv) {
shift @argv;
next;
}

  • if ($ARGV[0] eq '--emulator') {
  • $vm = 'emulator';
  • shift @argv;
  • next;
  • }
    if ($ARGV[0] eq '--tmpfs') {
    shift @argv;
    $vm_tmpfs_mode = 1;

kind regards, Martin

Please sign in to comment.