diff --git a/sparsify/cmdline.ml b/sparsify/cmdline.ml index 3eb0d5b4f..523d612bd 100644 --- a/sparsify/cmdline.ml +++ b/sparsify/cmdline.ml @@ -142,11 +142,7 @@ read the man page virt-sparsify(1). (* The input disk must be an absolute path, so we can store the name * in the overlay disk. *) - let indisk = - if not (Filename.is_relative indisk) then - indisk - else - Sys.getcwd () // indisk in + let indisk = absolute_path indisk in (* Check the output is not a char special (RHBZ#1056290). *) if is_char_device outdisk then diff --git a/v2v/input_disk.ml b/v2v/input_disk.ml index d56c4760d..3926602ef 100644 --- a/v2v/input_disk.ml +++ b/v2v/input_disk.ml @@ -63,9 +63,7 @@ class input_disk input_format disk = object error (f_"-i disk: invalid input filename (%s)") disk; (* Get the absolute path to the disk file. *) - let disk_absolute = - if not (Filename.is_relative disk) then disk - else Sys.getcwd () // disk in + let disk_absolute = absolute_path disk in (* The rest of virt-v2v doesn't actually work unless we detect * the format of the input, so: diff --git a/v2v/input_ova.ml b/v2v/input_ova.ml index 13c18b229..d86c637e1 100644 --- a/v2v/input_ova.ml +++ b/v2v/input_ova.ml @@ -100,9 +100,7 @@ object ) in (* Exploded path must be absolute (RHBZ#1155121). *) - let exploded = - if not (Filename.is_relative exploded) then exploded - else Sys.getcwd () // exploded in + let exploded = absolute_path exploded in (* Find files in [dir] ending with [ext]. *) let find_files dir ext =