[Libguestfs] [PATCH 2/2] v2v: linux: uninstall Parallels tools

Pavel Butsykin pbutsykin at virtuozzo.com
Sat Jun 11 17:51:57 UTC 2016


Guest tools for Linux in Parallels / Virtuozzo Server 6 come with a script
that can be used to uninstall them.

Signed-off-by: Pavel Butsykin <pbutsykin at virtuozzo.com>
---
 v2v/convert_linux.ml | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/v2v/convert_linux.ml b/v2v/convert_linux.ml
index 7eef2ab..681466e 100644
--- a/v2v/convert_linux.ml
+++ b/v2v/convert_linux.ml
@@ -694,6 +694,20 @@ let rec convert ~keep_serial_console (g : G.guestfs) inspect source rcaps =
         ignore (g#command [| "/sbin/chkconfig"; "kudzu"; "off" |])
       )
 
+  and unconfigure_prltools () =
+    let prltools_path = "/usr/lib/parallels-tools/install" in
+    if g#is_file ~followsymlinks:true prltools_path then (
+      try
+        ignore (g#command [| prltools_path; "-r" |]);
+
+        (* Reload Augeas to detect changes made by prltools uninst. *)
+        Linux.augeas_reload g
+      with
+        G.Error msg ->
+          warning (f_"Parallels tools was detected, but uninstallation failed. The error message was: %s (ignored)")
+            msg
+    )
+
   and configure_kernel () =
     (* Previously this function would try to install kernels, but we
      * don't do that any longer.
@@ -1414,6 +1428,7 @@ let rec convert ~keep_serial_console (g : G.guestfs) inspect source rcaps =
   unconfigure_vmware ();
   unconfigure_citrix ();
   unconfigure_kudzu ();
+  unconfigure_prltools ();
 
   let kernel, virtio = configure_kernel () in
 
-- 
2.8.3




More information about the Libguestfs mailing list