Add the flags for enabling/disabling CPU, block and net stats.
[virt-top.git] / virt-df / virt_df_linux_swap.ml
1 (* 'df' command for virtual domains.
2  * $Id$
3  *
4  * Support for Linux swap partitions.
5  *)
6
7 (* Int64 operators for convenience. *)
8 let (+^) = Int64.add
9 let (-^) = Int64.sub
10 let ( *^ ) = Int64.mul
11 let (/^) = Int64.div
12
13 let probe_swap target part_type fd start size =
14   Virt_df.Swap {
15     Virt_df.swap_name = "Linux swap";
16     swap_block_size = 4096L;            (* XXX *)
17     swap_blocks_total = size *^ 512L /^ 4096L;
18   }
19
20 (* Register with main code. *)
21 let () =
22   Virt_df.fs_register
23     [ 0x82 ]                            (* Partition type. *)
24     probe_swap