From 91b5fb3641c91ff4e4778879d4bc866089923c28 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 13 Mar 2017 14:21:56 +0000 Subject: [PATCH] v2v: -i ova: Use full path for backing file. Works around a libvirt bug: https://bugzilla.redhat.com/show_bug.cgi?id=1431652 --- v2v/input_ova.ml | 6 +++++- v2v/test-v2v-i-ova-subfolders.sh | 2 +- v2v/test-v2v-i-ova-tar.sh | 2 +- v2v/test-v2v-i-ova-two-disks.sh | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/v2v/input_ova.ml b/v2v/input_ova.ml index a0a42a78d..fb6b28619 100644 --- a/v2v/input_ova.ml +++ b/v2v/input_ova.ml @@ -284,6 +284,10 @@ object * tar also works with 512 byte blocks. *) let size = roundup64 size 512L in + + (* Workaround for libvirt bug RHBZ#1431652. *) + let ova_path = absolute_path ova in + let doc = [ "file", JSON.Dict [ "driver", JSON.String "raw"; @@ -291,7 +295,7 @@ object "size", JSON.Int64 size; "file", JSON.Dict [ "driver", JSON.String "file"; - "filename", JSON.String ova] + "filename", JSON.String ova_path] ] ] in let uri = diff --git a/v2v/test-v2v-i-ova-subfolders.sh b/v2v/test-v2v-i-ova-subfolders.sh index 12e0e872b..be98d2c19 100755 --- a/v2v/test-v2v-i-ova-subfolders.sh +++ b/v2v/test-v2v-i-ova-subfolders.sh @@ -55,7 +55,7 @@ if grep -sq json: $d/source ; then # Normalize the output. # Remove directory prefix. # Exact offset will vary because of tar. - sed -i -e "s,\"$d/,\"," \ + sed -i -e "s,\"[^\"]*/$d/,\"," \ -e "s|\"offset\": [0-9]*,|\"offset\": x,|" $d/source diff -u test-v2v-i-ova-subfolders.expected2 $d/source else diff --git a/v2v/test-v2v-i-ova-tar.sh b/v2v/test-v2v-i-ova-tar.sh index 003d5e686..945869184 100755 --- a/v2v/test-v2v-i-ova-tar.sh +++ b/v2v/test-v2v-i-ova-tar.sh @@ -54,7 +54,7 @@ if grep -sq json: $d/source ; then # Normalize the output. # Remove directory prefix. # Exact offset will vary because of tar. - sed -i -e "s,\"$d/,\"," \ + sed -i -e "s,\"[^\"]*/$d/,\"," \ -e "s|\"offset\": [0-9]*,|\"offset\": x,|" $d/source diff -u test-v2v-i-ova-tar.expected2 $d/source else diff --git a/v2v/test-v2v-i-ova-two-disks.sh b/v2v/test-v2v-i-ova-two-disks.sh index 9ecc3806f..d5cca06a6 100755 --- a/v2v/test-v2v-i-ova-two-disks.sh +++ b/v2v/test-v2v-i-ova-two-disks.sh @@ -59,7 +59,7 @@ if grep -sq json: $d/source ; then # Normalize the output. # Remove directory prefix. # Exact offset will vary because of tar. - sed -i -e "s,\"$d/,\"," \ + sed -i -e "s,\"[^\"]*/$d/,\"," \ -e "s|\"offset\": [0-9]*,|\"offset\": x,|" $d/source diff -u test-v2v-i-ova-two-disks.expected2 $d/source else