X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=sparsify%2Fsparsify.ml;h=956fccbe8c2f0bc7a908fac373ac9a81f8f5a1db;hp=89a2c1377d024eed0aad1b3d976869a4cc6e06d8;hb=342b4a55d056734a0344db8b4bcf1a90104a8a59;hpb=fac15924f59a076c903d453d20305e00e1ae258a diff --git a/sparsify/sparsify.ml b/sparsify/sparsify.ml index 89a2c13..956fccb 100644 --- a/sparsify/sparsify.ml +++ b/sparsify/sparsify.ml @@ -177,10 +177,15 @@ let () = let filesystems = g#list_filesystems () in let filesystems = List.map fst filesystems in let filesystems = List.sort compare filesystems in + + let is_ignored fs = + let fs = canonicalize fs in + List.exists (fun fs' -> fs = canonicalize fs') ignores + in + List.iter ( fun fs -> - if not (List.mem fs ignores) then ( - + if not (is_ignored fs) then ( let mounted = try g#mount_options "" fs "/"; true with _ -> false in @@ -269,6 +274,8 @@ let output_format = ); if string_prefix line "QEMU QCOW Image (v2)" then "qcow2" + else if string_find line "VirtualBox" >= 0 then + "vdi" else "raw" (* XXX guess *)