diff --git a/lib/test-driver/Machine.pm b/lib/test-driver/Machine.pm index 615fe09bdfc6..c56e650ed361 100644 --- a/lib/test-driver/Machine.pm +++ b/lib/test-driver/Machine.pm @@ -48,9 +48,13 @@ sub new { make_path($sharedDir, { mode => 0700, owner => $< }); } + my $allowReboot = 0; + $allowReboot = $args->{allowReboot} if defined $args->{allowReboot}; + my $self = { startCommand => $startCommand, name => $name, + allowReboot => $allowReboot, booted => 0, pid => 0, connected => 0, @@ -136,7 +140,8 @@ sub start { $ENV{SHARED_DIR} = $sharedDir; $ENV{USE_TMPDIR} = 1; $ENV{QEMU_OPTS} = - "-no-reboot -monitor unix:./monitor -chardev socket,id=shell,path=./shell " . + ($self->{allowReboot} ? "" : "-no-reboot ") . + "-monitor unix:./monitor -chardev socket,id=shell,path=./shell " . "-device virtio-serial -device virtconsole,chardev=shell " . ($showGraphics ? "-serial stdio" : "-nographic") . " " . ($ENV{QEMU_OPTS} || ""); chdir $self->{stateDir} or die;