Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:13.1:Update
virt-v2v
add_verbose_messaging.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File add_verbose_messaging.patch of Package virt-v2v
From d80387d896f946498067eef5c0250ea73e667abe Mon Sep 17 00:00:00 2001 From: Mike Latimer <mlatimer@suse.com> Date: Fri, 6 Sep 2013 09:18:24 -0600 Subject: [PATCH V2] virt-v2v: Add verbose message logging This patch adds basic verbose messages in the main virt-v2v code. The usefulness of these messages is limited as the time spent outside of data copying is trivial. However, when converting smaller guests, these messages can act as progress markers and show where time is being spent. --- v2v/virt-v2v.pl | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/v2v/virt-v2v.pl b/v2v/virt-v2v.pl index 3832f67..5756296 100755 --- a/v2v/virt-v2v.pl +++ b/v2v/virt-v2v.pl @@ -354,6 +354,17 @@ my $list_profiles = 0; Display a list of target profile names specified in the configuration file. +=cut + +my $verbose; + +=item B<-v | --verbose> + +Enable verbose message logging. Specifying this parameter multiple times +increases verbosity by adding LIBGUESTFS_TRACE=1, and then LIBGUESTFS_DEBUG=1. + +=cut + =item B<--help> Display brief help. @@ -388,6 +399,13 @@ GetOptions ("help|?" => sub { print "$Sys::VirtConvert::VERSION\n"; exit(0); }, + "v|verbose+" => \$verbose, + "vv" => sub { + $verbose += 2; + }, + "vvv" => sub { + $verbose += 3; + }, "c|connect" => sub { # -c|--connect is the default for other virt tools. Be nice to # the user and point out that virt-v2v is different. @@ -437,6 +455,14 @@ GetOptions ("help|?" => sub { "list-profiles" => \$list_profiles ) or pod2usage(2); +# Enable higher levels of verbose logging +if ((defined($verbose)) and ($verbose > 1)) { + $ENV{LIBGUESTFS_TRACE} = '1'; + if ($verbose > 2) { + $ENV{LIBGUESTFS_DEBUG} = '1'; + } +} + # Set the default configuration files if none are specified if (@config_files == 0) { push(@config_files, '/etc/virt-v2v.conf') if -r '/etc/virt-v2v.conf'; @@ -521,6 +547,10 @@ else { # Get an appropriate Source my $source; +if (defined($verbose)) { + logmsg NOTICE, __x('Connecting to input '. + '({input})', input => $input_method) +} if ($input_method eq "libvirtxml") { my $path = shift(@ARGV) or pod2usage({ -message => __"You must specify a filename", @@ -574,6 +604,10 @@ else { # Decide the name of the guest target. $output_name = $source->get_name() unless defined $output_name; +if (defined($verbose)) { + logmsg NOTICE, __x('Validating guest: {output}', + output => $output_name) +} # Check that the guest doesn't already exist on the target v2vdie __x('Domain {name} already exists on the target.', @@ -593,9 +627,14 @@ v2vdie __('Guest doesn\'t define any storage devices') unless @{$meta->{disks}} > 0; # Copy source storage to target +if (defined($verbose)) { + logmsg NOTICE, __x('Copying virtual machine storage to target '. + '({output})', output => $output_method) +} $source->copy_storage($target, $output_format, $output_sparse); # Open a libguestfs handle on the guest's storage devices +if (defined($verbose)) { logmsg NOTICE, __x('Starting guestfs') } my @disks = map { [ $_->{device}, $_->{dst}->get_path(), $_->{dst}->get_format() ] } @{$meta->{disks}}; @@ -623,13 +662,17 @@ my $guestcaps; my $root; eval { # Inspect the guest + if (defined($verbose)) { logmsg NOTICE, __x('Inspecting guest') } $root = inspect_guest($g, $transferdev); # Modify the guest and its metadata + if (defined($verbose)) { logmsg NOTICE, __x('Converting guest') } $guestcaps = Sys::VirtConvert::Converter->convert($g, $config, $root, $meta, \%options); + # Create the guest + if (defined($verbose)) { logmsg NOTICE, __x('Creating guest') } $target->create_guest($g, $root, $meta, $config, $guestcaps, $output_name); }; -- 1.8.1.4
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor