diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2009-06-24 15:36:58 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2009-06-24 15:36:58 +0100 |
commit | 1f6bc26fc0967c6e4ae4a4514d9734288839c0fd (patch) | |
tree | 3956e21ab9391835983f81ab47cc31036073b789 /inspector | |
parent | 53f5ea28ffe26c112e51ebdef6d46c25919ced4f (diff) | |
download | libguestfs-1f6bc26fc0967c6e4ae4a4514d9734288839c0fd.tar.gz libguestfs-1f6bc26fc0967c6e4ae4a4514d9734288839c0fd.tar.xz libguestfs-1f6bc26fc0967c6e4ae4a4514d9734288839c0fd.zip |
Fix libvirt integration in virt-inspector.
Diffstat (limited to 'inspector')
-rwxr-xr-x | inspector/virt-inspector.pl | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/inspector/virt-inspector.pl b/inspector/virt-inspector.pl index 717ccb61..c645cbdc 100755 --- a/inspector/virt-inspector.pl +++ b/inspector/virt-inspector.pl @@ -27,6 +27,8 @@ use File::Temp qw/tempdir/; # Optional: eval "use Sys::Virt;"; +eval "use XML::XPath;"; +eval "use XML::XPath::XMLParser;"; =encoding utf8 @@ -231,14 +233,9 @@ if (-e $ARGV[0]) { # Get the names of the image(s). my $xml = $dom->get_xml_description (); - my $p = new XML::XPath::XMLParser (xml => $xml); - my $disks = $p->find ("//devices/disk"); - print "disks:\n"; - foreach ($disks->get_nodelist) { - print XML::XPath::XMLParser::as_string($_); - } - - die "XXX" + my $p = XML::XPath->new (xml => $xml); + my @disks = $p->findnodes ('//devices/disk/source/@dev'); + @images = map { $_->getData } @disks; } # We've now got the list of @images, so feed them to libguestfs. |