Blame SOURCES/0052-v2v-linux-Print-block-device-map-in-verbose-mode.patch

0d20ef
From d79d6b9331e5ecbec35b001ab2127e11c55f1d05 Mon Sep 17 00:00:00 2001
0d20ef
From: "Richard W.M. Jones" <rjones@redhat.com>
0d20ef
Date: Tue, 18 Nov 2014 13:53:13 +0000
0d20ef
Subject: [PATCH] v2v: linux: Print block device map in verbose mode.
0d20ef
0d20ef
Very useful for debugging device mapping problems.
0d20ef
0d20ef
(cherry picked from commit e25f68c47efaab886ada330b7ab596681705b02b)
0d20ef
---
0d20ef
 v2v/convert_linux.ml | 9 +++++++++
0d20ef
 1 file changed, 9 insertions(+)
0d20ef
0d20ef
diff --git a/v2v/convert_linux.ml b/v2v/convert_linux.ml
0d20ef
index 44b6c7f..2f97ca1 100644
0d20ef
--- a/v2v/convert_linux.ml
0d20ef
+++ b/v2v/convert_linux.ml
0d20ef
@@ -1263,6 +1263,15 @@ let rec convert ~verbose ~keep_serial_console (g : G.guestfs) inspect source =
0d20ef
           "xvd" ^ drive_name i, block_prefix_after_conversion ^ drive_name i
0d20ef
       ) source.s_disks in
0d20ef
 
0d20ef
+    if verbose then (
0d20ef
+      printf "block device map:\n";
0d20ef
+      List.iter (
0d20ef
+        fun (source_dev, target_dev) ->
0d20ef
+          printf "\t%s\t-> %s\n" source_dev target_dev
0d20ef
+      ) (List.sort (fun (a,_) (b,_) -> compare a b) map);
0d20ef
+      flush stdout
0d20ef
+    );
0d20ef
+
0d20ef
     (* Possible Augeas paths to search for device names. *)
0d20ef
     let paths = [
0d20ef
       (* /etc/fstab *)
0d20ef
-- 
0d20ef
1.8.3.1
0d20ef