1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265
|
=head1 NAME
virt-diff - Differences between files in two virtual machines
=head1 SYNOPSIS
virt-diff [--options] -d domain1 -D domain2
virt-diff [--options] -a disk1.img [-a ...] -A disk2.img [-A ...]
=head1 DESCRIPTION
C<virt-diff> lists the differences between files in two virtual
machines or disk images. The usual use case is to show the
changes in a VM after it has been running for a while, by taking
a snapshot, running the VM, and then using this tool to show
what changed between the new VM state and the old snapshot.
This tool will find differences in filenames, file sizes, checksums,
extended attributes, file content and more from a virtual machine or
disk image. However it B<does not> look at the boot loader, unused
space between partitions or within filesystems, "hidden" sectors and
so on. In other words, it is not a security or forensics tool.
To specify two guests, you have to use the I<-a> or I<-d> option(s)
for the first guest, and the I<-A> or I<-D> option(s) for the second
guest. The common case is:
virt-diff -a old.img -A new.img
or using names known to libvirt:
virt-diff -d oldguest -D newguest
=head1 OPTIONS
=over 4
=item B<--help>
Display brief help.
=item B<-a> file
=item B<--add> file
Add I<file> which should be a disk image from the first virtual
machine. If the virtual machine has multiple block devices, you must
supply all of them with separate I<-a> options.
The format of the disk image is auto-detected. To override this and
force a particular format use the I<--format=..> option.
=item B<-a> URI
=item B<--add> URI
Add a remote disk. See L<guestfish(1)/ADDING REMOTE STORAGE>.
=item B<--all>
Same as I<--extra-stats> I<--times> I<--uids> I<--xattrs>.
=item B<--atime>
The default is to ignore changes in file access times, since those are
unlikely to be interesting. Using this flag shows atime differences
as well.
=item B<-A> file
=item B<-A> URI
Add a disk image from the second virtual machine.
__INCLUDE:blocksize-option.pod__
=item B<--checksum>
=item B<--checksum=crc|md5|sha1|sha224|sha256|sha384|sha512>
Use a checksum over file contents to detect when regular files have
changed content.
With no argument, this defaults to using I<md5>. Using an argument,
you can select the checksum type to use. If the flag is omitted then
file times and size are used to determine if a file has changed.
=item B<-c> URI
=item B<--connect> URI
If using libvirt, connect to the given I<URI>. If omitted, then we
connect to the default libvirt hypervisor.
If you specify guest block devices directly (I<-a>), then libvirt is
not used at all.
=item B<--csv>
Write out the results in CSV format (comma-separated values). This
format can be imported easily into databases and spreadsheets, but
read L</NOTE ABOUT CSV FORMAT> below.
=item B<--dir-links>
The default is to ignore changes in the number of links in directory
entries, since those are unlikely to be interesting. Using this flag
shows changes to the nlink field of directories.
=item B<--dir-times>
The default is to ignore changed times on directory entries, since
those are unlikely to be interesting. Using this flag shows changes
to the time fields of directories.
=item B<-d> guest
=item B<--domain> guest
Add all the disks from the named libvirt guest, as the first guest.
Domain UUIDs can be used instead of names.
=item B<-D> guest
Add all the disks from the named libvirt guest, as the second guest.
Domain UUIDs can be used instead of names.
=item B<--echo-keys>
When prompting for keys and passphrases, virt-diff normally turns
echoing off so you cannot see what you are typing. If you are not
worried about Tempest attacks and there is no one else in the room you
can specify this flag to see what you are typing.
=item B<--extra-stats>
Display extra stats.
=item B<--format=raw|qcow2|..>
=item B<--format>
The default for the I<-a>/I<-A> option is to auto-detect the format of
the disk image. Using this forces the disk format for I<-a>/I<-A>
options which follow on the command line. Using I<--format> with no
argument switches back to auto-detection for subsequent I<-a>/I<-A>
options.
For example:
virt-diff --format=raw -a disk.img [...]
forces raw format (no auto-detection) for F<disk.img>.
virt-diff --format=raw -a disk.img --format -a another.img [...]
forces raw format (no auto-detection) for F<disk.img> and reverts to
auto-detection for F<another.img>.
If you have untrusted raw-format guest disk images, you should use
this option to specify the disk format. This avoids a possible
security problem with malicious guests (CVE-2010-3851).
=item B<-h>
=item B<--human-readable>
Display file sizes in human-readable format.
__INCLUDE:key-option.pod__
__INCLUDE:keys-from-stdin-option.pod__
=item B<--times>
Display time fields.
=item B<--time-days>
Display time fields as days before now (negative if in the future).
Note that C<0> in output means "up to 1 day before now", or that the
age of the file is between 0 and 86399 seconds.
=item B<--time-relative>
Display time fields as seconds before now (negative if in the future).
=item B<--time-t>
Display time fields as seconds since the Unix epoch.
=item B<--uids>
Display UID and GID fields.
=item B<-v>
=item B<--verbose>
Enable verbose messages for debugging.
=item B<-V>
=item B<--version>
Display version number and exit.
=item B<-x>
Enable tracing of libguestfs API calls.
=item B<--xattrs>
Display extended attributes.
=back
=head1 NOTE ABOUT CSV FORMAT
Comma-separated values (CSV) is a deceptive format. It I<seems> like
it should be easy to parse, but it is definitely not easy to parse.
Myth: Just split fields at commas. Reality: This does I<not> work
reliably. This example has two columns:
"foo,bar",baz
Myth: Read the file one line at a time. Reality: This does I<not>
work reliably. This example has one row:
"foo
bar",baz
For shell scripts, use C<csvtool> (L<https://github.com/Chris00/ocaml-csv>
also packaged in major Linux distributions).
For other languages, use a CSV processing library (eg. C<Text::CSV>
for Perl or Python’s built-in csv library).
Most spreadsheets and databases can import CSV directly.
=head1 EXIT STATUS
This program returns 0 if successful, or non-zero if there was an
error.
=head1 SEE ALSO
L<guestfs(3)>,
L<guestfish(1)>,
L<virt-cat(1)>,
L<virt-copy-out(1)>,
L<virt-ls(1)>,
L<virt-tar-out(1)>,
L<http://libguestfs.org/>.
=head1 AUTHOR
Richard W.M. Jones L<http://people.redhat.com/~rjones/>
=head1 COPYRIGHT
Copyright (C) 2009-2020 Red Hat Inc.
|