Francois Gouget : testbot: Base LibvirtDomain::IsPoweredOn() on get_state( ).
Module: tools Branch: master Commit: bfb23ab81b1bd15ba180fcc05a9d4ef0624134f8 URL: http://source.winehq.org/git/tools.git/?a=commit;h=bfb23ab81b1bd15ba180fcc05... Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Thu Oct 19 14:54:16 2017 +0200 testbot: Base LibvirtDomain::IsPoweredOn() on get_state(). is_active() returns true even if the VM is in the process of being reverted (i.e. it uses resources) which is not what we are after. So use get_state() which provides more detailed information. Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- testbot/lib/WineTestBot/LibvirtDomain.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/testbot/lib/WineTestBot/LibvirtDomain.pm b/testbot/lib/WineTestBot/LibvirtDomain.pm index 20d619a..1b74315 100644 --- a/testbot/lib/WineTestBot/LibvirtDomain.pm +++ b/testbot/lib/WineTestBot/LibvirtDomain.pm @@ -273,9 +273,10 @@ sub IsPoweredOn($) return undef; } - my $IsActive; - eval { $IsActive = $Domain->is_active() }; - return $@ ? $self->_Reset(undef) : $IsActive; + my ($State, $_Reason); + eval { ($State, $_Reason) = $Domain->get_state() }; + return $self->_Reset(undef) if ($@); + return ($State == Sys::Virt::Domain::STATE_RUNNING); } sub PowerOff($$)
participants (1)
-
Alexandre Julliard