diff --git a/4c7c4590-manager-Fix-mem-disk-net-stats-graphs.patch b/4c7c4590-manager-Fix-mem-disk-net-stats-graphs.patch new file mode 100644 index 00000000..8512675c --- /dev/null +++ b/4c7c4590-manager-Fix-mem-disk-net-stats-graphs.patch @@ -0,0 +1,42 @@ +Subject: manager: Fix mem, disk, net stats graphs (bz 1543896) +From: Cole Robinson crobinso@redhat.com Fri Feb 9 14:02:04 2018 -0500 +Date: Fri Feb 9 14:02:04 2018 -0500: +Git: 4c7c45908f6afd4e0edae9923218472d353caa3a + +python2/3 division compat messed this up + +https://bugzilla.redhat.com/show_bug.cgi?id=1543896 + +diff --git a/virtManager/domain.py b/virtManager/domain.py +index ed94cf1..6d3dac2 100644 +--- a/virtManager/domain.py ++++ b/virtManager/domain.py +@@ -1984,7 +1984,7 @@ class vmmDomain(vmmLibvirtObject): + except libvirt.libvirtError as err: + logging.error("Error reading mem stats: %s", err) + +- pcentCurrMem = (curmem // float(totalmem)) * 100 ++ pcentCurrMem = (curmem / float(totalmem)) * 100 + pcentCurrMem = max(0.0, min(pcentCurrMem, 100.0)) + + return pcentCurrMem, curmem +diff --git a/virtManager/manager.py b/virtManager/manager.py +index d6640fb..d38fc4e 100644 +--- a/virtManager/manager.py ++++ b/virtManager/manager.py +@@ -1068,7 +1068,7 @@ class vmmManager(vmmGObjectUI): + return + + d1, d2 = obj.disk_io_vectors(GRAPH_LEN, self.max_disk_rate) +- data = [(x + y) // 2 for x, y in zip(d1, d2)] ++ data = [(x + y) / 2 for x, y in zip(d1, d2)] + cell.set_property('data_array', data) + + def network_traffic_img(self, column_ignore, cell, model, _iter, data): +@@ -1077,5 +1077,5 @@ class vmmManager(vmmGObjectUI): + return + + d1, d2 = obj.network_traffic_vectors(GRAPH_LEN, self.max_net_rate) +- data = [(x + y) // 2 for x, y in zip(d1, d2)] ++ data = [(x + y) / 2 for x, y in zip(d1, d2)] + cell.set_property('data_array', data) diff --git a/virt-manager.changes b/virt-manager.changes index 83fae8ed..d19524b1 100644 --- a/virt-manager.changes +++ b/virt-manager.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Feb 9 15:39:31 MST 2018 - carnold@suse.com + +- Upstream bug fix (bsc#1027942) + 4c7c4590-manager-Fix-mem-disk-net-stats-graphs.patch + ------------------------------------------------------------------- Wed Feb 7 08:58:09 MST 2018 - carnold@suse.com diff --git a/virt-manager.spec b/virt-manager.spec index 50914274..b358618a 100644 --- a/virt-manager.spec +++ b/virt-manager.spec @@ -38,6 +38,7 @@ Source1: virt-install.rb Source2: virt-install.desktop Source3: virt-manager-supportconfig # Upstream Patches +Patch0: 4c7c4590-manager-Fix-mem-disk-net-stats-graphs.patch # SUSE Only Patch70: virtman-desktop.patch Patch71: virtman-kvm.patch @@ -176,6 +177,7 @@ machine). %prep %setup -q # Upstream Patches +%patch0 -p1 # SUSE Only %patch70 -p1 %patch71 -p1