resize: Move isatty_stdout function to separate module (TTY.isatty_stdout).

It was jammed into the Progress module just for convenience.

(cherry picked from commit b56990ddf8aa4dc4db3da592783acfe055c05534)
internal: Add CLEANUP_XMLFREEURI (cleanup function for xmlURIPtr).

(cherry picked from commit 0e1ba00059b5ebbca2e137f2685b2eb65ed33b13)
fish: Don't store xmlURIPtr directly in the drive struct.

Original drv_uri fields:

      xmlURIPtr uri;        /* URI */
      char *socket;         /* ?socket parameter from URI. */
      const char *format;   /* format (NULL == autodetect) */

New drv_uri fields:

      char *path;           /* disk path */
      char *protocol;       /* protocol (eg. "nbd") */
      char **server;        /* server(s) - can be NULL */
      char *username;       /* username - can be NULL */
      const char *format;   /* format (NULL == autodetect) */
      const char *orig_uri; /* original URI (for error messages etc.) */

This is just code motion.

(cherry picked from commit a3891430bc9fe408505277701962acaa664fc96a)
fish: options: Fix optarg -> arg.

Don't read the global variable optarg.  Read arg instead.
(In all cases they are the same, so this bug made no difference).

(cherry picked from commit 671be806ae79df5d0a9e864d2f9b3461d08c7733)
fish: Split off URI handling (for -a argument) from general options parsing.

This is so we will be able to reuse the same code in the OCaml tools.

This is just code motion.

(cherry picked from commit 4d7c14fdbb372d6ad5ef729b6969078b5fdb68da)
resize: Add bindings for the guestfish -a URI parsing mini-library.

This allows -a options to be parsed from OCaml programs, reusing
the same code that is being used by C.

(cherry picked from commit 406522d1d2c9108c52f1356cbbb9bb4039d9ce84)
sysprep: Allow -a URI options to be used (RHBZ#968875).

This allows you to sysprep a remote guest by doing eg:

  virt-sysprep -a ssh://remote.example.com/disk.img

(cherry picked from commit b65c1c667b26313abf312a7ab51f8bf947243d07)
fish: Fix guestfish so it can recognize sheepdog://... as a valid URI.

Because "sheepdog" is 8 characters, it wasn't recognized before.

(cherry picked from commit e3df223a5aed82b7e502bef327d57dd54d98587b)
fish: Add a test for -a URI options.

(cherry picked from commit 23d429ff845f29b345ff76efab669daf92b5ab42)
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'.
RHEL 7: Remove libguestfs live (RHBZ#798980).

This isn't supported in RHEL 7.
RHEL 7: Exclude iptables from the appliance (RHBZ#858648).
RHEL 7: Ignore /etc/release if /etc/redhat-release exists (RHBZ#873219).

If the user has created /etc/release on a RHEL machine, don't
mis-detect the OS as NetBSD.
RHEL 7: Remove 9p APIs from RHEL (RHBZ#921710).
RHEL 7: Disable unsupported remote drive protocols (RHBZ#962113).

This disables support for unsupported remote drive protocols:

 * ftp
 * ftps
 * http
 * https
 * tftp
 * gluster
 * iscsi
 * rbd
 * sheepdog
 * ssh

Note 'nbd' is not disabled, and of course 'file' works.

We hope to gradually add some of these back over the lifetime of RHEL 7.