Francois Gouget : testbot/Engine: Let the caller trace VM::Run() errors.

Alexandre Julliard julliard at winehq.org
Mon Sep 23 14:35:46 CDT 2019


Module: tools
Branch: master
Commit: c52a230ef658608dd68562a466bcc670caa6a241
URL:    https://source.winehq.org/git/tools.git/?a=commit;h=c52a230ef658608dd68562a466bcc670caa6a241

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Mon Sep 23 19:21:57 2019 +0200

testbot/Engine: Let the caller trace VM::Run() errors.

Libraries are not supposed to spam the log and most callers already
trace VM::Run() errors.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 testbot/lib/WineTestBot/Engine/Scheduler.pm | 3 ++-
 testbot/lib/WineTestBot/VMs.pm              | 5 +----
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/testbot/lib/WineTestBot/Engine/Scheduler.pm b/testbot/lib/WineTestBot/Engine/Scheduler.pm
index 7375337..4128e9e 100644
--- a/testbot/lib/WineTestBot/Engine/Scheduler.pm
+++ b/testbot/lib/WineTestBot/Engine/Scheduler.pm
@@ -766,7 +766,8 @@ sub _SacrificeVM($$$)
   $Host->{dirty}++;
   $Victim->RecordStatus($Sched->{records}, $Victim->Status eq "dirty" ? "dirty poweroff" : "dirty sacrifice");
   $Victim->KillChild();
-  $Victim->RunPowerOff();
+  my $ErrMessage = $Victim->RunPowerOff();
+  LogMsg "$ErrMessage\n" if (defined $ErrMessage);
   return 1;
 }
 
diff --git a/testbot/lib/WineTestBot/VMs.pm b/testbot/lib/WineTestBot/VMs.pm
index d85df1d..d240fb9 100644
--- a/testbot/lib/WineTestBot/VMs.pm
+++ b/testbot/lib/WineTestBot/VMs.pm
@@ -379,10 +379,7 @@ sub Run($$$$$$)
 
   if (defined $self->ChildPid)
   {
-    my $ErrMessage = "Cannot run ". ShArgv2Cmd(@$Args) ." because the ". $self->ChildPid ." process is already using the ". $self->Name ." VM";
-    require WineTestBot::Log;
-    WineTestBot::Log::LogMsg("$ErrMessage\n");
-    return $ErrMessage;
+    return "Cannot run ". ShArgv2Cmd(@$Args) ." because process ". $self->ChildPid ." is already using the ". $self->Name ." VM";
   }
 
   # There are two $VM->ChildPid race conditions to avoid:




More information about the wine-cvs mailing list