X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=tools%2Fvirt-make-fs;h=833c8a5145fc4280afdd628b5b85ae5314873b7a;hb=5d139fa8a4a7f9ff65e7b936fd7376f661c72f48;hp=54c5a1dc68da46b1d91f5af87faf73e01f5bf0aa;hpb=d868221d9f746ab17b83e7220cef9227fcad3696;p=libguestfs.git diff --git a/tools/virt-make-fs b/tools/virt-make-fs index 54c5a1d..833c8a5 100755 --- a/tools/virt-make-fs +++ b/tools/virt-make-fs @@ -20,6 +20,7 @@ use warnings; use strict; use Sys::Guestfs; +use Sys::Guestfs::Lib qw(feature_available); use Pod::Usage; use Getopt::Long; @@ -83,7 +84,7 @@ store something in it. Don't forget that you can also use local commands including L and L to resize existing filesystems, -or rerun virt-make-resize to build another image from scratch. +or rerun virt-make-fs to build another image from scratch. =head3 EXAMPLE @@ -392,10 +393,15 @@ if (!defined $size) { } } +$size = int ($size); + # Create the output disk. # Take the unusual step of invoking qemu-img here. my @cmd = ("qemu-img", "create", "-f", $format, $output, $size); +if ($debug) { + print STDERR ("running: ", join (" ", @cmd), "\n"); +} system (@cmd) == 0 or die __"qemu-img create: failed to create disk image, see earlier error messages\n"; @@ -404,11 +410,11 @@ eval { # Run libguestfs. my $g = Sys::Guestfs->new (); - $g->add_drive ($output); + $g->add_drive_opts ($output, format => $format); $g->launch (); - if ($type eq "ntfs") { - $g->available ([ "ntfs3g" ]); + if ($type eq "ntfs" && !feature_available ($g, "ntfs3g", "ntfsprogs")) { + die __"virt-make-fs: NTFS support was disabled when libguestfs was compiled\n" } # Partition the disk. @@ -523,11 +529,18 @@ sub create_pipe return $pipe; } +=head1 SHELL QUOTING + +Libvirt guest names can contain arbitrary characters, some of which +have meaning to the shell such as C<#> and space. You may need to +quote or escape these characters on the command line. See the shell +manual page L for details. + =head1 SEE ALSO L, L, -L, +L, L, L, L, @@ -550,7 +563,7 @@ L =head1 AUTHOR -Richard W.M. Jones L +Richard W.M. Jones L =head1 COPYRIGHT