Module: tools
Branch: master
Commit: 4561043d9d57b397856838abc0c89bc4761ba2f2
URL: http://source.winehq.org/git/tools.git/?a=commit;h=4561043d9d57b397856838ab…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Tue Dec 17 11:01:42 2013 +0100
testbot: Renamed FilterHypervisors() to make it clearer it takes a list of hypervisors.
---
testbot/lib/WineTestBot/Jobs.pm | 2 +-
testbot/lib/WineTestBot/VMs.pm | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/testbot/lib/WineTestBot/Jobs.pm b/testbot/lib/WineTestBot/Jobs.pm
index 94eae04..5d50fde 100644
--- a/testbot/lib/WineTestBot/Jobs.pm
+++ b/testbot/lib/WineTestBot/Jobs.pm
@@ -433,7 +433,7 @@ sub ScheduleOnHost($$)
my $HostVMs = CreateVMs();
$HostVMs->FilterEnabledRole();
- $HostVMs->FilterHypervisor($Hypervisors);
+ $HostVMs->FilterHypervisors($Hypervisors);
# Count the VMs that are 'active', that is, that use resources on the host,
# and those that are reverting. Also build a prioritized list of those that
diff --git a/testbot/lib/WineTestBot/VMs.pm b/testbot/lib/WineTestBot/VMs.pm
index d4267e0..55c7c6c 100644
--- a/testbot/lib/WineTestBot/VMs.pm
+++ b/testbot/lib/WineTestBot/VMs.pm
@@ -702,12 +702,12 @@ sub FilterEnabledStatus($)
$self->AddFilter("Status", ["dirty", "reverting", "sleeping", "idle", "running", "off"]);
}
-sub FilterHypervisor
+sub FilterHypervisors($$)
{
my $self = shift;
- my $Hypervisor = $_[0];
+ my $Hypervisors = $_[0];
- $self->AddFilter("VirtURI", $Hypervisor);
+ $self->AddFilter("VirtURI", $Hypervisors);
}
1;
Module: tools
Branch: master
Commit: 9778857dac6c0932745b8796adcffb047fced233
URL: http://source.winehq.org/git/tools.git/?a=commit;h=9778857dac6c0932745b8796…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Tue Dec 17 11:01:05 2013 +0100
testbot: Only schedule active VMs.
The retired and deleted VMs should be ignored, even if they look like they are running.
---
testbot/lib/WineTestBot/Jobs.pm | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/testbot/lib/WineTestBot/Jobs.pm b/testbot/lib/WineTestBot/Jobs.pm
index e9a5119..94eae04 100644
--- a/testbot/lib/WineTestBot/Jobs.pm
+++ b/testbot/lib/WineTestBot/Jobs.pm
@@ -432,6 +432,7 @@ sub ScheduleOnHost($$)
my ($SortedJobs, $Hypervisors) = @_;
my $HostVMs = CreateVMs();
+ $HostVMs->FilterEnabledRole();
$HostVMs->FilterHypervisor($Hypervisors);
# Count the VMs that are 'active', that is, that use resources on the host,
Module: tools
Branch: master
Commit: bf33ef2713e9dc2dffc463d2de97e8c7d42b03a2
URL: http://source.winehq.org/git/tools.git/?a=commit;h=bf33ef2713e9dc2dffc463d2…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Tue Dec 17 11:00:48 2013 +0100
testbot: PowerOff() should not return an error if a VM is already off.
VMs may be put in unexpected states when an administrator manually
reconfigures them. So, even though we normally don't call PowerOff()
on powered off VMs, robustness dictates this change. Also ensure that
if an error does occur the error message contains the VM name. This
fixes various 'Scheduling problem in HandleXxx' error reports.
---
testbot/bin/RevertVM.pl | 13 +++++--------
testbot/lib/WineTestBot/VMs.pm | 20 +++++++++++++++-----
2 files changed, 20 insertions(+), 13 deletions(-)
diff --git a/testbot/bin/RevertVM.pl b/testbot/bin/RevertVM.pl
index 5f98191..2ce3be1 100755
--- a/testbot/bin/RevertVM.pl
+++ b/testbot/bin/RevertVM.pl
@@ -97,15 +97,12 @@ if (defined($ErrMessage))
FatalError "Can't change status for VM $VMKey: $ErrMessage", $VM;
}
-if ($VM->IsPoweredOn())
+# Some QEmu/KVM versions are buggy and cannot revert a running VM
+$ErrMessage = $VM->PowerOff(1);
+if (defined $ErrMessage)
{
- # Some QEmu/KVM versions are buggy and cannot revert a running VM
- $ErrMessage = $VM->PowerOff(1);
- if (defined $ErrMessage)
- {
- LogMsg "Could not shut down $VMKey: $ErrMessage\n";
- LogMsg "Trying the revert anyway\n";
- }
+ LogMsg "$ErrMessage\n";
+ LogMsg "Trying the revert anyway\n";
}
$ErrMessage = $VM->RevertToSnapshot($VM->IdleSnapshot);
diff --git a/testbot/lib/WineTestBot/VMs.pm b/testbot/lib/WineTestBot/VMs.pm
index 7c403cd..d4267e0 100644
--- a/testbot/lib/WineTestBot/VMs.pm
+++ b/testbot/lib/WineTestBot/VMs.pm
@@ -375,11 +375,21 @@ sub PowerOff($$)
my ($ErrMessage, $Domain) = $self->_GetDomain();
return $ErrMessage if (defined $ErrMessage);
- eval { $Domain->destroy() };
- return $@->message() if ($@);
-
- return $self->UpdateStatus($Domain) if (!$NoStatus);
- return undef;
+ if ($self->IsPoweredOn())
+ {
+ eval { $Domain->destroy() };
+ if ($@)
+ {
+ $ErrMessage = $@->message();
+ }
+ elsif ($self->IsPoweredOn())
+ {
+ $ErrMessage = "The VM is still active";
+ }
+ }
+ $ErrMessage ||= $self->UpdateStatus($Domain) if (!$NoStatus);
+ return undef if (!defined $ErrMessage);
+ return join("", "Could not power off ", $self->Name, ": ", $ErrMessage);
}
sub GetAgent($)