Francois Gouget : testbot/WineRunReconfig: Don' t fail if the idle snapshot does not exist.

Alexandre Julliard julliard at winehq.org
Mon Dec 10 12:54:06 CST 2018


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

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Mon Dec 10 16:47:46 2018 +0100

testbot/WineRunReconfig: Don't fail if the idle snapshot does not exist.

This simplifies recovery if an error occurred in a previous run that
resulted in the snapshot being deleted.

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

---

 testbot/bin/WineRunReconfig.pl | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/testbot/bin/WineRunReconfig.pl b/testbot/bin/WineRunReconfig.pl
index c903ae3..11f92c8 100755
--- a/testbot/bin/WineRunReconfig.pl
+++ b/testbot/bin/WineRunReconfig.pl
@@ -458,23 +458,28 @@ FatalTAError(undef, $TAError) if (defined $TAError);
 
 if ($NewStatus eq 'completed')
 {
-  Debug(Elapsed($Start), " Deleting the old ", $VM->IdleSnapshot, " snapshot\n");
-  $ErrMessage = $VM->GetDomain()->RemoveSnapshot();
-  if (defined $ErrMessage)
+  my $Domain = $VM->GetDomain();
+  my $IdleSnapshot = $VM->IdleSnapshot;
+  if ($Domain->HasSnapshot($IdleSnapshot))
   {
-    # It's not clear if the snapshot is still usable. Rather than try to figure
-    # it out now, let the next task deal with it.
-    FatalError("Could not remove the ". $VM->IdleSnapshot ." snapshot: $ErrMessage\n", "retry");
+    Debug(Elapsed($Start), " Deleting the old $IdleSnapshot snapshot\n");
+    $ErrMessage = $Domain->RemoveSnapshot();
+    if (defined $ErrMessage)
+    {
+      # It's not clear if the snapshot is still usable. Rather than try to
+      # figure it out now, let the next task deal with it.
+      FatalError("Could not remove the $IdleSnapshot snapshot: $ErrMessage\n", "retry");
+    }
   }
 
-  Debug(Elapsed($Start), " Recreating the ", $VM->IdleSnapshot, " snapshot\n");
-  $ErrMessage = $VM->GetDomain()->CreateSnapshot();
+  Debug(Elapsed($Start), " Recreating the $IdleSnapshot snapshot\n");
+  $ErrMessage = $Domain->CreateSnapshot();
   if (defined $ErrMessage)
   {
     # Without the snapshot the VM is not usable anymore but FatalError() will
     # just mark it as 'dirty'. It's only the next time it is used that the
     # problem will be noticed and that it will be taken offline.
-    FatalError("Could not recreate the ". $VM->IdleSnapshot ." snapshot: $ErrMessage\n");
+    FatalError("Could not recreate the $IdleSnapshot snapshot: $ErrMessage\n");
   }
 }
 




More information about the wine-cvs mailing list