RPC: Support up to 16384 cpus on the host and 4096 in the guest

The RPC limits for cpu maps didn't allow to use libvirt on ultra big
boxes. This patch increases size of the limits to support a maximum of
16384 cpus on the host with a maximum of 4096 cpus per guest.
The full cpu map of such a system takes 8 megabytes and the map for
vcpu pinning is 2 kilobytes long.
virsh-domain: Report errors and don't deref NULL in qemu-agent-command

Check the returned value for NULL and take the cleanup path
appropriately if the API fails.
qemu: Properly report guest agent errors on command passthrough

The code for arbitrary guest agent passthrough was horribly broken since
introduction. Fix it to correctly report errors.
libvirt-qemu: Dispatch errors from virDomainQemuAgentCommand()

The original implementation didn't follow the established pattern and
did not dispatch errors in case of failure.
virsh: Obey pool-or-uuid spec when creating volumes

Our documentation says a pool may be referenced by its name or UUID
anywhere if it makes sense (pool-name and pool-uuid are the only
exceptions). However, vol-create and vol-create-as commands did not obey
this.
tests: fix typo in securityselinuxtest
virsh: Allow attach-disk to specify disk wwn

Commit 6e73850b01ee support to set wwn for disks, but it was not
exposed to attach-disk.
docs: add spaces to formatstorage.html

Let the pool types breathe.
Fix a invalid usage of virDomainNetDef in OpenVZ driver

OpenVZ was accessing ethernet data to obtain the guest iface name
regardless the domain is configured to use ethernet or bridged
networking. This prevented the guest network interface to be rightly
named for bridged networking.
nwfilter: grab driver lock earlier during init (bz96649)

This patch is in relation to Bug 966449:

https://bugzilla.redhat.com/show_bug.cgi?id=966449

This is a patch addressing the coredump.

Thread 1 must be calling  nwfilterDriverRemoveDBusMatches(). It does so with
nwfilterDriverLock held. In the patch below I am now moving the
nwfilterDriverLock(driverState) further up so that the initialization, which
seems to either take a long time or is entirely stuck, occurs with the lock
held and the shutdown cannot occur at the same time. 

Remove the lock in virNWFilterDriverIsWatchingFirewallD to avoid
double-locking.
snapshot: remove mutually exclusive memory and disk-only duplicate check

The work was done at the time of snapshot xmlstring parsing

 if (offline && def->memory &&
     def->memory != VIR_DOMAIN_SNAPSHOT_LOCATION_NONE) {
     virReportError(...);
 }
virtlockd: fix socket path

Change the socket path to match the one used by lockd driver.

https://bugzilla.redhat.com/show_bug.cgi?id=968128
storage: Support preallocate the new capacity for vol-resize

The document for "vol-resize" says the new capacity will be sparse
unless "--allocate" is specified, however, the "--allocate" flag
is never implemented. This implements the "--allocate" flag for
fs backend's raw type volume, based on posix_fallocate and the
syscall SYS_fallocate.
storage: Forbid to shrink the vol's capacity if no --shrink is specified

As the document for "virsh-resize" says:
<...>
Attempts to shrink the volume will fail unless I<--shrink> is present;
</...>

This makes sense as it at least prevent the user shrinking the important
data of volume without a notice.
qemu: Abstract code for the cpu controller setting into a helper
maint: don't use config.h in .h files

Enforce the rule that .h files don't need to (redundantly)
include <config.h>.

* cfg.mk (sc_prohibit_config_h_in_headers): New rule.
(_virsh_includes): Delete; instead, inline a smaller number of
exclusions...
(exclude_file_name_regexp--sc_require_config_h)
(exclude_file_name_regexp--sc_require_config_h_first): ...here.
* daemon/libvirtd.h (includes): Fix offenders.
* src/driver.h (includes): Likewise.
* src/gnutls_1_0_compat.h (includes): Likewise.
* src/libxl/libxl_conf.h (includes): Likewise.
* src/libxl/libxl_driver.h (includes): Likewise.
* src/lxc/lxc_conf.h (includes): Likewise.
* src/lxc/lxc_driver.h (includes): Likewise.
* src/lxc/lxc_fuse.h (includes): Likewise.
* src/network/bridge_driver.h (includes): Likewise.
* src/phyp/phyp_driver.h (includes): Likewise.
* src/qemu/qemu_conf.h (includes): Likewise.
* src/util/virnetlink.h (includes): Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
storagevolxml2argvtest: Report better error messages on test failure

If the creation of the commandline failed, libvirt always reported "out
of memory" from the virCommandToString function rather than the proper
error that happened in virStorageBackendCreateQemuImgCmd. Error out
earlier.
storage: Clean up function header and reflow error message

Comply with the coding standard and save a few lines.
storage: Provide better error message if metadata pre-alloc is unsupported

Instead of a unknown flag error report that metadata pre-allocation is
not supported with the requested volume creation method.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=969982
Remove legacy code for single-instance devpts filesystem

Earlier commit f7e8653f dropped support for using LXC with
kernels having single-instance devpts filesystem from the
LXC controller. It forgot to remove the same code from the
LXC container setup.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>