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)) -- 2.1.0 _______________________________________________ virt-tools-list mailing list virt-tools-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/virt-tools-list