daemon: Properly quote arguments for tar-out, base64-out commands (RHBZ#957772).

This fixes commit c78ec7e085e99bfddd0509dece72bf6a8d0188ce
which was an attempt to fix RHBZ#908322.
(cherry picked from commit c5f356a60351dd51cbd3a9aabcac2cd40562f36a)
tests: Add a regression test for RHBZ#957772.
(cherry picked from commit cc93840d31e440e64e27ee13df3afd134ef2e68f)
inspection: Fix double-free when certain guest files are empty.

The following commit:

  commit 5a3da366268825b26b470cde35658b67c1d11cd4
  Author: Richard W.M. Jones <rjones@redhat.com>
  Date:   Thu Jan 24 17:07:38 2013 +0000

      inspect: Use CLEANUP_* macros in inspection code.

can cause a double-free along an error path when certain guest files
are empty where we expected those files to contain at least one line.

This causes virt-inspector to crash when run on these guests.

The following is a test case which demonstrates the crash.
`f20rawhidex64' is a Fedora guest, but with small adjustments to the
test you could use any Linux guest for this test.

  $ qemu-img create -f qcow2 -b f20rawhidex64 /tmp/test.qcow2
  Formatting '/tmp/test.qcow2', fmt=qcow2 size=21474836480 backing_file='f20rawhidex64' encryption=off cluster_size=65536 lazy_refcounts=off
  $ guestfish -i -a /tmp/test.qcow2 -- rm /etc/redhat-release : touch /etc/redhat-release
  $ virt-inspector /tmp/test.qcow2
  *** glibc detected *** virt-inspector: double free or corruption (fasttop): 0x00007f18bc9925a0 ***
  ======= Backtrace: =========
  /lib64/libc.so.6(+0x34ecc7ca8e)[0x7f18b8e64a8e]
  /lib64/libguestfs.so.0(+0x3f91898078)[0x7f18ba13c078]
  /lib64/libguestfs.so.0(+0x3f91899761)[0x7f18ba13d761]
  /lib64/libguestfs.so.0(+0x3f91896d12)[0x7f18ba13ad12]
  /lib64/libguestfs.so.0(+0x3f91894140)[0x7f18ba138140]
  /lib64/libguestfs.so.0(guestfs_inspect_os+0x35)[0x7f18ba0bcc35]
  virt-inspector(main+0x547)[0x7f18ba7c57d7]
  /lib64/libc.so.6(__libc_start_main+0xf5)[0x7f18b8e09a05]
  virt-inspector(+0x6665)[0x7f18ba7c7665]

This is a denial of service, but not likely to be exploitable.

(Found by Coverity)
(cherry picked from commit fa6a76050d82894365dfe32916903ef7fee3ffcd)
Remove use of gnulib progname module.

It's simpler to use the glibc 'program_invocation_short_name(3)'
feature, and fall back to a generic solution.  Also remove risky
assignments to argv[0].

(cherry picked from commit 142b874ce8ddc09a06e765df66445a3611d61c29)
add --with-supermin-extra-options configure option

Useful to pass --use-installed and other options to supermin.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
(cherry picked from commit 3acf6768f0142d71b826b255e00d31276b8982ac)
debian: packagelist: Add mtools.
(cherry picked from commit a7107854ba67a5d0295e1df9c48342fc3eebd142)
valgrind suppressions: Suppress libmagic leaks.
(cherry picked from commit e4ef9a82817120deee0282ed4ae2a3d255ef54da)
is_lv: Does not need to depend on lvm2.

It only uses 'stat', not any lvm binaries.
(cherry picked from commit 09b4cc45a3da90e565e502d62137f089b116235d)
tests: 'If' and 'Unless' conditions never used, so remove them.
(cherry picked from commit e327351304d603e8f12b7a95ab277ae480d4edec)
FAQ: Add a quick summary to the debugging section of the FAQ.
(cherry picked from commit ca11cd104dae4a2d301a2d8e9f511b4073bd7c81)
fish: options: Whitespace change.
(cherry picked from commit b48e416d27412674b8f11de9cfcef079adf6ccf2)
tests: guests: Display some information about each phony guest for debugging.

This adds debugging output like this:

  fedora-btrfs.img: file size bytes: 536870912
  fedora-btrfs.img: allocated bytes: 12963840
  fedora-btrfs.img: MD5 hash:        7e8eded44fc832b0f88b0dc5eebf490c

(cherry picked from commit 0c605eb94f20cb08e4a858988e0da121af6f66cb)
tests: guests: Auto-generated guests-all-good.xml.

Only include guests which we successfully created, so for example if
there's no NTFS support then the Windows guest won't be included.
(cherry picked from commit 2ae72dcaf89130647f03ff7c3d0900215a91f59a)
examples: Don't ignore return value of chdir.

GCC 4.7.3 whinges about this.
(cherry picked from commit 2da8d495908a5d716ba505def7794bc25555fca0)
virt-ls: Use string instead of small array.

This works around the following warning:

virt-ls.c: In function 'show_file':
virt-ls.c:574:1: error: stack protector not protecting function: all local arrays are less than 4 bytes long [-Werror=stack-protector]
(cherry picked from commit 6a5495ea3c085eb557526d5e1431cf3c8bbe4bc4)
gobject: Link libguestfs-gobject library with GOBJECT_LIBS.

There's no such thing as a _LIBS variable in automake, so
this line was effectively being ignored.
(cherry picked from commit 1eaf338acdd4ee60cc85ae74417fd055534ff69d)
gobject: Link libguestfs-gobject library with GIO.

So that we get the g_cancellable_* symbols.
(cherry picked from commit 2e6e77fd0225a2f89494356a643919f021b053ef)
grub-install: Change test to use /dev/sda instead of /dev/vda.

The previous test for grub-install hard-coded /dev/vda (ie. assuming
virtio-blk instead of more modern virtio-scsi).

This changes the test to hard-code /dev/sda instead.  However this
change is still not correct since /dev/sda will be adjusted by block
device name translation in the call to grub-install, but not what is
written to /boot/grub/device.map.

Since we no longer support grub-install on Fedora, this won't affect
things, but Ubuntu still has a 'grub-install' command (although it's
actually from grub2).
(cherry picked from commit 50003c8cba6082308b2a3edb17ef90be8dc0e0f3)
tests: sysprep: Specify list of operations explicitly.

This commit makes no functional change on its own, but it allows us to
filter out failing operations on Ubuntu.
(cherry picked from commit fecc74e080aa89bc1f4f07b815792c1998edf48f)
tests/guests: Add make-guests-all-good.pl to EXTRA_DIST.

This fixes commit 2ae72dcaf89130647f03ff7c3d0900215a91f59a.
(cherry picked from commit d99e26d2f3c637b52c6cf65502c05d05db2ee5db)