X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=lib%2Fdiskimage_linux_swsuspend.ml;h=93da753a42d6f3ba5b391c79630f3f43ccb73548;hb=2e218847fac3e2e7b698ae6cc6fe1a6f3b462431;hp=4fec7b36059fdff716d66bcf7f66af90ae276295;hpb=71536ae75dceb08e0f3c3403033fb2eb25a08883;p=virt-df.git diff --git a/lib/diskimage_linux_swsuspend.ml b/lib/diskimage_linux_swsuspend.ml index 4fec7b3..93da753 100644 --- a/lib/diskimage_linux_swsuspend.ml +++ b/lib/diskimage_linux_swsuspend.ml @@ -40,7 +40,7 @@ let rec probe dev = let fs_dev = new blocksize_overlay blocksize dev in { - fs_cb = callbacks; + fs_cb = callbacks (); fs_dev = fs_dev; fs_blocksize = blocksize; @@ -65,11 +65,14 @@ let rec probe dev = *) and offset_is_free _ _ = false -and callbacks = { - fs_cb_name = id; - fs_cb_printable_name = "Linux s/w suspend"; - fs_cb_offset_is_free = offset_is_free; -} +and callbacks = + let i = ref 0 in + fun () -> { + fs_cb_uq = (incr i; !i); + fs_cb_name = id; + fs_cb_printable_name = "Linux s/w suspend"; + fs_cb_offset_is_free = offset_is_free; + } (* Register the plugin. *) let () = register_plugin ~filesystem:probe id