Matthew Booth
2010-May-04 19:41 UTC
[Libguestfs] [PATCH] Converter: Don't die if we can't do guest-specific conversion
We currently die with an error message if we can't find a Converter for a
specific guest operating system. However, virt-v2v can still usefully transfer
storage and metadata.
This change turns the error into a (lengthy) warning, and continues with
metadata conversion if guest conversion isn't possible.
---
lib/Sys/VirtV2V/Converter.pm | 21 ++++++++++++++++++---
1 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/lib/Sys/VirtV2V/Converter.pm b/lib/Sys/VirtV2V/Converter.pm
index a5b7e43..97c212e 100644
--- a/lib/Sys/VirtV2V/Converter.pm
+++ b/lib/Sys/VirtV2V/Converter.pm
@@ -136,7 +136,7 @@ sub convert
my $class = shift;
my ($g, $guestos, $config, $dom, $desc, $devices) = @_;
- carp("convert called without guestos argument") unless
defined($guestos);
+ # guestos may be undef if none was found
carp("convert called without config argument") unless
defined($config);
carp("convert called without dom argument") unless defined($dom);
carp("convert called without desc argument") unless
defined($desc);
@@ -152,8 +152,23 @@ sub convert
}
}
- die(user_message(__"Unable to find a module to convert this
guest"))
- unless (defined($guestcaps));
+ unless (defined($guestcaps)) {
+ print STDERR user_message(__x("WARNING: Unable to convert this
guest ".
+ "operating system. Its storage will
be ".
+ "transfered and a domain created for
".
+ "it, but it may not operate
correctly ".
+ "without manual reconfiguration. The
".
+ "domain will present all storage
".
+ "devices as IDE, all network
interfaces ".
+ "as e1000 and the host as
x86_64."));
+
+ # Set some conservative defaults
+ $guestcaps = {
+ 'arch' => 'x86_64',
+ 'virtio' => 0,
+ 'acpi' => 1
+ };
+ }
# Map network names from config
_map_networks($dom, $config);
--
1.6.6.1
Richard W.M. Jones
2010-May-06 10:43 UTC
[Libguestfs] [PATCH] Converter: Don't die if we can't do guest-specific conversion
On Tue, May 04, 2010 at 08:41:26PM +0100, Matthew Booth wrote:> We currently die with an error message if we can't find a Converter for a > specific guest operating system. However, virt-v2v can still usefully transfer > storage and metadata. > > This change turns the error into a (lengthy) warning, and continues with > metadata conversion if guest conversion isn't possible.This is sensible. There's a lot you can do manually with an unknown OS and a copy of virt-rescue. ACK. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://et.redhat.com/~rjones/virt-df/
Apparently Analagous Threads
- [PATCH 1/2] Config: NFC: always create and pass round a Config object
- [PATCH 1/2] Fix remapping of block devices
- [PATCH v2v] Pre-convert Windows guests.
- [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