Re: [virt-manager PATCH 2/2] Fix an exception while a XEN domain is shutting-down

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 02/25/2015 10:34 AM, Giuseppe Scrivano wrote:
> I've noticed twice today that 'guestcpus' was set to 0 while the
> domain was shutting down.  Play safe and check that 'guestcpus' is > 0
> before divide by it.
> 
> Signed-off-by: Giuseppe Scrivano <gscrivan@xxxxxxxxxx>
> ---
>  virtManager/domain.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/virtManager/domain.py b/virtManager/domain.py
> index 2ebceaa..a7c2442 100644
> --- a/virtManager/domain.py
> +++ b/virtManager/domain.py
> @@ -1513,7 +1513,7 @@ class vmmDomain(vmmLibvirtObject):
>              pcentbase = (((cpuTime) * 100.0) /
>                           ((now - prevTimestamp) * 1000.0 * 1000.0 * 1000.0))
>              pcentHostCpu = pcentbase / hostcpus
> -            pcentGuestCpu = pcentbase / guestcpus
> +            pcentGuestCpu = guestcpus > 0 and pcentbase / guestcpus or 0
>  
>          pcentHostCpu = max(0.0, min(100.0, pcentHostCpu))
>          pcentGuestCpu = max(0.0, min(100.0, pcentGuestCpu))
> 

ACK with a comment that you've seen this on RHEL5 xen, so it isn't
inadvertently dropped in the future.

Thanks,
Cole

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list




[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux