1 (* An example using the OCaml bindings. *)
6 if Array.length Sys.argv <= 1 || not (Sys.file_exists Sys.argv.(1)) then (
7 eprintf "Usage: lvs guest.img\n";
11 let h = Guestfs.create () in
12 Guestfs.add_drive h Sys.argv.(1);
15 let pvs = Guestfs.pvs h in
16 printf "PVs found: [ %s ]\n" (String.concat "; " (Array.to_list pvs));
18 let vgs = Guestfs.vgs h in
19 printf "VGs found: [ %s ]\n" (String.concat "; " (Array.to_list vgs));
21 let lvs = Guestfs.lvs h in
22 printf "LVs found: [ %s ]\n" (String.concat "; " (Array.to_list lvs));
24 (* Helps to find any allocation errors. *)