mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
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:
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user