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);
16 let pvs = Guestfs.pvs h in
17 printf "PVs found: [ %s ]\n" (String.concat "; " (Array.to_list pvs));
19 let vgs = Guestfs.vgs h in
20 printf "VGs found: [ %s ]\n" (String.concat "; " (Array.to_list vgs));
22 let lvs = Guestfs.lvs h in
23 printf "LVs found: [ %s ]\n" (String.concat "; " (Array.to_list lvs));
25 (* Helps to find any allocation errors. *)