[Pkg-libvirt-commits] [libguestfs] 35/179: v2v: Print mountpoint stats in debugging output.

Hilko Bengen bengen at moszumanska.debian.org
Fri Oct 31 19:08:03 UTC 2014


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to branch experimental
in repository libguestfs.

commit 7b8ed81560874a4992c249848dd49a4815b1d79d
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Wed Oct 8 20:21:06 2014 +0100

    v2v: Print mountpoint stats in debugging output.
    
    Useful for debugging speed / fstrim issues.
---
 v2v/v2v.ml | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/v2v/v2v.ml b/v2v/v2v.ml
index 8943457..1da890b 100644
--- a/v2v/v2v.ml
+++ b/v2v/v2v.ml
@@ -35,6 +35,12 @@ type mpstat = {
   mp_vfs : string;                      (* VFS type (eg. "ext4") *)
 }
 
+let print_mpstat chan { mp_dev = dev; mp_path = path;
+                        mp_statvfs = s; mp_vfs = vfs } =
+  fprintf chan "mountpoint statvfs %s %s (%s):\n" dev path vfs;
+  fprintf chan "  bsize=%Ld blocks=%Ld bfree=%Ld bavail=%Ld\n"
+    s.G.bsize s.G.blocks s.G.bfree s.G.bavail
+
 let () = Random.self_init ()
 
 let rec main () =
@@ -206,6 +212,12 @@ let rec main () =
       { mp_dev = dev; mp_path = path; mp_statvfs = statvfs; mp_vfs = vfs }
   ) (g#mountpoints ()) in
 
+  if verbose then (
+    (* This is useful for debugging speed / fstrim issues. *)
+    printf "mpstats:\n";
+    List.iter (print_mpstat Pervasives.stdout) mpstats
+  );
+
   (* Check there is enough free space to perform conversion. *)
   msg (f_"Checking for sufficient free disk space in the guest");
   check_free_space mpstats;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list