From: Avi Kivity <[email protected]>

With plenty of counters and wide, short screens it's hard to see what's on
the top.  So sort the output.

Signed-off-by: Avi Kivity <[email protected]>

diff --git a/kvm/kvm_stat b/kvm/kvm_stat
index 677683a..c55bf88 100755
--- a/kvm/kvm_stat
+++ b/kvm/kvm_stat
@@ -306,7 +306,12 @@ def tui(screen, stats):
         screen.addstr(0, 0, 'kvm statistics')
         row = 2
         s = stats.get()
-        for key in sorted(s.keys()):
+        def sortkey(x):
+            if s[x][1]:
+                return -s[x][1]
+            else:
+                return x
+        for key in sorted(s.keys(), key = sortkey):
             if row >= screen.getmaxyx()[0]:
                 break
             values = s[key]
--
To unsubscribe from this list: send the line "unsubscribe kvm-commits" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to