Matthew Booth
2009-Dec-21 17:57 UTC
[Libguestfs] [PATCH] Converter: Blacklist ACPI for RHEL 3 x86_64
--- lib/Sys/VirtV2V/Converter.pm | 13 +++++++++++-- lib/Sys/VirtV2V/Converter/Linux.pm | 16 ++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/lib/Sys/VirtV2V/Converter.pm b/lib/Sys/VirtV2V/Converter.pm index 3b0500b..a6eba45 100644 --- a/lib/Sys/VirtV2V/Converter.pm +++ b/lib/Sys/VirtV2V/Converter.pm @@ -319,10 +319,19 @@ sub _configure_capabilities } foreach my $feature ($dom->findnodes('/domain/features/*')) { - if (!exists($features{$feature->getNodeName()})) { + my $name = $feature->getNodeName(); + + if (!exists($features{$name})) { print STDERR user_message (__x("The connected hypervisor does not support ". - "feature {feature}", feature => $feature->getNodeName())); + "feature {feature}", feature => $name)); + $feature->getParentNode()->removeChild($feature); + } + + if ($name eq 'acpi' && !$guestcaps->{acpi}) { + print STDERR user_message + (__"The target guest does not support acpi under KVM. ACPI ". + "will be disabled."); $feature->getParentNode()->removeChild($feature); } } diff --git a/lib/Sys/VirtV2V/Converter/Linux.pm b/lib/Sys/VirtV2V/Converter/Linux.pm index db7a1ed..057ef45 100644 --- a/lib/Sys/VirtV2V/Converter/Linux.pm +++ b/lib/Sys/VirtV2V/Converter/Linux.pm @@ -105,6 +105,7 @@ sub convert $guestcaps{virtio} = $virtio; $guestcaps{arch} = _get_os_arch($desc); + $guestcaps{acpi} = _supports_acpi($desc, $guestcaps{arch}); return \%guestcaps; } @@ -495,6 +496,21 @@ sub _find_xen_kernel_modules return @modules; } +# Return 1 if the guest supports ACPI, 0 otherwise +sub _supports_acpi +{ + my ($desc, $arch) = @_; + + # Blacklist configurations which are known to fail + # RHEL 3, x86_64 + if ($desc->{distro} eq 'rhel' && $desc->{major_version} == 3 && + $arch eq 'x86_64') { + return 0; + } + + return 1; +} + =back =head1 COPYRIGHT -- 1.6.5.2
Richard W.M. Jones
2010-Jan-05 16:44 UTC
[Libguestfs] [PATCH] Converter: Blacklist ACPI for RHEL 3 x86_64
On Mon, Dec 21, 2009 at 05:57:33PM +0000, Matthew Booth wrote:> + # Blacklist configurations which are known to fail > + # RHEL 3, x86_64 > + if ($desc->{distro} eq 'rhel' && $desc->{major_version} == 3 && > + $arch eq 'x86_64') { > + return 0; > + }Windows with non-ACPI HAL too? ACK. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://et.redhat.com/~rjones/virt-top
Possibly Parallel Threads
- [PATCH] Converter: Fixes to Xen metadata conversion
- [PATCH 1/2] Refactor guest and volume creation into Sys::VirtV2V::Target::LibVirt
- [PATCH 1/2] Fix remapping of block devices
- [PATCH] Default to IDE when VirtIO isn't available
- [PATCH 1/2] Allow reading more data than the reported size of a volume