3
0
Fork 0
forked from mirrors/nixpkgs

* Absolutize the path to the VM start script.

svn path=/nixos/trunk/; revision=25154
This commit is contained in:
Eelco Dolstra 2010-12-16 13:53:17 +00:00
parent aaf3247e80
commit 8496dbf350

View file

@ -24,6 +24,13 @@ sub new {
my ($class, $args) = @_;
my $startCommand = $args->{startCommand};
my $name = $args->{name};
if (!$name) {
$startCommand =~ /run-(.*)-vm$/;
$name = $1 || "machine";
}
if (!$startCommand) {
# !!! merge with qemu-vm.nix.
$startCommand =
@ -34,12 +41,8 @@ sub new {
$startCommand .= "-cdrom $args->{cdrom} "
if defined $args->{cdrom};
$startCommand .= $args->{qemuFlags} || "";
}
my $name = $args->{name};
if (!$name) {
$startCommand =~ /run-(.*)-vm$/;
$name = $1 || "machine";
} else {
$startCommand = Cwd::abs_path $startCommand;
}
my $tmpDir = $ENV{'TMPDIR'} || "/tmp";
@ -126,7 +129,7 @@ sub start {
$ENV{QEMU_KERNEL_PARAMS} = "hostTmpDir=$ENV{TMPDIR}";
chdir $self->{stateDir} or die;
exec $self->{startCommand};
die;
die "running VM script: $!";
}
# Process serial line output.