Module: tools Branch: master Commit: 98ec6ba6d7aa219201a2defda745af4febfbeef0 URL: https://source.winehq.org/git/tools.git/?a=commit;h=98ec6ba6d7aa219201a2defd...
Author: Francois Gouget fgouget@codeweavers.com Date: Wed Feb 28 01:54:29 2018 +0100
testbot: Check the current snapshot in LibvirtTool checkidle.
If the snapshot does not match then the current VM instance is not actually using the hypervisor domain so mark it off.
Signed-off-by: Francois Gouget fgouget@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
testbot/bin/LibvirtTool.pl | 7 +++++-- testbot/lib/WineTestBot/VMs.pm | 6 +++--- 2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/testbot/bin/LibvirtTool.pl b/testbot/bin/LibvirtTool.pl index 670c553..12eaa66 100755 --- a/testbot/bin/LibvirtTool.pl +++ b/testbot/bin/LibvirtTool.pl @@ -320,9 +320,12 @@ sub CheckIdle()
my ($ErrMessage, $SnapshotName) = $VM->GetDomain()->GetSnapshotName(); FatalError("$ErrMessage\n") if (defined $ErrMessage); - return PowerOff() if ($SnapshotName ne $VM->IdleSnapshot);
- return ChangeStatus("dirty", "idle", "done"); + # If the snapshot does not match then the virtual machine may be used by + # another VM instance. So don't touch it. All that counts is that this + # VM instance is not running. + my $NewStatus = ($SnapshotName eq $VM->IdleSnapshot) ? "idle" : "off"; + return ChangeStatus("dirty", $NewStatus, "done"); }
sub Revert() diff --git a/testbot/lib/WineTestBot/VMs.pm b/testbot/lib/WineTestBot/VMs.pm index d893e49..f098639 100644 --- a/testbot/lib/WineTestBot/VMs.pm +++ b/testbot/lib/WineTestBot/VMs.pm @@ -433,9 +433,9 @@ sub _RunVMTool($$$)
=item C<RunCheckIdle()>
-If the virtual machine state matches that of this VM instance, sets its status -to idle. If not the VM is simply marked as off. While this is happening the -VM status is set to dirty so the job scheduler does not try to use it. +If the hypervisor domain state matches that of this VM instance, sets its +status to idle. If not the VM is simply marked as off. While this is happening +the VM status is set to dirty so the job scheduler does not try to use it.
This operation can take a long time so it is performed in a separate process.