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

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