[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Libguestfs] [PATCH 5/8] Converter: Remove VMware tools if it is installed



---
 lib/Sys/VirtV2V/Converter/Linux.pm |   21 ++++++++++++++++-----
 1 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/lib/Sys/VirtV2V/Converter/Linux.pm b/lib/Sys/VirtV2V/Converter/Linux.pm
index 057ef45..4458fc3 100644
--- a/lib/Sys/VirtV2V/Converter/Linux.pm
+++ b/lib/Sys/VirtV2V/Converter/Linux.pm
@@ -386,6 +386,7 @@ sub _unconfigure_hv
     my ($guestos, $desc) = @_;
 
     _unconfigure_xen($guestos, $desc);
+    _unconfigure_vmware($guestos, $desc);
 }
 
 # Unconfigure Xen specific guest modifications
@@ -393,11 +394,6 @@ sub _unconfigure_xen
 {
     my ($guestos, $desc) = @_;
 
-    carp("unconfigure called without guestos argument")
-        unless defined($guestos);
-    carp("unconfigure called without desc argument")
-        unless defined($desc);
-
     my $found_kmod = 0;
 
     # Look for kmod-xenpv-*, which can be found on RHEL 3 machines
@@ -462,6 +458,21 @@ sub _unconfigure_xen
     }
 }
 
+# Unconfigure VMware specific guest modifications
+sub _unconfigure_vmware
+{
+    my ($guestos, $desc) = @_;
+
+    # Uninstall VMwareTools
+    foreach my $app (@{$desc->{apps}}) {
+        my $name = $app->{name};
+
+        if ($name eq "VMwareTools") {
+            $guestos->remove_application($name);
+        }
+    }
+}
+
 # Get a list of all foreign hypervisor specific kernel modules which are being
 # used by the guest
 sub _find_hv_kernel_modules
-- 
1.6.6


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]