mrc0mmand / rpms / libguestfs

Forked from rpms/libguestfs 3 years ago
Clone

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

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