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

[et-mgmt-tools] [PATCH] virt-manager: don't use cpu_time and get_memory



Hi,
neither cpu_time() nor get_memory() exist anymore so virt-manager throws
exceptions when trying to sort columns. Use cpu_time() and
current_memory_percentage() instead.
Cheers,
 -- Guido
# HG changeset patch
# User "Guido Günther <agx sigxcpu org>"
# Date 1222969422 -7200
# Node ID d37eb13391d555c4abcee0ef13d1d484f021b655
# Parent  6c334338589672a71cd45185faca46c41e17c6a9
fix sorting exceptions
* * *

diff -r e61e0f8d1a41 src/virtManager/manager.py
--- a/src/virtManager/manager.py	Thu Oct 02 15:43:27 2008 +0200
+++ b/src/virtManager/manager.py	Thu Oct 02 20:36:31 2008 +0200
@@ -897,10 +897,10 @@
         return cmp(model.get_value(iter1, ROW_NAME), model.get_value(iter2, ROW_NAME))
 
     def vmlist_cpu_usage_sorter(self, model, iter1, iter2):
-        return cmp(model.get_value(iter1, ROW_HANDLE).cpu_time(), model.get_value(iter2, ROW_HANDLE).cpu_time())
+        return cmp(model.get_value(iter1, ROW_HANDLE).cpu_time_percentage(), model.get_value(iter2, ROW_HANDLE).cpu_time_percentage())
 
     def vmlist_memory_usage_sorter(self, model, iter1, iter2):
-        return cmp(model.get_value(iter1, ROW_HANDLE).get_memory(), model.get_value(iter2, ROW_HANDLE).get_memory())
+        return cmp(model.get_value(iter1, ROW_HANDLE).current_memory_percentage(), model.get_value(iter2, ROW_HANDLE).current_memory_percentage())
 
     def vmlist_disk_usage_sorter(self, model, iter1, iter2):
         return cmp(model.get_value(iter1, ROW_HANDLE).disk_usage(), model.get_value(iter2, ROW_HANDLE).disk_usage())

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