sparsify, v2v: use Common_utils.absolute_path

Use the common function for ensuring a path is absolute; it should not
change the behaviour at all.
This commit is contained in:
Pino Toscano
2016-08-08 17:25:40 +02:00
parent 98dea4978d
commit 8a9c747ff6
3 changed files with 3 additions and 11 deletions

View File

@@ -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

View File

@@ -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:

View File

@@ -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 =