ocaml: Error on compiler warnings.
[libguestfs.git] / perl / examples / lvs.pl
1 #!/usr/bin/perl -w
2
3 use strict;
4
5 use Sys::Guestfs;
6
7 # Look for LVM LVs, VGs and PVs in a guest image.
8
9 die "Usage: lvs.pl guest.img\n" if @ARGV != 1 || ! -f $ARGV[0];
10
11 print "Creating the libguestfs handle\n";
12 my $h = Sys::Guestfs->new ();
13 $h->add_drive_opts ($ARGV[0], format => "raw");
14
15 print "Launching, this can take a few seconds\n";
16 $h->launch ();
17
18 print "Looking for PVs on the disk image\n";
19 my @pvs = $h->pvs ();
20 print "PVs found: (", join (", ", @pvs), ")\n";
21
22 print "Looking for VGs on the disk image\n";
23 my @vgs = $h->vgs ();
24 print "VGs found: (", join (", ", @vgs), ")\n";
25
26 print "Looking for LVs on the disk image\n";
27 my @lvs = $h->lvs ();
28 print "LVs found: (", join (", ", @lvs), ")\n";