fish: Add --pipe-error flag to allow detection of errors in pipe commands (RHBZ#803533).

For a test case, see:
https://bugzilla.redhat.com/show_bug.cgi?id=803533

In guestfish, we use the gnulib closeout module which sets up an
atexit handler to detect if there were any errors on stdout when the
program exits.  This is so we can fail correctly in out of disk space
cases like:

 guestfish [...] > output

However the atexit handler just checks that there was any error on
stdout (using ferror).  If a pipe command such as:

 ><fs> command_with_lots_of_output | head

ran at any time during the session, the error flag would be set
(because the underlying writes failed with EPIPE errors).

So the commit first adds a test for ferror (stdout) after each command
that we issue.  This brings error handling closer to the point of
failure, and so is generally a good thing.

Secondly we reset the error flag after detecting and dealing with the
error, so that avoids the redundant 'guestfish: write error' message
produced by gnulib closeout.

Thirdly we add a --pipe-error flag which causes guestfish commands to
fail on pipe commands line the one above.  The default is off for
backwards compatibility reasons.
fish: Clean up glob code and make it return error if malloc fails.

This commit tidies up the code for the 'glob' command.  It also makes
the command return an error if malloc fails (previously it would just
print a message but not return any error indication).
fish: Move 'feature_available' function to global.

This is just code motion.
fish: glob command now expands /dev/ patterns (RHBZ#635971).

For example:

><fs> glob echo /dev/*
/dev/vda
/dev/vda1
/dev/vda2
/dev/vda3
><fs> glob echo /dev/v*/*
/dev/vg_f16x64/lv_root
/dev/vg_f16x64/lv_swap
fish: Add a regression test for the 'glob' command.
perl: Don't fail if 'type' (disk format) attribute is missing in libvirt XML (RHBZ#701814).

Old versions of libvirt allowed you to define disks like this:

    <disk type='file' device='disk'>
      <driver name='qemu'/>
      ...

Since the <driver> element does not have a 'type' attribute (which
defines the format), we are supposed to do autodetection, so the
format should be undefined.

However what actually happened was that the code in
Sys::Guestfs::Lib::open_guest received format as an empty string from
the xpath query, causing libguestfs to give an error.

If the xpath query returns the format as an empty string, undefine it.
tests: Regression test for RHBZ#701814.

This commit adds a tests/xml directory, and an LD_PRELOAD module which
can fake arbitrary libvirt XML from an external file (and is therefore
a much more flexible test than using the libvirt test:// driver
alone).

Also added is one regression test for:
https://bugzilla.redhat.com/show_bug.cgi?id=701814

Loading the given libvirt XML using Sys::Guestfs::Lib::open_guest
used to fail with the error:

  format parameter is empty or contains disallowed characters at /home/rjones/d/libguestfs/perl/blib/lib/Sys/Guestfs/Lib.pm line 256.

Thanks to Tom Horsley for supplying the test data.
virt-make-fs: Fix filesystem type check when estimating ntfs.
virt-make-fs: Use mount instead of mount_options.
virt-make-fs: Fix estimation when making btrfs (RHBZ#816098).

This also disables data and metadata duplication, which is not very
useful on a constructed filesystem on a virtual disk.
virt-make-fs: Simplify test code.

This is just code motion.
virt-make-fs: Add a test of btrfs (regression test for RHBZ#816098).
virt-alignment-scan, virt-df: Add newlines after error messages.
virt-alignment-scan: Don't fail immediately if a disk is not accessible (RHBZ#789504).
virt-df: Don't fail immediately if a disk is not accessible (RHBZ#789504).
Version 1.17.39.