This is now used consistently across all the documentation.
boot
[etc.]
-With the C<-l> (C<--long>) option, C<virt-ls> shows more detail:
+With the I<-l> (I<--long>) option, C<virt-ls> shows more detail:
$ virt-ls -l -d myguest /
total 204
dr-xr-xr-x. 5 root root 3072 2009-08-25 19:06 boot
[etc.]
-With the C<-R> (C<--recursive>) option, C<virt-ls> lists the
+With the I<-R> (I<--recursive>) option, C<virt-ls> lists the
names of files and directories recursively:
$ virt-ls -R -d myguest /tmp
=item test2.img (etc)
-When using the C<-N> or C<--new> option, the prepared disk or
+When using the I<-N> or I<--new> option, the prepared disk or
filesystem will be created in the file C<test1.img> in the current
-directory. The second use of C<-N> will use C<test2.img> and so on.
+directory. The second use of I<-N> will use C<test2.img> and so on.
Any existing file with the same name will be overwritten.
=back
"\
This function adds a virtual CD-ROM disk image to the guest.
-This is equivalent to the qemu parameter C<-cdrom filename>.
+This is equivalent to the qemu parameter I<-cdrom filename>.
Notes:
"add qemu parameters",
"\
This can be used to add arbitrary qemu command line parameters
-of the form C<-param value>. Actually it's not quite arbitrary - we
+of the form I<-param value>. Actually it's not quite arbitrary - we
prevent you from setting some parameters which would interfere with
parameters that we use.
The exact command which runs is C<file -zb path>. Note in
particular that the filename is not prepended to the output
-(the C<-b> option).
+(the I<-b> option).
This command can also be used on C</dev/> devices
(and partitions, LV names). You can for example use this
"check an ext2/ext3 filesystem",
"\
This runs C<e2fsck -p -f device>, ie. runs the ext2/ext3
-filesystem checker on C<device>, noninteractively (C<-p>),
-even if the filesystem appears to be clean (C<-f>).
+filesystem checker on C<device>, noninteractively (I<-p>),
+even if the filesystem appears to be clean (I<-f>).
This command is only needed because of C<guestfs_resize2fs>
(q.v.). Normally you should use C<guestfs_fsck>.");
"create a hard link",
"\
This command creates a hard link using the C<ln -f> command.
-The C<-f> option removes the link (C<linkname>) if it exists already.");
+The I<-f> option removes the link (C<linkname>) if it exists already.");
("ln_s", (RErr, [String "target"; Pathname "linkname"], []), 166, [],
[InitScratchFS, Always, TestOutputStruct (
"create a symbolic link",
"\
This command creates a symbolic link using the C<ln -sf> command,
-The C<-f> option removes the link (C<linkname>) if it exists already.");
+The I<-f> option removes the link (C<linkname>) if it exists already.");
("readlink", (RString "link", [Pathname "path"], []), 168, [],
[] (* XXX tested above *),
=item C<features>
-This passes the C<-O> parameter to the external mkfs program.
+This passes the I<-O> parameter to the external mkfs program.
For certain filesystem types, this allows extra filesystem
features to be selected. See L<mke2fs(8)> and L<mkfs.ufs(8)>
"resize an ext2, ext3 or ext4 filesystem to the minimum size",
"\
This command is the same as C<guestfs_resize2fs>, but the filesystem
-is resized to its minimum size. This works like the C<-M> option
+is resized to its minimum size. This works like the I<-M> option
to the C<resize2fs> command.
To get the resulting size of the filesystem you should call
After shrinking PVs and filesystems, shut down the guest, and proceed
with steps 3 and 4 above to allocate a new disk image.
-Then run virt-resize with any of the C<--shrink> and/or C<--resize>
+Then run virt-resize with any of the I<--shrink> and/or I<--resize>
options.
=head2 IGNORING OR DELETING PARTITIONS
qemu-img create [-c] -f qcow2 outdisk [size]
-instead of the truncate command (use C<-c> for a compressed disk).
+instead of the truncate command (use I<-c> for a compressed disk).
Similarly, to get non-sparse raw output use:
--resize /dev/sda1=-10%
You can increase the size of any partition. Virt-resize will expand
-the direct content of the partition if it knows how (see C<--expand>
+the direct content of the partition if it knows how (see I<--expand>
below).
You can only I<decrease> the size of partitions that contain
filesystems or PVs which have already been shrunk. Virt-resize will
check this has been done before proceeding, or else will print an
-error (see also C<--resize-force>).
+error (see also I<--resize-force>).
You can give this option multiple times.
=item B<--resize-force part=size>
-This is the same as C<--resize> except that it will let you decrease
+This is the same as I<--resize> except that it will let you decrease
the size of any partition. Generally this means you will lose any
data which was at the end of the partition you shrink, but you may not
care about that (eg. if shrinking an unused partition, or if you can
easily recreate it such as a swap partition).
-See also the C<--ignore> option.
+See also the I<--ignore> option.
=item B<--expand part>
=item *
LVM PVs (physical volumes). virt-resize does not usually resize
-anything inside the PV, but see the C<--LV-expand> option. The user
+anything inside the PV, but see the I<--LV-expand> option. The user
could also resize LVs as desired after boot.
=back
-Note that you cannot use C<--expand> and C<--shrink> together.
+Note that you cannot use I<--expand> and I<--shrink> together.
=item B<--shrink part>
specified a partition to shrink and that partition had more than a
gigabyte of free space.
-Note that you cannot use C<--expand> and C<--shrink> together.
+Note that you cannot use I<--expand> and I<--shrink> together.
=item B<--ignore part>
The contents of the LV are also resized if virt-resize knows how to do
that. You can stop virt-resize from trying to expand the content by
-using the option C<--no-expand-content>.
+using the option I<--no-expand-content>.
Use L<virt-filesystems(1)> to list the filesystems in the guest.
=item B<--no-expand-content>
By default, virt-resize will try to expand the direct contents
-of partitions, if it knows how (see C<--expand> option above).
+of partitions, if it knows how (see I<--expand> option above).
-If you give the C<--no-expand-content> option then virt-resize
+If you give the I<--no-expand-content> option then virt-resize
will not attempt this.
=item B<-d>
more, but at a much lower level. You will probably end up
hand-calculating sector offsets, which is something that virt-resize
was designed to avoid. If you want to see the guestfish-equivalent
-commands that virt-resize runs, use the C<--debug> flag.
+commands that virt-resize runs, use the I<--debug> flag.
=head1 SHELL QUOTING
program you want to run. The script is invoked as C<$EDITOR tmpfile>
and it should update C<tmpfile> in place however it likes.
-The second method is to use the C<-e> parameter of C<virt-edit> to run
+The second method is to use the I<-e> parameter of C<virt-edit> to run
a short Perl snippet in the style of L<sed(1)>. For example to
replace all instances of C<foo> with C<bar> in a file:
Depending on how you are going to use the output, you might think this
extra space is wasted and want to minimize it, or you might want to
leave space so that more files can be added later. Virt-make-fs
-defaults to minimizing the extra space, but you can use the C<--size>
+defaults to minimizing the extra space, but you can use the I<--size>
flag to leave space in the filesystem if you want it.
An alternative way to leave extra space but not make the output image
any bigger is to use an alternative disk image format (instead of the
-default "raw" format). Using C<--format=qcow2> will use the native
+default "raw" format). Using I<--format=qcow2> will use the native
QEmu/KVM qcow2 image format (check your hypervisor supports this
-before using it). This allows you to choose a large C<--size> but the
+before using it). This allows you to choose a large I<--size> but the
extra space won't actually be allocated in the image until you try to
store something in it.
=item B<-s +E<lt>NE<gt>>
-Use the C<--size> (or C<-s>) option to choose the size of the output
+Use the I<--size> (or I<-s>) option to choose the size of the output
image.
If this option is I<not> given, then the output image will be just
To leave extra space, specify C<+> (plus sign) and a number followed
by b/K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes,
-Terabytes, Petabytes or Exabytes. For example: C<--size=+200M> means
+Terabytes, Petabytes or Exabytes. For example: I<--size=+200M> means
enough space for the input files, and (approximately) an extra 200 MB
free space.
If specified, this flag adds an MBR partition table to the output disk
image.
-You can change the partition table type, eg. C<--partition=gpt> for
+You can change the partition table type, eg. I<--partition=gpt> for
large disks.
-Note that if you just use a lonesome C<--partition>, the Perl option
+Note that if you just use a lonesome I<--partition>, the Perl option
parser might consider the next parameter to be the partition type.
For example:
virt-make-fs --partition input.tar ...
would cause virt-make-fs to think you wanted to use a partition type
-of C<input.tar> which is completely wrong. To avoid this, use C<-->
+of C<input.tar> which is completely wrong. To avoid this, use I<-->
(a double dash) between options and the input file argument:
virt-make-fs --partition -- input.tar ...
=head1 WARNING
-You must I<not> use C<virt-tar> with the C<-u> option (upload) on live
+You must I<not> use C<virt-tar> with the I<-u> option (upload) on live
virtual machines. If you do this, you risk disk corruption in the VM.
C<virt-tar> tries to stop you from doing this, but doesn't catch all
cases.
-You can use C<-x> (extract) on live virtual machines, but you might
+You can use I<-x> (extract) on live virtual machines, but you might
get inconsistent results or errors if there is filesystem activity
inside the VM. If the live VM is synched and quiescent, then
C<virt-tar> will usually work, but the only way to guarantee
just want to edit a single file, use L<virt-edit(1)>. For more
complex cases you should look at the L<guestfish(1)> tool.
-There are two modes of operation: C<-x> (eXtract) downloads a
+There are two modes of operation: I<-x> (eXtract) downloads a
directory and its contents (recursively) from the virtual machine into
-a local tarball. C<-u> uploads from a local tarball, unpacking it
+a local tarball. I<-u> uploads from a local tarball, unpacking it
into a directory inside the virtual machine. You cannot use these two
options together.
-In addition, you may need to use the C<-z> (gZip) option to enable
-compression. When uploading, you have to specify C<-z> if the upload
+In addition, you may need to use the I<-z> (gZip) option to enable
+compression. When uploading, you have to specify I<-z> if the upload
file is compressed because virt-tar won't detect this on its own.
C<virt-tar> can only handle tar (optionally gzipped) format tarballs.
=item B<-u> | B<--upload>
-Use C<-x> to extract (download) a directory from a virtual machine
+Use I<-x> to extract (download) a directory from a virtual machine
to a local tarball.
-Use C<-u> to upload and unpack from a local tarball into a virtual
+Use I<-u> to upload and unpack from a local tarball into a virtual
machine. Please read the L</WARNING> section above before using this
option.
=head1 WARNING
-You must I<not> use C<virt-win-reg> with the C<--merge> option on live
+You must I<not> use C<virt-win-reg> with the I<--merge> option on live
virtual machines. If you do this, you I<will> get irreversible disk
corruption in the VM. C<virt-win-reg> tries to stop you from doing
this, but doesn't catch all cases.
Modifying the Windows Registry is an inherently risky operation. The format
is deliberately obscure and undocumented, and Registry changes
-can leave the system unbootable. Therefore when using the C<--merge>
+can leave the system unbootable. Therefore when using the I<--merge>
option, make sure you have a reliable backup first.
=head1 DESCRIPTION
The first parameter is the libvirt guest name or the raw disk image of
a Windows guest.
-If C<--merge> is I<not> specified, then the chosen registry
+If I<--merge> is I<not> specified, then the chosen registry
key is displayed/exported (recursively). For example:
$ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft'
$ virt-win-reg Windows7 $cvkey ProductName
Windows 7 Enterprise
-With C<--merge>, you can merge a textual regedit file into
+With I<--merge>, you can merge a textual regedit file into
the Windows Registry:
$ virt-win-reg --merge Windows7 changes.reg
Registry of the virtual machine. If this flag is I<not> given then
virt-win-reg displays or exports Registry entries instead.
-Note that C<--merge> is I<unsafe> to use on live virtual machines, and
+Note that I<--merge> is I<unsafe> to use on live virtual machines, and
will result in disk corruption. However exporting (without this flag)
is always safe.
whole file before or after processing.
To reencode a file from Windows format to Linux (before processing it
-with the C<--merge> option), you would do something like this:
+with the I<--merge> option), you would do something like this:
iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg
software.reg: Little-endian UTF-16 Unicode text, with very long lines,
with CRLF line terminators
-This file would need conversion before you could C<--merge> it.
+This file would need conversion before you could I<--merge> it.
=head1 CurrentControlSet etc.