From 8496dbf350c5a6692e293107e0e5ce5b0bee40b9 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 16 Dec 2010 13:53:17 +0000 Subject: [PATCH] * Absolutize the path to the VM start script. svn path=/nixos/trunk/; revision=25154 --- lib/test-driver/Machine.pm | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/test-driver/Machine.pm b/lib/test-driver/Machine.pm index daa40f78f9f..28596a5d634 100644 --- a/lib/test-driver/Machine.pm +++ b/lib/test-driver/Machine.pm @@ -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.