Libraries are not supposed to spam the log and most callers already trace VM::Run() errors.
Signed-off-by: Francois Gouget fgouget@codeweavers.com --- 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 737533785..4128e9e1e 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 d85df1d08..d240fb964 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: