diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2008-04-16 08:15:56 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2008-04-16 08:15:56 +0100 |
commit | 027b0d92ed236fa24f211e053e81189cddffe7d7 (patch) | |
tree | c4c421cc01b9b964bc0cd471e65633f2b8d6cd1d /virt-df/virt_df_lvm2.ml | |
parent | 291265b7171d332d2969e07ac189d876e3d7f26d (diff) | |
download | virt-top-027b0d92ed236fa24f211e053e81189cddffe7d7.tar.gz virt-top-027b0d92ed236fa24f211e053e81189cddffe7d7.tar.xz virt-top-027b0d92ed236fa24f211e053e81189cddffe7d7.zip |
Make debug selectable at runtime.
Diffstat (limited to 'virt-df/virt_df_lvm2.ml')
-rw-r--r-- | virt-df/virt_df_lvm2.ml | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/virt-df/virt_df_lvm2.ml b/virt-df/virt_df_lvm2.ml index af58f97..314586e 100644 --- a/virt-df/virt_df_lvm2.ml +++ b/virt-df/virt_df_lvm2.ml @@ -37,11 +37,11 @@ let sector_size64 = 512L let rec probe_pv lvm_plugin_id dev = try let uuid, _ = read_pv_label dev in - if debug then + if !debug then eprintf "LVM2 detected PV UUID %s\n%!" uuid; { lvm_plugin_id = lvm_plugin_id; pv_uuid = uuid } with exn -> - if debug then prerr_endline (Printexc.to_string exn); + if !debug then prerr_endline (Printexc.to_string exn); raise Not_found and read_pv_label dev = @@ -87,7 +87,7 @@ and read_pv_label dev = (sprintf "LVM2: read_pv_label: %s: not an LVM2 physical volume" dev#name) and read_metadata dev offset32 len32 = - if debug then + if !debug then eprintf "metadata: offset 0x%lx len %ld bytes\n%!" offset32 len32; (* Check the offset and length are sensible. *) @@ -166,7 +166,7 @@ let rec list_lvs devs = vgname, (pvuuids, vgmeta)) vgs in (* Print the VGs. *) - if debug then + if !debug then List.iter ( fun (vgname, (pvuuids, vgmeta)) -> eprintf "VG %s is on PVs: %s\n%!" vgname (String.concat "," pvuuids) @@ -249,7 +249,7 @@ let rec list_lvs devs = ) vgs in (* Print the LVs. *) - if debug then + if !debug then List.iter ( fun (vgname, (pvuuids, vgmeta, lvs)) -> let lvnames = List.map fst lvs in |