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-v2v - Convert Xen guests to KVM
40 virt-v2v xen_name -o kvm_name
42 virt-v2v guest.img [guest.img ...]
69 Display version number and exit.
75 =item B<--connect URI> | B<-c URI>
77 If using libvirt, connect to the given I<URI>. If omitted,
78 then we connect to the default libvirt hypervisor.
80 Libvirt is only used if you specify a C<domname> on the
81 command line. If you specify guest block devices directly,
82 then libvirt is not used at all.
86 GetOptions ("help|?" => \$help,
87 "version" => \$version,
88 "connect|c=s" => \$uri,
90 pod2usage (1) if $help;
92 my $g = Sys::Guestfs->new ();
93 my %h = $g->version ();
94 print "$h{major}.$h{minor}.$h{release}$h{extra}\n";
97 pod2usage ("$0: no image or VM names given") if @ARGV == 0;
101 # $g = open_guest (\@ARGV, rw => $rw, address => $uri);
103 # $g = open_guest (\@ARGV, rw => $rw);
109 # # List of possible filesystems.
110 # my @partitions = get_partitions ($g);
112 # # Now query each one to build up a picture of what's in it.
114 # inspect_all_partitions ($g, \@partitions,
115 # use_windows_registry => $windows_registry);
117 # #print "fses -----------\n";
118 # #print Dumper(\%fses);
120 # my $oses = inspect_operating_systems ($g, \%fses);
122 # #print "oses -----------\n";
123 # #print Dumper($oses);
125 # # Mount up the disks and check for applications.
128 # foreach $root_dev (sort keys %$oses) {
129 # my $os = $oses->{$root_dev};
130 # mount_operating_system ($g, $os);
131 # inspect_in_detail ($g, $os);
137 L<virt-inspector(1)>,
141 L<Sys::Guestfs::Lib(3)>,
143 L<http://libguestfs.org/>.
145 For Windows registry parsing we require the C<reged> program
146 from L<http://home.eunet.no/~pnordahl/ntpasswd/>.
150 Richard W.M. Jones L<http://et.redhat.com/~rjones/>
154 Copyright (C) 2009 Red Hat Inc.
156 This program is free software; you can redistribute it and/or modify
157 it under the terms of the GNU General Public License as published by
158 the Free Software Foundation; either version 2 of the License, or
159 (at your option) any later version.
161 This program is distributed in the hope that it will be useful,
162 but WITHOUT ANY WARRANTY; without even the implied warranty of
163 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
164 GNU General Public License for more details.
166 You should have received a copy of the GNU General Public License
167 along with this program; if not, write to the Free Software
168 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.