[Libguestfs] [PATCH 2/2] v2v: linux: do not install qemu-guest-agent if already installed

Richard W.M. Jones rjones at redhat.com
Thu Sep 19 18:48:04 UTC 2019


On Thu, Sep 19, 2019 at 01:56:17PM +0200, Pino Toscano wrote:
> In case qemu-guest-agent is already installed in the guest, then do not
> attempt to install it again.
> 
> Reported by Martin Kletzander.
> ---
>  v2v/convert_linux.ml | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/v2v/convert_linux.ml b/v2v/convert_linux.ml
> index f02ba373e..484e387cc 100644
> --- a/v2v/convert_linux.ml
> +++ b/v2v/convert_linux.ml
> @@ -493,7 +493,13 @@ let convert (g : G.guestfs) inspect source output rcaps =
>      )
>  
>    and install_linux_tools () =
> -    Windows_virtio.install_linux_tools g inspect
> +    let has_qemu_guest_agent =
> +      List.exists (
> +        fun { G.app2_name = name } ->
> +          name = "qemu-guest-agent"
> +      ) inspect.i_apps in

It's possible to omit the ‘= name’, but then you have to replace the
‘name =’ with ‘app2_name =’ so it's not really any shorter ...

> +    if not has_qemu_guest_agent then
> +      Windows_virtio.install_linux_tools g inspect

Obvious changes, so ACK series.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://people.redhat.com/~rjones/virt-top




More information about the Libguestfs mailing list