search for: findnodes

Displaying 20 results from an estimated 32 matches for "findnodes".

2011 Mar 11
2
[PATCH 1/2] Allow reading more data than the reported size of a volume
If a volume is not an exact multiple of 512 bytes, qemu-img will report its size rounded down to a 512 byte boundary. However, when copying, the file is still read until EOF, which will return more data than was expected. This change prevents that causing a failure in itself. The situation is still not resolved, however, as there are still situations where this will cause a failure. For example,
2010 Apr 07
1
[PATCH] Connection: Handle case of cdrom with no <source> element
...Connection.pm b/lib/Sys/VirtV2V/Connection.pm index a211662..c901b90 100644 --- a/lib/Sys/VirtV2V/Connection.pm +++ b/lib/Sys/VirtV2V/Connection.pm @@ -116,7 +116,8 @@ sub _storage_iterate my @paths; # A list of libvirt target device names my @devices; - foreach my $disk ($dom->findnodes('/domain/devices/disk')) { + + foreach my $disk ($dom->findnodes("/domain/devices/disk[\@device='disk']")) { my ($source_e) = $disk->findnodes('source'); my ($source) = $source_e->findnodes('@file | @dev'); @@ -125,55 +126,63...
2010 Mar 30
3
[PATCH 1/2] Refactor guest and volume creation into Sys::VirtV2V::Target::LibVirt
..._; + my ($transfer, $target) = @_; my $dom = $self->get_dom(); @@ -121,8 +121,8 @@ sub _storage_iterate defined($source) or die("source element has neither dev nor file: \n". $dom->toString()); - my ($target) = $disk->findnodes('target/@dev'); - defined($target) or die("disk does not have a target device: \n". + my ($dev) = $disk->findnodes('target/@dev'); + defined($dev) or die("disk does not have a target device: \n". $dom->t...
2010 Jan 06
0
[PATCH] Converter: Fixes to Xen metadata conversion
...hv_metadata($dom); - - for(my $i = 0; $i < $#nodeinfo; $i += 2) { - my $node = $nodeinfo[$i]; - my $xpath = $nodeinfo[$i + 1]->[0]; - my $required = $nodeinfo[$i + 1]->[1]; - - # Look for a replacement in the defaults - my ($default) = $default_dom->findnodes($xpath); - if(defined($default)) { - if($node->isa('XML::DOM::Attr')) { - $node->setNodeValue($default->getNodeValue()); - } else { - my $replacement = $default->cloneNode(1); - $replacement->setOwnerDo...
2009 Dec 21
4
Refactor virt-v2v to be more like a 'big script'
These patches combine HVSource and HVTarget into a single Converter. This should make it more obvious where to hack without losing any practical flexibility. GuestOS remains separate. GuestOS is now a misnomer, because it's really only a Linux distro abstraction. It will be useless for Windows, for example. Functions which you'd expect to be different on a non-RH distro should live in
2010 Apr 08
1
[PATCH] Move all interaction with the config file into Sys::VirtV2V::Config
...Return the path to an iso image containing all software defined in the config +file. Returns undef if no transfer iso is required. + +=cut + +sub get_transfer_iso +{ + my $self = shift; + + my $dom = $self->{dom}; + + # path-root doesn't have to be defined + my ($root) = $dom->findnodes('/virt-v2v/path-root/text()'); + $root = $root->getData() if (defined($root)); + + # Construct a list of path arguments to mkisofs from paths referenced in the + # config file + # We use a hash here to avoid duplicates + my %path_args; + foreach my $path ($dom->findn...
2010 Sep 27
2
[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
2010 Mar 31
3
[PATCH] Remove v2v-snapshot
...} else { - $pool->refresh(0); - $refreshed = 1; - } - } - } until(defined($vol)); - - return $vol; -} - -sub _commit_guest -{ - my ($dom, $vmm, $pool) = @_; - - # First, get a list of existing disks - foreach my $disk ($dom->findnodes('/domain/devices/disk')) { - my ($source) = $disk->findnodes('source'); - my ($target) = $disk->findnodes('target/@dev'); - - # Look for the source location - my $path; - my $src_attrs = $source->getAttributes(); - foreach m...
2010 Feb 19
2
[PATCH 1/2] Fix remapping of block devices
...110,10 @@ sub _storage_iterate my $dom = $self->get_dom(); - # Create a hash of guest devices to their paths - my @storage; + # An list of local paths to guest storage + my @paths; + # A list of libvirt target device names + my @devices; foreach my $disk ($dom->findnodes('/domain/devices/disk')) { my ($source_e) = $disk->findnodes('source'); @@ -167,11 +185,13 @@ sub _storage_iterate } } - push(@storage, $path); + push(@paths, $path); + push(@devices, $target->getNodeV...
2010 Feb 09
5
[PATCH 1/6] Convert config file to XML, and translate networks/bridge for all connections
...y any parse errors - if ($@) { - print STDERR user_message - (__x("Unable to parse {path}: {error}", - path => $self->{path}, error => $@)); - return undef; - } - - # Rewrite bridge names - foreach my $bridge - ($dom->findnodes("/domain/devices/interface[\@type='bridge']/". - "source/\@bridge")) - { - my $name = $bridge->getNodeValue(); - if(exists($self->{bridges}->{$name})) { - $bridge->setNodeValue($self->{bridges}->{$name...
2010 Apr 12
1
[PATCH] Converter: Update xvc0 console to ttyS0
...<video> <model type='cirrus' vram='9216' heads='1'/> </video> + <console type='pty'/> </devices> </domain> "; @@ -240,7 +242,8 @@ sub _configure_default_devices my ($input_devices) = $default_dom->findnodes('/domain/devices'); # Add new default devices from default XML - foreach my $input ($input_devices->findnodes('input | video | graphics')) { + foreach my $input ($input_devices->findnodes('input | video | '. +...
2010 May 04
1
[PATCH] Config: Don't require all referenced software to be available
....pm b/lib/Sys/VirtV2V/Config.pm index 117b55b..57bf24a 100644 --- a/lib/Sys/VirtV2V/Config.pm +++ b/lib/Sys/VirtV2V/Config.pm @@ -107,6 +107,7 @@ sub get_transfer_iso # config file # We use a hash here to avoid duplicates 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 ". -...
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
2010 Jun 18
1
[PATCH] Look for i686 target for i386 Windows guest
...- a/lib/Sys/VirtV2V/Target/LibVirt.pm +++ b/lib/Sys/VirtV2V/Target/LibVirt.pm @@ -317,6 +317,9 @@ sub _configure_capabilities my $arch = $guestcaps->{arch}; + # i386 userspace means i686 guest + $arch = 'i686' if ($arch eq 'i386'); + (my $guestcap) = $caps->findnodes ("/capabilities/guest[arch[\@name='$arch']/domain/\@type='kvm']"); -- 1.7.1
2010 Jun 18
1
[PATCH] Improve error message when LibvirtXML is given invalid domain XML
...11 @@ sub _get_dom # Display any parse errors die(user_message(__x("Unable to parse domain from file {path}: {error}", path => $self->{path}, error => $@))) if ($@); + + # Check it looks like domain XML + my ($dummy) = $self->{dom}->findnodes('/domain/name'); + die(user_message(__x("{path} doesn't look like a libvirt domain XML file", + path => $self->{path}))) unless (defined($dummy)); } =back -- 1.7.1
2010 Feb 12
11
[PATCH 1/9] Convert config file to XML, and translate networks/bridge for all connections
...y any parse errors - if ($@) { - print STDERR user_message - (__x("Unable to parse {path}: {error}", - path => $self->{path}, error => $@)); - return undef; - } - - # Rewrite bridge names - foreach my $bridge - ($dom->findnodes("/domain/devices/interface[\@type='bridge']/". - "source/\@bridge")) - { - my $name = $bridge->getNodeValue(); - if(exists($self->{bridges}->{$name})) { - $bridge->setNodeValue($self->{bridges}->{$name...
2010 May 04
2
[PATCH 1/2] Config: NFC: always create and pass round a Config object
...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 ($root) = $dom->findnodes('/virt-v2v/path-root/text()'); $root = $root->getData() if (defined($root)); @@ -175,15 +180,7 @@ sub get_transfer_iso return $iso_path; } -=item get_app_search(desc, name, arch) - -Return a string describing what v2v is looking for in the config file. The -string is intende...
2010 May 07
1
[PATCH] List all missing dependencies at once
...s/VirtV2V/Config.pm index 5aa9917..3fff455 100644 --- a/lib/Sys/VirtV2V/Config.pm +++ b/lib/Sys/VirtV2V/Config.pm @@ -258,15 +258,6 @@ sub match_app xml => $app->toString()))) unless (defined($path)); $path = $path->getData(); - my ($pathroot) = $dom->findnodes('/virt-v2v/path-root/text()'); - my $abs = defined($pathroot) ? $pathroot->getData()."/$path" : $path; - - die(user_message(__x("Matched local file {path} for {search}. ". - "However, this file is not available.", -...
2010 Jun 08
2
[PATCH 1/2] Target: Pass os description to create_guest
...a/lib/Sys/VirtV2V/Target/RHEV.pm +++ b/lib/Sys/VirtV2V/Target/RHEV.pm @@ -564,7 +564,7 @@ Create the guest in the target sub create_guest { my $self = shift; - my ($dom, $guestcaps) = @_; + my ($desc, $dom, $guestcaps) = @_; # Get the name of the guest my ($name) = $dom->findnodes('/domain/name/text()'); diff --git a/v2v/virt-v2v.pl b/v2v/virt-v2v.pl index bed69a0..96e89d1 100755 --- a/v2v/virt-v2v.pl +++ b/v2v/virt-v2v.pl @@ -378,7 +378,7 @@ my $guestcaps = Sys::VirtV2V::Converter->convert($g, $guestos, close_guest_handle(); -$target->create_guest($dom, $...
2010 Aug 16
2
[PATCH 1/2] Allow absolute paths in virt-v2v.conf
...0 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/Sys/VirtV2V/Config.pm b/lib/Sys/VirtV2V/Config.pm index f703152..121e774 100644 --- a/lib/Sys/VirtV2V/Config.pm +++ b/lib/Sys/VirtV2V/Config.pm @@ -118,14 +118,16 @@ sub get_transfer_iso foreach my $path ($dom->findnodes('/virt-v2v/app/path/text()')) { $path = $path->getData(); - # Get the absolute path if iso-root was defined my $abs; - if (defined($root)) { - $abs = File::Spec->catfile($root, $path); - } else { + if (File::Spec->file_name...