Skip to content

Commit

Permalink
[backend] Clean up emulator build invocation code
Browse files Browse the repository at this point in the history
For the emulator case, a lot of the options were not passed
down to the build invocation, like for example the filesystem
to create, which defaulted to the site-wide filesystem instead
of the worker-defined filesystem type.

The one two differences we want to have is to disable statistics
(as they slow down the emulated build) and use a different way
to invoke the emulator mode, otherwise the rest should be passed
down as is.
  • Loading branch information
dirkmueller authored and adrianschroeter committed May 14, 2013
1 parent c5c70ef commit 10f68b0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
21 changes: 11 additions & 10 deletions src/backend/bs_worker
Original file line number Diff line number Diff line change
Expand Up @@ -2188,11 +2188,19 @@ sub dobuild {
}

push @args, "$statedir/build/build";
if ($vm =~ /(xen|kvm|zvm)/) {
if ($vm =~ /(xen|kvm|zvm|emulator)/) {
mkdir("$buildroot/.mount") unless -d "$buildroot/.mount";
push @args, '--root', "$buildroot/.mount";
push @args, $vm, "$vm_root";
push @args, '--swap', "$vm_swap";
if ($vm =~ /emulator/) {
push @args, '--vm-type', 'emulator';
push @args, '--vm-disk', $vm_root;
push @args, '--emulator-script', $emulator_script if $emulator_script;
}
else {
push @args, $vm, "$vm_root";
push @args, '--swap', "$vm_swap";
push @args, '--statistics';
}
my $vmmemory = readstr("$buildroot/memory", 1);
$vmmemory = $vm_memory if $vm_memory;
push @args, '--memory', $vmmemory if $vmmemory;
Expand All @@ -2207,13 +2215,6 @@ sub dobuild {
push @args, '--hugetlbfs', $hugetlbfs if $hugetlbfs;
push @args, '--vm-worker', $vm_worker_name if $vm_worker_name;
push @args, '--vm-worker-nr', $vm_worker_instance if $vm_worker_instance;
push @args, '--statistics';
} elsif ($vm =~ /emulator/) {
push @args, '--root', "$buildroot/.mount";
push @args, '--vm-type', 'emulator';
push @args, '--vm-disk', $vm_root;
push @args, '--statistics';
push @args, '--emulator-script', $emulator_script if $emulator_script;
} elsif ($vm =~ /lxc/) {
push @args, '--root', $buildroot;
push @args, '--vm-type', $vm;
Expand Down
2 changes: 1 addition & 1 deletion src/backend/build

0 comments on commit 10f68b0

Please sign in to comment.