launch: direct: Don't try to wait for qemu if parent process forked (RHBZ#998482).

When using guestfish --remote, libguestfs is not the parent of qemu,
so waitpid is expected to return -ECHILD.  And indeed guestfish --remote
would print a bogus error message in this case:

  libguestfs: error: waitpid (qemu): No child processes

If the parent process forked into the background, then it should have
called 'set_recovery_proc 0' so we can use this to determine if we
need to wait for qemu.

Thanks: Kazuya Saito for reporting and identifying the issue.

Cherry picked from commit a843b5e5e32c151e7b0c74bb4f7be1030f9ac85b
and adapted for RHEL 6 branch.
fish: Document that guestfish --remote --add won't work as expected (RHBZ#998513).
(cherry picked from commit 7e396954611d827dc236a114ed22a781687c002d)
launch: direct: Specify -cpu host,+kvmclock.

'-cpu host' makes the CPU look like the host CPU.  This is useful
because it means the appliance can use all the host CPU's features,
eg. for fast checksumming or MD XORing.

'kvmclock' is the paravirtualized clock for qemu/KVM.  It's much more
stable than relying on tsc or a virtualized device such as HPET, and
clock instability is one of the problems we have encountered when
running libguestfs on a heavily loaded machine, especially in a nested VM.

Note that we require qemu >= 1.2 (and have for a while) which has long
supported both of these options.

(cherry picked from commit 038ed0a08eaed33e62a27c9f91780a25de0bc08c)
launch: direct: Don't use -cpu host on TCG.

qemu -cpu \? documents this as:

host  KVM processor with all supported host features (only available in KVM mode)

And indeed if you try it with TCG you'll get this error:

Unable to find CPU definition: host

This fixes commit 038ed0a08eaed33e62a27c9f91780a25de0bc08c.

(cherry picked from commit c53b459fdd7fc340f48a76496b7e7e18256a2d64)
RHEL 6: Emphasize libguestfs-winsupport package (RHBZ#627468).

This RHEL 6.1-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 6.1 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 6 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 6 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'.
RHEL 6: Require external hex editor set with $HEXEDITOR.

RHEL 6 doesn't have the hexedit program or any suitable replacement.
Require that the user sets $HEXEDITOR to make this command work.
(cherry picked from commit 1ee31426e13446bc5fcce242eb496a01d8a78d8c)
RHEL 6: Directly include String::ShellQuote.

Directly include a snippet from String::ShellQuote so that we
don't need to depend on this external library, which is not
included in RHEL 6.1.

This affects virt-make-fs.
RHEL 6: Modify blkid test so it is successful on RHEL 6-era blkid.
RHEL 6: Remove libguestfs live (RHBZ#798980).

This isn't supported in RHEL 6.
RHEL 6: Exclude iptables from the appliance (RHBZ#858648).
RHEL 6: In mount-local docs, change refs to libguestfs 1.18 -> RHEL 6.4.

We backported the libguestfs 1.18 / mount-local functionality
into the libguestfs 1.16 codebase for RHEL 6.4.
RHEL 6: Ignore /etc/release if /etc/redhat-release exists (RHBZ#872454).

If the user has created /etc/release on a RHEL machine, don't
mis-detect the OS as NetBSD.
RHEL 6: Modify ruby Rakefile.in to work with older Ruby.
RHEL 6: Remove check for qemu >= 1.
RHEL 6: Revert "Use pkg-config for Python"

Python in RHEL 6 does not contain the required pkg-config files.

This reverts commit e5f0dfb6e3425e8dbaa405847ae98a8dcc421da7.
RHEL 6: tests/regressions/rhbz895904.sh: Use `` instead of $().

Apparently bash in RHEL 6 cannot handle this unusual
multi-line use of $(...), but `` works fine.
RHEL 6: Add back some state test commands to guestfish (RHBZ#971664).

In RHEL 6, re-add the following commands to ensure there is no
regression between RHEL 6.4 and RHEL 6.5:

  get-state            get the current state
  is-busy              is busy processing a command
  is-launching         is launching subprocess
  is-ready             is ready to accept commands

(As a side-effect this also adds 'wait-ready' which is a no-op).

These commands have been removed upstream and will be removed
permanently in RHEL 7.  The reason is that these commands do not do
anything useful.
RHEL 6: Pipe 'yes' into ntfsresize (RHBZ#971326).

This works around a problem in ntfsresize on RHEL 6.  See:
https://bugzilla.redhat.com/show_bug.cgi?id=971326#c4
RHEL 6: Remove 9p APIs from RHEL (RHBZ#997884).

(cherry picked from commit 5f7b0f81793f38191634f4460b1c18b97990db44)