git.annexia.org
/
virt-df.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added private_data_functions.
[virt-df.git]
/
lib
/
diskimage_linux_swap.ml
diff --git
a/lib/diskimage_linux_swap.ml
b/lib/diskimage_linux_swap.ml
index
4933980
..
a3c1b23
100644
(file)
--- a/
lib/diskimage_linux_swap.ml
+++ b/
lib/diskimage_linux_swap.ml
@@
-20,14
+20,14
@@
Support for Linux swap partitions.
*)
Support for Linux swap partitions.
*)
-open Diskimage_
utils
+open Diskimage_
impl
open Int63.Operators
open Int63.Operators
-let
plugin_
id = "linux_swap"
+let id = "linux_swap"
let blocksize = ~^4096 (* XXX *)
let blocksize = ~^4096 (* XXX *)
-let probe dev =
+let
rec
probe dev =
(* Load the "superblock" (ie. first 0x1000 bytes). *)
let bits = dev#read_bitstring ~^0 ~^0x1000 in
(* Load the "superblock" (ie. first 0x1000 bytes). *)
let bits = dev#read_bitstring ~^0 ~^0x1000 in
@@
-40,7
+40,7
@@
let probe dev =
let fs_dev = new blocksize_overlay blocksize dev in
{
let fs_dev = new blocksize_overlay blocksize dev in
{
- fs_
plugin_id = plugin_id
;
+ fs_
cb = callbacks
;
fs_dev = fs_dev;
fs_blocksize = blocksize;
fs_dev = fs_dev;
fs_blocksize = blocksize;
@@
-63,9
+63,13
@@
let probe dev =
(* Linux swap space is always 'free', apart from the superblock.
* Compare diskimage_linux_swsuspend.ml
*)
(* Linux swap space is always 'free', apart from the superblock.
* Compare diskimage_linux_swsuspend.ml
*)
-
let
offset_is_free _ offset = offset >= blocksize
+
and
offset_is_free _ offset = offset >= blocksize
-let callbacks = {
- fs_cb_probe = probe;
+and callbacks = {
+ fs_cb_name = id;
+ fs_cb_printable_name = "Linux swap";
fs_cb_offset_is_free = offset_is_free;
}
fs_cb_offset_is_free = offset_is_free;
}
+
+(* Register the plugin. *)
+let () = register_plugin ~filesystem:probe id