Use virConnectGetAllDomainStats API to collect domain stats (RHBZ#1422795).
[virt-top.git] / src / utils.ml
index 5fcc905..4332ff7 100644 (file)
@@ -32,6 +32,12 @@ let (/^) = Int64.div
 (* failwithf is a printf-like version of failwith. *)
 let failwithf fs = ksprintf failwith fs
 
+let rec range a b =
+  if a <= b then
+    a :: range (a+1) b
+  else
+    []
+
 (* Input a whole file as a list of lines. *)
 let input_all_lines chan =
   let lines = ref [] in