test-tool: Rearrange output into alphabetical order.

(cherry picked from commit 10b20b79384e2446277b3196f12a9736af7ff13b)
builder: Add note about cloning to man page.

(cherry picked from commit be5fd2fd349af5e306c7e139a23548c351701015)
builder: Clearer note in man page about SELinux and where /.autorelabel file comes from.

It's not added by virt-builder.  It is present in the templates (added
by virt-sysprep in fact).

(cherry picked from commit 88094f3da44eb9871d67a1a015362b7ae20e00dd)
builder: Add tip for how to relabel SELinux guest at build time.

Thanks: purpleidea/James.
(cherry picked from commit 20a4bfde9628cfeb8bea441cab7dcc94843b34e3)
remove non-portable chmod

'chmod --reference' is not available on Mac OS X.

Keeping the original file and directing edits into it preserves permissions and removes the need to chmod.

(Tried 'sed -i' for inplace editing but unfortunately it isn't portable either.)

(cherry picked from commit 873051e108eddfdd79205d0c8daf2654ad40e5d6)
builder: Add -monitor none to example command line.

(cherry picked from commit c6ec6cde27ef87480b9b38f13b08b39eb1400f4b)
builder: Move is_block_device function into common utilities.

This is just code motion.

(cherry picked from commit 81b4e5d5cd68f65aa950251e22332b3fa477fecb)
sparsify: Prevent overwriting block or char output devices (RHBZ#1056290).

virt-sparsify doesn't work if the output is a block device, and cannot
possibly work if the output is a char device.  Currently if you try
this it actually overwrites (deletes) the output device which is not
exactly desirable.  Therefore throw an error and exit.

(cherry picked from commit 13bca32e4ec9213e69ea55e837dea846719fb67e)
generator/set-uuid: Fix two typos in documentation

(cherry picked from commit 49c3d819c184f71ac98cd436fb9435f5b3bbddda)
daemon: lvm2: Ignore "unknown device" output when a PV is missing (RHBZ#1054761).

(cherry picked from commit aa2ca8ba703254267939dfcd8d276cbd6f651858)
tests/regressions: Don't include binaries in EXTRA_DIST.

Because EXTRA_DIST simply used $(TESTS), and because the list of tests
includes C binaries, these were included in the tarball (actually not
binaries, but libtool scripts, but it's still undesirable).

(cherry picked from commit 629cb87b6d3cdf1d2d80754c5cd4241c7781bcf4)
fish/uri: Tidy up error messages.

(cherry picked from commit b93a1d50ad1dfe44e6ad2434dbc3f0c71fda7141)
libvirt-domain: Remove unnecessary and wrongly indented parens.

(cherry picked from commit 1d2e74414b04d69ed48984a7a4e809be502c7999)
resize: Don't truncate libguestfs error messages.

If we rely on OCaml's internal exception printing, then it will
truncate error messages like this:

  Fatal error: exception Guestfs.Error("could not create appliance
  through libvirt.

  Try running qemu directly without libvirt using this environment
  variable: export LIBGUESTFS_BACKEND=direct

  Original error from libvirt: unable to set security context
  'unconfined_u:object_r:svi
note the truncation here ^^^^^^^

Instead of using the internal exception printing, wrap the whole
program in a 'main ()' function and add an exception handler.

This large change is non-functional apart from the addition of the
exception handlers at the end.

(cherry picked from commit 3331db84bc0e720abec0dfbc82bba15ccae00b6e)
tests/mountable: add missing space in test-mountable-inspect.sh

No actual behaviour, other than getting rid of a bash warning.

(cherry picked from commit f66d6a85b633f0e79d14c311db4020e22709117a)
builder, sysprep: initialise the random generator

virt-builder and virt-sysprep may make use of
Common_utils.string_random8 (which uses Random.int) for constructing
temporary paths; not initialising the random generator means that every
invocation will reuse the same name used previously (!).
Thus just call Random.self_init, just like virt-sparsify already does.

Expand the test-virt-sysprep-script.sh test to ensure that virt-sysprep
is not affected again by this issue.

(cherry picked from commit ce9d4d335b0c13f3ea75048666ccf5b63de29f8e)
run: Actually use timeout --foreground option (RHBZ#1025269).

The following commit managed to not actually add the --foreground
option to the timeout command, just test for it.  Add it this time.

  commit 681488877456b83f039dc518861f29ab4e1857f0
  Author: Richard W.M. Jones <rjones@redhat.com>
  Date:   Thu Dec 19 08:21:53 2013 +0000

    run: Use timeout --foreground option.

    If timeout doesn't have this option (RHEL 6) don't use timeout at all.

    Attempt to fix RHBZ#1025269.

(cherry picked from commit e3f72805d108c601280b889692c47d7d825e6079)
src/Makefile.am: Reorder SOURCES into alphabetical order.

(cherry picked from commit 65fc841ea68f0739ad1cd40c213b55200df6ceb8)
daemon: Always pass -F option to mkfs.ntfs.

Otherwise it moans about:

  mkfs: ntfs: /dev/sda: /dev/sda is entire device, not just one partition.
  Refusing to make a filesystem here!

This has been happening for a while, so I don't know why we didn't
notice it before.  It even happens on RHEL 6.

A simple reproducer is:

  virt-make-fs -t ntfs any-tarball.tar.gz test.img

(cherry picked from commit 40512c66af562886311b5eff50a505b95c5fbadd)
sysprep: Add script4.sh (test script) to EXTRA_DIST.

This fixes commit ce9d4d335b0c13f3ea75048666ccf5b63de29f8e.

(cherry picked from commit 233d5410e5539c638ea186b81d43cf114c2ce217)