On Fri, Feb 12, 2010 at 09:39:16AM +0000, Matthew Booth wrote:
dom and path weren't being stored in the newly constructed
object.
---
lib/Sys/VirtV2V/Connection/LibVirtXML.pm | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/lib/Sys/VirtV2V/Connection/LibVirtXML.pm
b/lib/Sys/VirtV2V/Connection/LibVirtXML.pm
index 5d0ebbc..874946a 100644
--- a/lib/Sys/VirtV2V/Connection/LibVirtXML.pm
+++ b/lib/Sys/VirtV2V/Connection/LibVirtXML.pm
@@ -64,8 +64,8 @@ sub new
my ($path) = @_;
- my %obj = ();
- my $self = \%obj;
+ my $self = {};
+ $self->{path} = $path;
bless($self, $class);
@@ -88,15 +88,11 @@ sub _get_dom
path => $self->{path}, error => $!)));
# Parse the input file
- my $parser = new XML::DOM::Parser;
- my $dom;
- eval { $dom = $parser->parse ($xml); };
+ eval { $self->{dom} = new XML::DOM::Parser->parse ($xml); };
# Display any parse errors
- die(user_message(__x("Unable to parse {path}: {error}",
+ die(user_message(__x("Unable to parse domain from file {path}: {error}",
path => $self->{path}, error => $@))) if ($@);
-
- return $dom;
}
=back
--
1.6.6
ACK.
Rich.
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
virt-p2v converts physical machines to virtual machines. Boot with a
live CD or over the network (PXE) and turn machines into Xen guests.
http://et.redhat.com/~rjones/virt-p2v