daemon: NFC Use symbolic names in commandrvf

Improve readability of commandrvf() by replacing bare int values for
file descriptors with their symbolic names STD{IN,OUT,ERR}_FILENO.

Also add PIPE_READ and PIPE_WRITE for referencing relevant ends of a pipe.
(cherry picked from commit e92f9666defd5db09812c1ebd59f9cc4a957475c)
daemon: Add sentinel attribute to commandf and commandrf

Causes a compiler warning to be emitted if you omit the trailing NULL argument.
(cherry picked from commit a9051eb98ea7c97899b98b6b493f0de45a05c17a)
inspection: Don't call guestfs_hivex_close if previous guestfs_hivex_open call failed.

(Thanks Skippy VonDrake)
(cherry picked from commit 95df8a7c0cedb0daf8f5318fbeb931f6a67e6286)
guestfs.h: Fix use of __attribute__ and GCC < 4.

I guess no one uses GCC 3 any more, because if they did, including
<guestfs.h> would not work since GUESTFS_DLL_PUBLIC would not have
been defined.

At the same time, ensure that __attribute__((noreturn)) is only used
when the compiler is GCC >= 3.1.
(cherry picked from commit 27f6878e2af47f798062ae1a6571cdd13c9e5a88)
Change the handling of private functions, safe_malloc etc.

Rename guestfs_safe_malloc et al to guestfs___safe_malloc etc.

To use the private functions, code now has to define
-DGUESTFS_PRIVATE_FUNCTIONS=1.  This will make it easier for us in
future to work out which programs are using these functions and to
minimize both the number of programs and the functions they are
calling.

Note that the Perl, Python, OCaml, Ruby and Java bindings use
guestfs_safe_* calls.  None of the other bindings do.  This is a bug
(in the bindings using those functions): these functions will call the
out of memory callback on failure.  This function defaults to abort(),
and since this happens from a language binding, there is no way to
change this default.
(cherry picked from commit 62e775c350edfddeafd829ca3edcdf3a8065eb00)
build: Show 'make -k check' as a possibility in 'make help' output.

Thanks to Cole Robinson for this suggestion.
(cherry picked from commit 486efb002ae6a0011401fb6839a0823615f998e3)
build: Better formatting for 'make help' output.

This is just whitespace changes.
(cherry picked from commit eca2dd2e8c152ffe8a20960b0973bbd6527a051d)
build: Improve 'make help' output description of 'make extra-tests'.
(cherry picked from commit 22fe98ad9f885dec1af04dd748d66c344e056032)
daemon: Fold stdout on stderr when running e2fsck.

User Phill Bandelow noted that virt-resize fails with an e2fsck error
on a host where the system clock had been accidentally set in the
past.

Unfortunately this was hard to diagnose because guestfsd 'ate' the
stdout of the e2fsck program.  I have verified by code inspection that
e2fsck prints messages on stdout.

Thus this changes the daemon to fold stdout and stderr together so we
get to see all error messages from e2fsck when it fails.
(cherry picked from commit c4ad2c0ce3eea1fdb6e1123e8d5fcfed2d5a0849)
launch: libvirt: Parse capabilities XML and fail early if qemu/KVM not supported (RHBZ#886915).
(cherry picked from commit 11b6293d1bf7a6c0133c609e0e8067b4422dc794)
launch: libvirt: Improve loop invariant from previous commit.

This fixes commit 11b6293d1bf7a6c0133c609e0e8067b4422dc794.
(cherry picked from commit 79339798b398eda0cb24f6f192af1a74c8956792)
sparsify: Document that virt-sparsify doesn't work well on multi-disk VMs.

See: http://bugzilla.redhat.com/887826
(cherry picked from commit 6f02e33c6fbf2f14ba11ef07cb078ad6f6b2fea3)
list-filesystems: Ignore MBR type 0x42 (Windows dynamic disks) (RHBZ#887520).
(cherry picked from commit eab324bbbb6e38120f5882f7e0fadb86e322557c)
daemon: Use pvcreate --force option (RHBZ#887971).

pvcreate fails if the partition contains a swap space signature.  Use
more force to stop it from complaining.
(cherry picked from commit 8237ac89c5b51490f3f3c6f44d35ecaa184dca05)
lua: Use pkg-config to determine Lua version, parameters
(cherry picked from commit 05103cc6937b709192438eed8333aa1fbbb6af02)
lua: Add ifdefs for Lua 5.2 compatibility
(cherry picked from commit f07e89c5f90a1cef8e61428f30916d39ab35541b)
lua: Use correct binary for tests
(cherry picked from commit 5b70120293f3702f290fba5023a7016fa5ff1beb)
lua: Fix Lua configure test on Fedora.

On Debian, the lua pkg-config file is called "lua5.1.pc" (etc)
whereas on Fedora it's called "lua.pc" for all versions.
(cherry picked from commit 62f98d64a51c8076d1a233cef8feeeaa9307a4dc)
docs: Properly document attach methods in the guestfs(3) man page.
(cherry picked from commit 034d393bb13f54c4a471aace55ab7b1f62d2ff21)
lua: Fix misapplied patch.

This fixes commit 5b70120293f3702f290fba5023a7016fa5ff1beb.
(cherry picked from commit 3f88f88c801fa8ede4d9555338a7b10f6ccb38f5)