v2v: Change --help text URLs so they don't reference esx as main server.

(cherry picked from commit a7a5a223d4ca17b09a1e489fb3f147a2102f98d7)
mllib: Enhance and rename 'detect_compression' function so it can detect a few more file types.

(cherry picked from commit d8e26d0e4dc3de649cf81584e8c060becd2e4531)
v2v: -i ova: Allow directories and ZIP files to be used as input (RHBZ#1152998).

OVA is not a particularly well-specified format.  The specification
allows a directory to be an OVA, so enable that.  The spec doesn't
mention that ZIP can be used in place of tar, but since we have seen
these in the wild, allow that too.

(cherry picked from commit 60405e5aa1b89ce4ad8b27efb992e82e38d6dbeb)
v2v: Handle *.vmdk.gz compressed files (RHBZ#1152998).

The OVA spec allows the disk images to be gzipped within the OVA
container.

(cherry picked from commit ede39a7591122abe29fc6de29aaa717ee9f8bb55)
v2v: -i ova: Add a test for ZIP as a container (RHBZ#1152998).

(cherry picked from commit f27a582b6dd85a2810351cf7c2d2c98dc5ea6e9a)
v2v: -i ova: Add a test for *.vmdk.gz compressed files (RHBZ#1152998).

(cherry picked from commit 9019c4eb0621397163f0092c5c00ebb969d14152)
ls: in CSV mode, always have a checksum field (RHBZ#1151900).

Make sure to output the field for checksum even for non-regular files,
as empty, in CSV output mode. This ensures each line has the same number
of fields, regardless of the file type.

(cherry picked from commit e5befcacc5f7c1a6bd67fcdb92afede1a82d50eb)
cat, diff: avoid double slashes in paths (RHBZ#1151910).

In full_path, skip the trailing slash in the base directory when
different than "/", as the slash will eventually be added when building
the resulting path.

(cherry picked from commit 87941d183f4a96b4d936c2e94a79a60288f0dc74)
diff: do not pad uid/gid in CSV mode

(cherry picked from commit 3276845df1847d037fc4a5bed24966e0f9a0d564)
appliance: Set udev.event-timeout to override default too low udev setting.

Unfortunately udev removed the udevtimeout setting on the kernel
command line.  This means the default timeout was being set back to 30
seconds, which is way too low for remote disks.

However it was re-added (2014-07-29) as udev.event-timeout.  Set both
to be sure.

Note this requires systemd >= 216.

(cherry picked from commit 0b49defc2b4307e1f9159b862637978129aaed29)
v2v: Increase vCenter https timeout to 10 minutes.

(cherry picked from commit 9ddfbad814e55553d9d1cea08134311c12923cfe)
v2v: -i libvirt: Create three specialized subclasses for handling vCenter/Xen/other.

Previously we had one class ('input_libvirt') which handled all three
cases.  Now we have one superclass ('input_libvirt') and three
subclasses of that ('input_libvirt_vcenter_https',
'input_libvirt_xen_ssh', 'input_libvirt_other') which handle the three
cases separately.

This is just code motion, and should be functionally equivalent to
what was here before.

(cherry picked from commit 9596fc44ff522f5f993a3c5ef9bb24a9a1b4a996)
v2v: -i libvirt: Refactor map_source* functions.

Get rid of the awkward map_source* functions, and replace it with
equivalent code which modifies the source disks objects coming back
from Input_libvirtxml.parse_libvirt_xml.

This is just code refactoring.  Apart from the order in which certain
tests are done, this should be equivalent to the previous code.

(cherry picked from commit 3596165282ccf2c5896894ec4e9a71c6da788463)
v2v: Add a unique number to source disks.

Note that it doesn't matter what the number is, as long as it's
different for each disk.

The unique number lets us store extra data in input objects which is
associated with each disk.

(cherry picked from commit 63387fd8d0d77f7fdaaad14e5053b86ae51cbd6e)
v2v: Add input#adjust_overlay_parameters method.

This is called before the copying phase to allow the input method to
adjust overlay/backing parameters.

The default implementation does nothing, so this commit has no effect.

(cherry picked from commit 0084736f5fe75f62f72f0014333b32ab753b1554)
v2v: vCenter: Adjust readahead parameter between conversion and copying phases (RHBZ#1151033) (RHBZ#1153589).

Previously we fixed RHBZ#1151033 by increasing the cURL readahead
parameter to a large value.  Unfortunately this is too large -- and
hence slow -- for the conversion phase, which broke on slow vCenter
servers (RHBZ#1153589).

What we do now is to perform the conversion phase with the default
readahead (2MB) to ensure stability, since performance of the
conversion phase is not critical.  Then before copying we change the
readahead to the larger value (64MB) to ensure efficient copying.

(cherry picked from commit 9281dc7d44b7b02c6470a61425aa177e6525ee88)
v2v: Refactor Xen and vCenter code.

This refactors the code into more logical units, based on the previous
commits.  So Xen + the input_libvirt Xen code is grouped and moved
into a new module called Input_libvirt_xen_ssh.  Similarly VCenter +
input_libvirt vCenter code is moved to Input_libvirt_vcenter_https.

There is no change here, purely code motion.

(cherry picked from commit a468fde01687914de501f0a95cd5a40986daec29)
v2v: Inline and simplify Xen and vCenter input methods.

Take the opportunity presented by the refactoring in the previous
commit to inline and simplify functions in these input subclasses.

This finally removes the map_source* functions.

(cherry picked from commit b8f826b7ac1e7f90f670f474c3582b56063cdef6)
v2v: vcenter: Hoist readahead configurables to top of file.

No change, just code motion.

(cherry picked from commit 496d0c45bc5e8c361d2cccb20b0f3a64443b05ab)
RHEL 7: Emphasize libguestfs-winsupport package (RHBZ#627468).

This RHEL-only patch changes the error messages when the
inspection code cannot find an operating system inside the guest
image.  For a Windows guest this may happen because the user has not
installed the separate 'libguestfs-winsupport' package.  Therefore we
emphasize that the user may need to install this package.

Notes:

(1) In RHEL there are two pieces of inspection code, the old Perl code
(deprecated upstream) and the new C core inspection API.  Therefore
this patch has to touch two places with essentially the same change.

(2) This patch doesn't try to be clever and detect if it was a Windows
guest.  This should reduce the chance of failure.

Output from (Perl) virt-inspector now looks like this:

 $ virt-inspector disk.img
 No operating system could be detected inside this disk image.

 This may be because the file is not a disk image, or is not a virtual machine
 image, or because the OS type is not understood by virt-inspector.

 If you feel this is an error, please file a bug report including as much
 information about the disk image as possible.

 RHEL notice
 -------------
 libguestfs will return this error for Microsoft Windows guests if the
 separate 'libguestfs-winsupport' package is not installed. If the
 guest is running Microsoft Windows, please try again after installing
 'libguestfs-winsupport'.

Output from guestfish (ie. C core inspection API) now looks like this:

 $ guestfish -i disk.img
 guestfish: no operating system was found on this disk

 RHEL notice
 -------------
 libguestfs will return this error for Microsoft Windows guests if the
 separate 'libguestfs-winsupport' package is not installed. If the
 guest is running Microsoft Windows, please try again after installing
 'libguestfs-winsupport'.