Matthew Booth
2010-Sep-27 14:03 UTC
[Libguestfs] [PATCH 0/2] Remove troublesome devices when outputting to libvirt
These 2 patches remove devices which can prevent a guest from starting after conversion if they aren't supported by the target. This solution isn't ideal. We would preferrably query the target for supported models and update if necessary, however there's no API for this yet. Matthew Booth (2): Remove converted SCSI controllers Remove sound cards when outputting to libvirt lib/Sys/VirtV2V/Target/LibVirt.pm | 22 ++++++++++++++++++++++ 1 files changed, 22 insertions(+), 0 deletions(-) -- 1.7.2.3
Matthew Booth
2010-Sep-27 14:03 UTC
[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
Matthew Booth
2010-Sep-27 14:03 UTC
[Libguestfs] [PATCH 2/2] Remove sound cards when outputting to libvirt
As we can't currently detect what sound card models are supported by the target hypervisor, simply remove them. Works round RHBZ#589567 --- lib/Sys/VirtV2V/Target/LibVirt.pm | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/lib/Sys/VirtV2V/Target/LibVirt.pm b/lib/Sys/VirtV2V/Target/LibVirt.pm index 95ffad4..029e4e2 100644 --- a/lib/Sys/VirtV2V/Target/LibVirt.pm +++ b/lib/Sys/VirtV2V/Target/LibVirt.pm @@ -344,7 +344,13 @@ sub _unconfigure_incompatible_devices # 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']") + $dom->findnodes("/domain/devices/controller[\@type='scsi']"), + + # XXX: We have no current way of detecting which sound card models are + # supported by the target hypervisor. As an unsupported sound card model + # can prevent the guest from starting, we simply remove sound cards for + # the moment. + $dom->findnodes("/domain/devices/sound") ) { $path->getParentNode()->removeChild($path); -- 1.7.2.3
Seemingly Similar Threads
- [PATCH 1/2] Allow reading more data than the reported size of a volume
- Refactor virt-v2v to be more like a 'big script'
- [ESX support] Working ESX conversion for RHEL 5
- [PATCH 1/2] Refactor guest and volume creation into Sys::VirtV2V::Target::LibVirt
- [PATCH 1/6] Convert config file to XML, and translate networks/bridge for all connections