From e6c56b66b0cc4b4d46d6ee6dc1cec27eabef3138 Mon Sep 17 00:00:00 2001 From: Jordi Sanfeliu Date: Tue, 1 Dec 2015 10:03:16 +0100 Subject: [PATCH] fixed in 'libvirt.pm' limiting to 100 all CPU values greater than 100 --- Changes | 5 +++++ lib/libvirt.pm | 1 + 2 files changed, 6 insertions(+) diff --git a/Changes b/Changes index 50fb888..48cdfc7 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,8 @@ +N.N.N - DD-MMM-2015 +==================== +- Fixed in 'libvirt.pm' limiting to 100 all CPU values greater than 100. + + 3.8.1 - 13-Nov-2015 ==================== - Added support in ZFS graph for versions older than 0.6.4. diff --git a/lib/libvirt.pm b/lib/libvirt.pm index a6a62de..7ceb682 100644 --- a/lib/libvirt.pm +++ b/lib/libvirt.pm @@ -179,6 +179,7 @@ sub libvirt_update { $cpu = $c - ($config->{libvirt_hist}->{$str} || 0); $cpu = 0 unless $c != $cpu; $cpu = $cpu * 100 / 60; + $cpu = $cpu > 100 ? 100 : $cpu; $config->{libvirt_hist}->{$str} = $c; } if(open(IN, "virsh dommemstat $vm |")) {