3 # Copyright (C) 2009 Red Hat Inc.
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 use Sys::Guestfs::Lib qw(open_guest get_partitions resolve_windows_path
24 inspect_all_partitions inspect_partition
25 inspect_operating_systems mount_operating_system inspect_in_detail);
29 use File::Temp qw/tempdir/;
36 virt-df - Display free space on virtual filesystems
42 virt-df [--options] guest [guest ...]
44 virt-df [--options] disk.img [disk.img ...]
69 =item B<--connect URI> | B<-c URI>
71 If using libvirt, connect to the given I<URI>. If omitted,
72 then we connect to the default libvirt hypervisor.
74 Libvirt is only used if you specify a C<domname> on the
75 command line. If you specify guest block devices directly,
76 then libvirt is not used at all.
80 GetOptions ("help|?" => \$help,
81 "connect|c=s" => \$uri,
83 pod2usage (1) if $help;
84 pod2usage ("$0: no image or VM names given") if @ARGV == 0;
88 # $g = open_guest (\@ARGV, rw => $rw, address => $uri);
90 # $g = open_guest (\@ARGV, rw => $rw);
96 # # List of possible filesystems.
97 # my @partitions = get_partitions ($g);
99 # # Now query each one to build up a picture of what's in it.
101 # inspect_all_partitions ($g, \@partitions,
102 # use_windows_registry => $windows_registry);
104 # #print "fses -----------\n";
105 # #print Dumper(\%fses);
107 # my $oses = inspect_operating_systems ($g, \%fses);
109 # #print "oses -----------\n";
110 # #print Dumper($oses);
112 # # Mount up the disks and check for applications.
115 # foreach $root_dev (sort keys %$oses) {
116 # my $os = $oses->{$root_dev};
117 # mount_operating_system ($g, $os);
118 # inspect_in_detail ($g, $os);
124 L<virt-inspector(1)>,
128 L<Sys::Guestfs::Lib(3)>,
130 L<http://libguestfs.org/>.
132 For Windows registry parsing we require the C<reged> program
133 from L<http://home.eunet.no/~pnordahl/ntpasswd/>.
137 Richard W.M. Jones L<http://et.redhat.com/~rjones/>
141 Copyright (C) 2009 Red Hat Inc.
143 This program is free software; you can redistribute it and/or modify
144 it under the terms of the GNU General Public License as published by
145 the Free Software Foundation; either version 2 of the License, or
146 (at your option) any later version.
148 This program is distributed in the hope that it will be useful,
149 but WITHOUT ANY WARRANTY; without even the implied warranty of
150 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
151 GNU General Public License for more details.
153 You should have received a copy of the GNU General Public License
154 along with this program; if not, write to the Free Software
155 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.