[Libguestfs] [PATCH v3 2/8] curl: Change the API to use an abstract data type.

Pino Toscano ptoscano at redhat.com
Thu Jul 7 17:00:40 UTC 2016


On Thursday 07 July 2016 17:30:01 Richard W.M. Jones wrote:
> Change the Curl module to use an ADT to store the name of the curl
> binary and the arguments.
> 
> The callers in virt-v2v are changed accordingly.
> 
> This also adds a (currently unused) ?proxy argument to allow callers
> to override the proxy.  It also adds some safety arguments implicitly.
> ---

Definitely a nice improvement, thanks!

Just a couple of notes below.

> +let run { curl = curl; args = args } =
> +  let config_file, chan = Filename.open_temp_file "curl" ".conf" in

I'd use "guestfs-curl" as prefix, as the location for this temporary
file is the general $TMPDIR and would be mislead as generated by curl
proper.

> diff --git a/v2v/copy_to_local.ml b/v2v/copy_to_local.ml
> index 717ba50..2e3b59b 100644
> --- a/v2v/copy_to_local.ml
> +++ b/v2v/copy_to_local.ml
> @@ -199,9 +199,9 @@ read the man page virt-v2v-copy-to-local(1).
>  
>      | ESXi _ ->
>         let curl_args = [
> -         "url", Some remote_disk;
> -         "output", Some local_disk;
> -       ] in
> +           "url", Some remote_disk;
> +           "output", Some local_disk;
> +         ] in

Small unneeded indentation change.

> diff --git a/v2v/vCenter.ml b/v2v/vCenter.ml
> index d41f223..ed4a9b2 100644
> --- a/v2v/vCenter.ml
> +++ b/v2v/vCenter.ml
> @@ -46,10 +46,10 @@ let get_session_cookie password scheme uri sslverify url =
>      Some !session_cookie
>    else (
>      let curl_args = [
> -      "head", None;
> -      "silent", None;
> -      "url", Some url;
> -    ] in
> +        "head", None;
> +        "silent", None;
> +        "url", Some url;
> +      ] in

Ditto.

Thanks,
-- 
Pino Toscano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20160707/bf800018/attachment.sig>


More information about the Libguestfs mailing list