diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2009-07-10 22:01:50 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2009-07-10 22:01:50 +0100 |
commit | 335a8e3b0efa4c9dee01591134aeeb2b17ae22f5 (patch) | |
tree | fcd9bf95ef6c34a2c459141403a8bbb3693acb00 /perl | |
parent | b2f01ebcbeed5bc0c954f80283baf7b5ba52256e (diff) | |
download | libguestfs-335a8e3b0efa4c9dee01591134aeeb2b17ae22f5.tar.gz libguestfs-335a8e3b0efa4c9dee01591134aeeb2b17ae22f5.tar.xz libguestfs-335a8e3b0efa4c9dee01591134aeeb2b17ae22f5.zip |
Sys::Guestfs::Lib: Exit with error if a libvirt domain appears to have no disks.
Diffstat (limited to 'perl')
-rw-r--r-- | perl/lib/Sys/Guestfs/Lib.pm | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/perl/lib/Sys/Guestfs/Lib.pm b/perl/lib/Sys/Guestfs/Lib.pm index 4ab75258..27a7b9ee 100644 --- a/perl/lib/Sys/Guestfs/Lib.pm +++ b/perl/lib/Sys/Guestfs/Lib.pm @@ -175,6 +175,9 @@ sub open_guest my $p = XML::XPath->new (xml => $xml); my @disks = $p->findnodes ('//devices/disk/source/@dev'); push (@disks, $p->findnodes ('//devices/disk/source/@file')); + + die "$images[0] seems to have no disk devices\n" unless @disks; + @images = map { $_->getData } @disks; } |