Blame SOURCES/0076-v2v-o-rhv-upload-Fix-error-message-disk-numbering-RH.patch

97ae69
From 21a58c8f5f0d4386b5a3c444883d87ccf92b15b5 Mon Sep 17 00:00:00 2001
97ae69
From: "Richard W.M. Jones" <rjones@redhat.com>
97ae69
Date: Tue, 14 Aug 2018 12:50:07 +0100
97ae69
Subject: [PATCH] v2v: -o rhv-upload: Fix error message disk numbering
97ae69
 (RHBZ#1615885).
97ae69
97ae69
The output method used the s_disk_id field assuming it was a unique,
97ae69
monotonically increasing number counting from 0.  However this is not
97ae69
the case, the input method simply has to set s_disk_id to be unique
97ae69
for each disk.
97ae69
97ae69
Fixes commit cc04573927cca97de60d544d37467e67c25867a7.
97ae69
97ae69
Thanks: Xiaodai Wang
97ae69
---
97ae69
 v2v/output_rhv_upload.ml | 6 +++---
97ae69
 1 file changed, 3 insertions(+), 3 deletions(-)
97ae69
97ae69
diff --git a/v2v/output_rhv_upload.ml b/v2v/output_rhv_upload.ml
97ae69
index 63fa2411a..7dbd98a0d 100644
97ae69
--- a/v2v/output_rhv_upload.ml
97ae69
+++ b/v2v/output_rhv_upload.ml
97ae69
@@ -383,13 +383,13 @@ If the messages above are not sufficient to diagnose the problem then add the 
97ae69
      *)
97ae69
     let nr_disks = List.length targets in
97ae69
     let image_uuids =
97ae69
-      List.map (
97ae69
-        fun t ->
97ae69
+      List.mapi (
97ae69
+        fun i t ->
97ae69
           let id = t.target_overlay.ov_source.s_disk_id in
97ae69
           let diskid_file = diskid_file_of_id id in
97ae69
           if not (wait_for_file diskid_file finalization_timeout) then
97ae69
             error (f_"transfer of disk %d/%d failed, see earlier error messages")
97ae69
-                  (id+1) nr_disks;
97ae69
+                  (i+1) nr_disks;
97ae69
           let diskid = read_whole_file diskid_file in
97ae69
           diskid
97ae69
       ) targets in
97ae69
-- 
c71420
2.20.1
97ae69