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

[Libguestfs] [PATCH 1/2] Remove converted SCSI controllers



We never use SCSI after conversion as we always use either VirtIO or IDE. As an
unsupported SCSI controller can prevent a converted guest from starting, it's
safer to just remove SCSI controllers.

Fixes RHBZ#637775
---
 lib/Sys/VirtV2V/Target/LibVirt.pm |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/lib/Sys/VirtV2V/Target/LibVirt.pm b/lib/Sys/VirtV2V/Target/LibVirt.pm
index 279e93d..95ffad4 100644
--- a/lib/Sys/VirtV2V/Target/LibVirt.pm
+++ b/lib/Sys/VirtV2V/Target/LibVirt.pm
@@ -330,11 +330,27 @@ sub create_guest
 
     my $vmm = $self->{vmm};
 
+    _unconfigure_incompatible_devices($dom);
     _configure_capabilities($vmm, $dom, $guestcaps);
 
     $vmm->define_domain($dom->toString());
 }
 
+sub _unconfigure_incompatible_devices
+{
+    my ($dom) = @_;
+
+    foreach my $path (
+        # We have replaced the SCSI controller with either VirtIO or IDE.
+        # Additionally, attempting to start a guest converted from ESX, which
+        # has an lsilogic SCSI controller, will fail on RHEL 5.
+        $dom->findnodes("/domain/devices/controller[\ type='scsi']")
+    )
+    {
+        $path->getParentNode()->removeChild($path);
+    }
+}
+
 # Configure guest according to target hypervisor's capabilities
 sub _configure_capabilities
 {
-- 
1.7.2.3


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