[virt-tools-list] [PATCH] manager: show guest machine stats under Details -> Performance.

Tadej Janež tadej.janez at www.hicsalta.si
Sat Apr 27 22:42:32 UTC 2013


This fixes rhbz #878425.
---
 virtManager/details.py | 12 ++++++------
 virtManager/domain.py  |  2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/virtManager/details.py b/virtManager/details.py
index cd18aa8..6fc112f 100644
--- a/virtManager/details.py
+++ b/virtManager/details.py
@@ -2719,12 +2719,12 @@ class vmmDetails(vmmGObjectUI):
         dsk_txt = _("Disabled")
         net_txt = _("Disabled")
 
-        cpu_txt = "%d %%" % self.vm.host_cpu_time_percentage()
+        cpu_txt = "%d %%" % self.vm.guest_cpu_time_percentage()
 
-        vm_memory = self.vm.stats_memory()
-        host_memory = self.vm.conn.host_memory_size()
-        mem_txt = "%d MB of %d MB" % (int(round(vm_memory / 1024.0)),
-                                      int(round(host_memory / 1024.0)))
+        cur_vm_memory = self.vm.stats_memory()
+        vm_memory = self.vm.maximum_memory()
+        mem_txt = "%s of %s" % (util.pretty_mem(cur_vm_memory),
+                                util.pretty_mem(vm_memory))
 
         if self.config.get_stats_enable_disk_poll():
             dsk_txt = _dsk_rx_tx_text(self.vm.disk_read_rate(),
@@ -2740,7 +2740,7 @@ class vmmDetails(vmmGObjectUI):
         self.widget("overview-disk-usage-text").set_markup(dsk_txt)
 
         self.cpu_usage_graph.set_property("data_array",
-                                          self.vm.host_cpu_time_vector())
+                                          self.vm.guest_cpu_time_vector())
         self.memory_usage_graph.set_property("data_array",
                                              self.vm.stats_memory_vector())
         self.disk_io_graph.set_property("data_array",
diff --git a/virtManager/domain.py b/virtManager/domain.py
index 823e17b..e412d88 100644
--- a/virtManager/domain.py
+++ b/virtManager/domain.py
@@ -1264,7 +1264,7 @@ class vmmDomain(vmmLibvirtObject):
         if not self.is_active():
             curmem = 0
 
-        pcentCurrMem = curmem * 100.0 / self.conn.host_memory_size()
+        pcentCurrMem = curmem * 100.0 / self.maximum_memory()
         pcentCurrMem = max(0.0, min(pcentCurrMem, 100.0))
 
         return pcentCurrMem, curmem
-- 
1.8.1.4




More information about the virt-tools-list mailing list