search for: user_messag

Displaying 20 results from an estimated 57 matches for "user_messag".

Did you mean: user_message
2010 Jul 28
3
Create new Sys::VirtV2V::Util
...hich displayed verbose augeas error messages. This function moves into the new module where it can be used by both modules. The second patch is an consequential tidy up. UserMessage moves into the new module. * [PATCH 1/2] Move augeas error reporting into new Sys::VirtV2V::Util * [PATCH 2/2] Move user_message into Sys::VirtV2V::Util
2010 Apr 08
1
[PATCH] Move all interaction with the config file into Sys::VirtV2V::Config
...he Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +package Sys::VirtV2V::Config; + +use strict; +use warnings; + +use File::Spec; +use File::stat; +use XML::DOM; +use XML::DOM::XPath; + +use Sys::VirtV2V::ExecHelper; +use Sys::VirtV2V::UserMessage qw(user_message); + +use Locale::TextDomain 'virt-v2v'; + +=pod + +=head1 NAME + +Sys::VirtV2V::Config - Manage virt-v2v's configuration file + +=head1 SYNOPSIS + + use Sys::VirtV2V::Config; + + $eh = Sys::VirtV2V::Config->new($config_path); + + my $isopath = $config->get_transfer_iso(); + my ($...
2010 Sep 21
1
[PREVIEW ONLY] Refactor data transfer code
...rc; use URI; use XML::DOM; @@ -29,6 +27,11 @@ use XML::DOM; use Sys::Virt; use Sys::VirtV2V; +use Sys::VirtV2V::Connection; +use Sys::VirtV2V::Connection::Volume; +use Sys::VirtV2V::Transfer::ESX; +use Sys::VirtV2V::Transfer::SSH; +use Sys::VirtV2V::Transfer::Local; use Sys::VirtV2V::Util qw(user_message); use Locale::TextDomain 'virt-v2v'; @@ -39,70 +42,47 @@ use Locale::TextDomain 'virt-v2v'; =head1 NAME -Sys::VirtV2V::Connection::LibVirt - Read libvirt metadata from libvirtd - -=head1 SYNOPSIS - - use Sys::VirtV2V::Connection::LibVirt; - - $conn = Sys::VirtV2V::Connectio...
2010 Mar 30
3
[PATCH 1/2] Refactor guest and volume creation into Sys::VirtV2V::Target::LibVirt
...>toString()); # If the disk is a floppy or a cdrom, blank its source @@ -135,16 +135,15 @@ sub _storage_iterate my $path = $source->getValue(); if (defined($transfer)) { - # Die if transfer required and no output pool - die (user_message(__"No output pool was specified")) - unless (defined($pool)); + # Die if transfer required and no output target + die (user_message(__"No output target was specified")) + unless (defined($target));...
2010 Mar 31
3
[PATCH] Remove v2v-snapshot
...USA. - -use warnings; -use strict; - -use English; - -use File::Temp qw(tempfile); -use Getopt::Long; -use Pod::Usage; - -use Locale::TextDomain 'virt-v2v'; - -use Sys::Virt; - -use Sys::VirtV2V; -use Sys::VirtV2V::ExecHelper; -use Sys::VirtV2V::Connection; -use Sys::VirtV2V::UserMessage qw(user_message); - -=encoding utf8 - -=head1 NAME - -v2v-snapshot - Convert a guest to use a qcow2 snapshot for storage - -=head1 SYNOPSIS - - v2v-snapshot guest-domain - - v2v-snapshot --rollback guest-domain - - v2v-snapshot --commit guest-domain - -=head1 DESCRIPTION - -v2v-snapshot is a tool for creating a l...
2010 Sep 13
3
[PATCH 1/4] Check that we're not overwriting an existing Libvirt domain
...pm index b83a10d..51331da 100644 --- a/lib/Sys/VirtV2V/Connection/LibVirt.pm +++ b/lib/Sys/VirtV2V/Connection/LibVirt.pm @@ -79,6 +79,10 @@ sub new $self->{uri} = URI->new($uri); $self->{name} = $name; + # Check that the guest doesn't already exist on the target + die(user_message(__x("Domain {name} already exists on the target.", + name => $name))) if ($target->guest_exists($name)); + # Parse uri authority for hostname and username $self->{uri}->authority() =~ /^(?:([^:]*)(?::([^@]*))?@)?(.*)$/ or die(user_me...
2010 Jun 10
1
[PATCH] RHEV: Warn instead of die if rmtree dies during cleanup
...eletions(-) diff --git a/lib/Sys/VirtV2V/Target/RHEV.pm b/lib/Sys/VirtV2V/Target/RHEV.pm index 295c19d..c9add0c 100644 --- a/lib/Sys/VirtV2V/Target/RHEV.pm +++ b/lib/Sys/VirtV2V/Target/RHEV.pm @@ -390,9 +390,18 @@ sub _cleanup return unless (defined($tmpdir)); - rmtree($tmpdir) or warn(user_message(__x("Unable to remove temporary ". - "directory {dir}", - dir => $tmpdir))); + eval { + rmtree($tmpdir) or warn(user_message(__x("Unable to remove temporary ". +...
2010 Feb 09
5
[PATCH 1/6] Convert config file to XML, and translate networks/bridge for all connections
...- } - } - } - $self->_get_dom($path); # No transfer methods defined yet @@ -109,12 +83,9 @@ sub _get_dom # Open the input file my $xml; # Implicitly closed on function exit - if(!open($xml, '<', $self->{path})) { - print STDERR user_message - (__x("Failed to open {path}: {error}", - path => $self->{path}, error => $!)); - return undef; - } + open($xml, '<', $self->{path}) + or die(user_message(__x("Failed to open {path}: {error}", +...
2010 Jun 08
3
[PATCH 1/3] Fix RHEV cleanup on unclean shutdown
Cleanup was not happening properly if a migration to RHEV was killed prematurely with a Ctrl-C. Firstly, the SIGINT and SIGQUIT handlers were not being registered early enough in virt-v2v.pl. Secondly, if Ctrl-C killed the guestfs qemu process first it would deliver a SIGPIPE to v2v, which caused an unclean shutdown without cleanup. Fixes RHBZ#596015 --- v2v/virt-v2v.pl | 17 ++++++++++++++---
2010 Mar 31
1
[PATCH] Add LocalCopy transfer method to transfer local files to a target
...7e3..5b4ed8d 100644 --- a/lib/Sys/VirtV2V/Connection.pm +++ b/lib/Sys/VirtV2V/Connection.pm @@ -22,10 +22,12 @@ use warnings; use Sys::Virt; -use Locale::TextDomain 'virt-v2v'; - +use Sys::VirtV2V::Transfer::ESX; +use Sys::VirtV2V::Transfer::LocalCopy; use Sys::VirtV2V::UserMessage qw(user_message); +use Locale::TextDomain 'virt-v2v'; + =pod =head1 NAME @@ -134,41 +136,39 @@ sub _storage_iterate else { my $path = $source->getValue(); - if (defined($transfer)) { - # Die if transfer required and no output target -...
2010 May 04
1
[PATCH] Config: Don't require all referenced software to be available
...my %path_args; + my %paths; foreach my $path ($dom->findnodes('/virt-v2v/app/path/text()')) { $path = $path->getData(); @@ -118,12 +119,10 @@ sub get_transfer_iso $abs = $path; } - # Check the referenced path is accessible - die(user_message(__x("Unable to access {path} referenced in ". - "the config file", - path => $path))) unless (-r $abs); - - $path_args{"$path=$abs"} = 1; + if (-r $abs) { + $path_args{"$path=$abs...
2010 Jun 18
1
[PATCH] Improve error message when LibvirtXML is given invalid domain XML
...it a/lib/Sys/VirtV2V/Connection.pm b/lib/Sys/VirtV2V/Connection.pm index da6a44b..4dc659d 100644 --- a/lib/Sys/VirtV2V/Connection.pm +++ b/lib/Sys/VirtV2V/Connection.pm @@ -186,6 +186,9 @@ sub _storage_iterate $source_e->setAttribute($source->getName(), ''); } + die(user_message(__("Guest doesn't define any recognised storage devices"))) + unless (@paths > 0); + $self->{paths} = \@paths; $self->{devices} = \@devices; } diff --git a/lib/Sys/VirtV2V/Connection/LibVirtXML.pm b/lib/Sys/VirtV2V/Connection/LibVirtXML.pm index 729f1e8..ac...
2011 Jan 26
1
[PATCH] Display verbose error message when guest storage isn't found
...LibVirtSource.pm index 628074c..9db9f60 100644 --- a/lib/Sys/VirtV2V/Connection/LibVirtSource.pm +++ b/lib/Sys/VirtV2V/Connection/LibVirtSource.pm @@ -130,10 +130,29 @@ sub get_volume eval { $vol = $self->{vmm}->get_storage_volume_by_path($path); }; - die(user_message(__x("Failed to retrieve storage volume {path}:". - "{error}", - path => $path, - error => $@->stringify()))) if($@); + if ($@->code == Sys::Virt::Error->ERR_NO_STORAGE_VOL)...
2010 Jan 29
4
[FOR REVIEW ONLY] ESX work in progress
The following patches are where I'm currently at with ESX support. I can now import a domain from ESX along with its storage. Note that I'm not yet doing any conversion. In fact, I've never even tested past the import stage (I just had an exit in there). The meat is really in the 4th patch. The rename of MetadataReader->Connection was because the Connection is now really providing
2010 Feb 01
9
[ESX support] Working ESX conversion for RHEL 5
With this patchset I have successfully[1] imported a RHEL 5 guest directly from ESX with the following command line: virt-v2v -ic 'esx://yellow.marston/?no_verify=1' -op transfer RHEL5-64 Login details are stored in ~/.netrc Note that this is the only guest I've tested against. I haven't for example, checked that I haven't broken Xen imports. Matt [1] With the exception of
2011 Jan 26
1
[PATCH] Replace File::Path's remove_tree
...e_tree from File::Path here. Unfortunately it does +# something unexpected involving chdir which means it will fail bizarrely if the +# current directory (not the target directory) is not readable by the current +# user. +sub _remove_tree +{ + my $dir = shift; + + opendir(my $dh, $dir) or die user_message(__x("Unable to open {dir} while ". + "removing temporary ". + "directory: {error}", + dir => $dir, +...
2010 May 04
2
[PATCH 1/2] Config: NFC: always create and pass round a Config object
...V2V/Config.pm index 57bf24a..50c613c 100644 --- a/lib/Sys/VirtV2V/Config.pm +++ b/lib/Sys/VirtV2V/Config.pm @@ -69,6 +69,9 @@ sub new my $self = {}; bless($self, $class); + # No further config required if no config path was specified + return $self if (!defined($path)); + die(user_message(__x("Config file {path} doesn't exist", path => $path))) unless (-e $path); @@ -99,6 +102,8 @@ sub get_transfer_iso my $dom = $self->{dom}; + return undef unless (defined($dom)); + # path-root doesn't have to be defined my (...
2010 Apr 09
1
[PATCH] Add SSH transfer method
...irtV2V/Connection.pm index c901b90..da6a44b 100644 --- a/lib/Sys/VirtV2V/Connection.pm +++ b/lib/Sys/VirtV2V/Connection.pm @@ -24,6 +24,7 @@ use Sys::Virt; use Sys::VirtV2V::Transfer::ESX; use Sys::VirtV2V::Transfer::LocalCopy; +use Sys::VirtV2V::Transfer::SSH; use Sys::VirtV2V::UserMessage qw(user_message); use Locale::TextDomain 'virt-v2v'; diff --git a/lib/Sys/VirtV2V/Connection/LibVirt.pm b/lib/Sys/VirtV2V/Connection/LibVirt.pm index 0a0330e..5e06356 100644 --- a/lib/Sys/VirtV2V/Connection/LibVirt.pm +++ b/lib/Sys/VirtV2V/Connection/LibVirt.pm @@ -150,6 +150,10 @@ sub new $tr...
2010 Apr 28
3
Fix 2 issues in ESX transfer
We were seeing 100% failure rates transferring 10G disk images from ESX on a particular setup. We also weren't spotting the transfer failure, and dying with a strange error from libguestfs. These 2 patches fix the error check which should have made it obvious what was failing, and the underlying error.
2010 Feb 12
11
[PATCH 1/9] Convert config file to XML, and translate networks/bridge for all connections
...- } - } - } - $self->_get_dom($path); # No transfer methods defined yet @@ -109,12 +83,9 @@ sub _get_dom # Open the input file my $xml; # Implicitly closed on function exit - if(!open($xml, '<', $self->{path})) { - print STDERR user_message - (__x("Failed to open {path}: {error}", - path => $self->{path}, error => $!)); - return undef; - } + open($xml, '<', $self->{path}) + or die(user_message(__x("Failed to open {path}: {error}", +...