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

Pino Toscano ptoscano at redhat.com
Thu Sep 19 11:56:17 UTC 2019


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
+    if not has_qemu_guest_agent then
+      Windows_virtio.install_linux_tools g inspect
 
   and configure_kernel () =
     (* Previously this function would try to install kernels, but we
-- 
2.21.0




More information about the Libguestfs mailing list