From 5616e76a5a01656aa0dcc323fcd1fcd77764e638 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 27 Sep 2007 18:59:54 +0100 Subject: * configure.ac: Changed version to 0.3.2.9. * Makefile.in: Re-enable virt-df. * virt-df/virt_df*.ml: Mostly finished off the core of virt-df. Ext2/3 support. No LVM as yet. * virt-df/README: Added README file. --- virt-df/virt_df_linux_swap.ml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 virt-df/virt_df_linux_swap.ml (limited to 'virt-df/virt_df_linux_swap.ml') diff --git a/virt-df/virt_df_linux_swap.ml b/virt-df/virt_df_linux_swap.ml new file mode 100644 index 0000000..a1f759a --- /dev/null +++ b/virt-df/virt_df_linux_swap.ml @@ -0,0 +1,24 @@ +(* 'df' command for virtual domains. + * $Id$ + * + * Support for Linux swap partitions. + *) + +(* Int64 operators for convenience. *) +let (+^) = Int64.add +let (-^) = Int64.sub +let ( *^ ) = Int64.mul +let (/^) = Int64.div + +let probe_swap target part_type fd start size = + Virt_df.Swap { + Virt_df.swap_name = "Linux swap"; + swap_block_size = 4096L; (* XXX *) + swap_blocks_total = size *^ 512L /^ 4096L; + } + +(* Register with main code. *) +let () = + Virt_df.fs_register + [ 0x82 ] (* Partition type. *) + probe_swap -- cgit