[PATCH 3/3] testbot/Engine: Fix recording the new sacrificed VM status.

Francois Gouget fgouget at codeweavers.com
Mon Sep 23 12:22:00 CDT 2019


The status will not be 'dirty' if VM::RunPowerOff() failed.
Recording the right status is important otherwise ScheduleJobs() will
attempt to record de VM's current status in its catch-all loop,
resulting in a fatal 'Could not change key' error.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---

This prevents the Engine from crashing, even if VM::RunPowerOff() does 
fail.

 testbot/lib/WineTestBot/Engine/Scheduler.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testbot/lib/WineTestBot/Engine/Scheduler.pm b/testbot/lib/WineTestBot/Engine/Scheduler.pm
index 4128e9e1e..530a2ee1e 100644
--- a/testbot/lib/WineTestBot/Engine/Scheduler.pm
+++ b/testbot/lib/WineTestBot/Engine/Scheduler.pm
@@ -764,10 +764,10 @@ sub _SacrificeVM($$$)
   $Sched->{busyvms}->{$VictimKey} = 1;
   $Host->{$Victim->Status}--;
   $Host->{dirty}++;
-  $Victim->RecordStatus($Sched->{records}, $Victim->Status eq "dirty" ? "dirty poweroff" : "dirty sacrifice");
   $Victim->KillChild();
   my $ErrMessage = $Victim->RunPowerOff();
   LogMsg "$ErrMessage\n" if (defined $ErrMessage);
+  $Victim->RecordStatus($Sched->{records}, $Victim->Status eq "dirty" ? "dirty poweroff" : $VM->Status ." sacrifice");
   return 1;
 }
 
-- 
2.20.1



More information about the wine-devel mailing list