[Libguestfs] [PATCH virt-v2v 1/3] common: Adapt to renamed function On_exit.rmdir -> On_exit.rm_rf

Laszlo Ersek lersek at redhat.com
Fri Jul 15 07:32:09 UTC 2022


On 07/14/22 14:38, Richard W.M. Jones wrote:
> This function was renamed to make it clearer what it does (and that
> it's potentially dangerous).  The functionality is unchanged.
> ---
>  input/OVA.ml                   | 2 +-
>  input/parse_domain_from_vmx.ml | 2 +-
>  lib/nbdkit.ml                  | 2 +-
>  lib/qemuNBD.ml                 | 2 +-
>  lib/utils.ml                   | 2 +-
>  output/python_script.ml        | 2 +-
>  common                         | 2 +-
>  7 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/input/OVA.ml b/input/OVA.ml
> index 9e9c371285..09ceee98cb 100644
> --- a/input/OVA.ml
> +++ b/input/OVA.ml
> @@ -78,7 +78,7 @@ let rec parse_ova ova =
>      else (
>        let tmpdir =
>          let t = Mkdtemp.temp_dir ~base_dir:large_tmpdir "ova." in
> -        On_exit.rmdir t;
> +        On_exit.rm_rf t;
>          t in
>  
>        match detect_file_type ova with
> diff --git a/input/parse_domain_from_vmx.ml b/input/parse_domain_from_vmx.ml
> index 947ca41485..7aca2c2408 100644
> --- a/input/parse_domain_from_vmx.ml
> +++ b/input/parse_domain_from_vmx.ml
> @@ -375,7 +375,7 @@ and find_nics vmx =
>  let parse_domain_from_vmx vmx_source =
>    let tmpdir =
>      let t = Mkdtemp.temp_dir "vmx." in
> -    On_exit.rmdir t;
> +    On_exit.rm_rf t;
>      t in
>  
>    (* If the transport is SSH, fetch the file from remote, else
> diff --git a/lib/nbdkit.ml b/lib/nbdkit.ml
> index 07896684e8..1137b6bba2 100644
> --- a/lib/nbdkit.ml
> +++ b/lib/nbdkit.ml
> @@ -105,7 +105,7 @@ let add_filter_if_available cmd filter =
>  let run_unix socket cmd =
>    (* Create a temporary directory where we place the PID file. *)
>    let piddir = Mkdtemp.temp_dir "v2vnbdkit." in
> -  On_exit.rmdir piddir;
> +  On_exit.rm_rf piddir;
>  
>    let id = unique () in
>    let pidfile = piddir // sprintf "nbdkit%d.pid" id in
> diff --git a/lib/qemuNBD.ml b/lib/qemuNBD.ml
> index bbb65f4155..c3dd1666c4 100644
> --- a/lib/qemuNBD.ml
> +++ b/lib/qemuNBD.ml
> @@ -69,7 +69,7 @@ let run_unix socket { disk; snapshot; format; imgopts } =
>  
>    (* Create a temporary directory where we place the PID file. *)
>    let piddir = Mkdtemp.temp_dir "v2vqemunbd." in
> -  On_exit.rmdir piddir;
> +  On_exit.rm_rf piddir;
>  
>    let id = unique () in
>    let pidfile = piddir // sprintf "qemunbd%d.pid" id in
> diff --git a/lib/utils.ml b/lib/utils.ml
> index 128bb69769..fd45769415 100644
> --- a/lib/utils.ml
> +++ b/lib/utils.ml
> @@ -203,7 +203,7 @@ let error_if_no_ssh_agent () =
>  let create_v2v_directory () =
>    let d = Mkdtemp.temp_dir "v2v." in
>    chown_for_libvirt_rhbz_1045069 d;
> -  On_exit.rmdir d;
> +  On_exit.rm_rf d;
>    d
>  
>  (* Wait for a file to appear until a timeout. *)
> diff --git a/output/python_script.ml b/output/python_script.ml
> index 54ccd1b55f..ecf46c2d4b 100644
> --- a/output/python_script.ml
> +++ b/output/python_script.ml
> @@ -33,7 +33,7 @@ type script = {
>  
>  let create ?(name = "script.py") code =
>    let tmpdir = Mkdtemp.temp_dir "v2v." in
> -  On_exit.rmdir tmpdir;
> +  On_exit.rm_rf tmpdir;
>    let path = tmpdir // name in
>    with_open_out path (fun chan -> output_string chan code);
>    { tmpdir; path }
> diff --git a/common b/common
> index 201632e4a7..c4c7d917b8 160000
> --- a/common
> +++ b/common
> @@ -1 +1 @@
> -Subproject commit 201632e4a78c1f591ea2d9038bd22f738642cf5c
> +Subproject commit c4c7d917b89295ee26d1c276d9426f905b474227
> 

Reviewed-by: Laszlo Ersek <lersek at redhat.com>


More information about the Libguestfs mailing list