[Libguestfs] [PATCH 3/3] v2v: change the reporting of RHV Tools messages/warnings/error

Richard W.M. Jones rjones at redhat.com
Wed Mar 27 10:43:00 UTC 2019


On Tue, Mar 26, 2019 at 06:02:42PM +0100, Pino Toscano wrote:
> The RHV Tools ISO is provided as Red Hat only product, and thus not
> available for all the virt-v2v users.  Hence, change the way we report
> the status of the installation of the qemu guest agent from the RHV
> Tools ISO:
> - do not warn if virt-v2v does not know how to install the package for
>   the current guest
> - do not warn if the ISO does not contain packages for the current guest
> - on successful installations, show an info message
> 
> Related: RHBZ#1691659
> ---
>  v2v/windows_virtio.ml | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/v2v/windows_virtio.ml b/v2v/windows_virtio.ml
> index d29033a01..996216bd7 100644
> --- a/v2v/windows_virtio.ml
> +++ b/v2v/windows_virtio.ml
> @@ -197,9 +197,7 @@ and install_linux_tools g inspect =
>      | _ -> None in
>  
>    match os with
> -  | None ->
> -      warning (f_"don't know how to install guest tools on %s-%d")
> -        inspect.i_distro inspect.i_major_version
> +  | None -> ()
>    | Some os ->
>        let src_path = "linux" // os in
>        let dst_path = "/var/tmp" in
> @@ -216,13 +214,13 @@ and install_linux_tools g inspect =
>        let packages =
>          copy_from_virtio_win g inspect src_path dst_path
>                               package_filter
> -                             (fun () ->
> -                               warning (f_"guest tools directory ‘%s’ is missing from the virtio-win directory or ISO.\n\nGuest tools are only provided in the RHV Guest Tools ISO, so this can happen if you are using the version of virtio-win which contains just the virtio drivers.  In this case only virtio drivers can be installed in the guest, and installation of Guest Tools will be skipped.")
> -                                       src_path) in
> +                             (fun () -> ()) in
>        debug "done copying %d files" (List.length packages);
>        let packages = List.map ((//) dst_path) packages in
>        try
>          Linux.install_local g inspect packages;
> +        if packages <> [] then
> +          info (f_"QEMU Guest Agent installed for this guest.");
>        with G.Error msg ->
>          warning (f_"failed to install QEMU Guest Agent: %s") msg

ACK

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v




More information about the Libguestfs mailing list