Francois Gouget : testbot/LibvirtTool: Skip creating the intermediate -live snapshot.
Alexandre Julliard
julliard at winehq.org
Tue Feb 15 15:55:38 CST 2022
Module: tools
Branch: master
Commit: 93052eced61615df6d9acf5b4d4ef455c284b119
URL: https://source.winehq.org/git/tools.git/?a=commit;h=93052eced61615df6d9acf5b4d4ef455c284b119
Author: Francois Gouget <fgouget at codeweavers.com>
Date: Tue Feb 15 05:03:19 2022 +0100
testbot/LibvirtTool: Skip creating the intermediate -live snapshot.
Basing the localized snapshots on the plain -live snapshot is not very
useful and skipping this intermediate step makes the code simpler.
Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
testbot/bin/LibvirtTool.pl | 43 +++++++++++++++++++------------------------
1 file changed, 19 insertions(+), 24 deletions(-)
diff --git a/testbot/bin/LibvirtTool.pl b/testbot/bin/LibvirtTool.pl
index fad0727..3b2794f 100755
--- a/testbot/bin/LibvirtTool.pl
+++ b/testbot/bin/LibvirtTool.pl
@@ -603,6 +603,7 @@ sub Revert()
# Add some extra time to set up the VM locale and reboot it
$ExtraTimeout += $VMToolTimeout;
$SetLocale = "$1-$2";
+ $CreateSnapshot = 1;
Debug(Elapsed($Start), " $VMKey does not yet have a $DomainSnapshot-$SetLocale snapshot\n");
}
if (!$Domain->HasSnapshot($DomainSnapshot) and $DomainSnapshot =~ s/-live$//)
@@ -655,7 +656,7 @@ sub Revert()
# Mark the VM as sleeping which allows the scheduler to abort the revert in
# favor of higher priority tasks. But don't allow interruptions in the
# middle of snapshot creation!
- if (!$CreateSnapshot and !$SetLocale)
+ if (!$CreateSnapshot)
{
return 1 if (ChangeStatus("reverting", "sleeping"));
}
@@ -664,10 +665,22 @@ sub Revert()
# reboot so reset start.count in that case.
SetupTestAgentd($Booting, ($CreateSnapshot or $SetLocale), $SetLocale);
+ # Set up the VM locale
+ if ($SetLocale)
+ {
+ Debug(Elapsed($Start), " Setting up the $SetLocale locale on $VMKey\n");
+ my @Cmd = ("$BinDir/SetWinLocale", $VM->Hostname, "--default", $SetLocale);
+ push @Cmd, "--debug" if ($Debug);
+ if (system(@Cmd))
+ {
+ FatalError("Could not set the $VMKey locale to $SetLocale\n");
+ }
+ $Booting = 1;
+ }
+
if ($CreateSnapshot)
{
- $DomainSnapshot .= "-live";
- CreateSnapshot($Domain, $DomainSnapshot);
+ CreateSnapshot($Domain, $VM->IdleSnapshot);
if ($VM->Type eq "build" or $VM->Type eq "wine")
{
@@ -686,23 +699,11 @@ sub Revert()
Debug(Elapsed($Start), " Added a job to update and rebuild Wine on $VMKey\n");
}
}
- }
- # Set up the VM locale
- if ($SetLocale)
- {
- Debug(Elapsed($Start), " Setting up the $SetLocale locale on $VMKey\n");
- my @Cmd = ("$BinDir/SetWinLocale", $VM->Hostname, "--default", $SetLocale);
- push @Cmd, "--debug" if ($Debug);
- if (system(@Cmd))
- {
- FatalError("Could not set the $VMKey locale to $SetLocale\n");
- }
-
- $DomainSnapshot .= "-$SetLocale";
- CreateSnapshot($Domain, $DomainSnapshot);
+ # The activity monitor does not like it when VMs skip the sleeping step
+ return 1 if (ChangeStatus("reverting", "sleeping"));
}
- elsif (!$CreateSnapshot)
+ else
{
my $Sleep = ($Booting and $SleepAfterBoot > $SleepAfterRevert) ?
$SleepAfterBoot : $SleepAfterRevert;
@@ -711,12 +712,6 @@ sub Revert()
sleep($Sleep);
}
- if ($CreateSnapshot or $SetLocale)
- {
- # The activity monitor does not like it when VMs skip the sleeping step
- return 1 if (ChangeStatus("reverting", "sleeping"));
- }
-
return ChangeStatus($CurrentStatus, "idle", "done");
}
More information about the wine-cvs
mailing list