Francois Gouget : testbot/Engine: On startup stop stale RevertVM. pl processes and consider the VMs dirty.
Alexandre Julliard
julliard at winehq.org
Wed Aug 29 14:55:24 CDT 2012
Module: tools
Branch: master
Commit: b967042dfc94fef6c4853a6fdea9c163d4e48843
URL: http://source.winehq.org/git/tools.git/?a=commit;h=b967042dfc94fef6c4853a6fdea9c163d4e48843
Author: Francois Gouget <fgouget at codeweavers.com>
Date: Wed Aug 29 16:39:49 2012 +0200
testbot/Engine: On startup stop stale RevertVM.pl processes and consider the VMs dirty.
On startup we don't know what state the VMs are in: they may be shut
off following a VM host reboot or they may still be running old
tasks. So consider them all to be dirty (i.e. in need of a revert
before use).
---
testbot/bin/Engine.pl | 21 +++++++++++++++++++++
1 files changed, 21 insertions(+), 0 deletions(-)
diff --git a/testbot/bin/Engine.pl b/testbot/bin/Engine.pl
index a4db2e1..f63344b 100755
--- a/testbot/bin/Engine.pl
+++ b/testbot/bin/Engine.pl
@@ -541,6 +541,25 @@ sub ClientRead
return $GotSomething;
}
+sub InitVMs()
+{
+ # Kill any stale RevertVM.pl process so they don't mess with our VMs
+ system('killall RevertVM.pl 2>/dev/null');
+
+ # On startup we don't know what state the VMs are in. So consider them all
+ # to be dirty.
+ my $VMs = CreateVMs();
+ foreach my $VMKey (@{$VMs->GetKeys()})
+ {
+ my $VM = $VMs->GetItem($VMKey);
+ if ($VM->Status ne "offline")
+ {
+ $VM->Status("dirty");
+ $VM->Save();
+ }
+ }
+}
+
sub SafetyNet
{
my $Jobs = CreateJobs();
@@ -635,6 +654,8 @@ sub main
$WineTestBot::Engine::Notify::RunningInEngine = 1;
+ InitVMs();
+
my $SockName = "$DataDir/socket/engine";
my $uaddr = sockaddr_un($SockName);
my $proto = getprotobyname('tcp');
More information about the wine-cvs
mailing list