daemon: Enhance documentation for changing NOFILE limit

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Fix virQEMUCapsLoadCache leaks

Valgrind reported leaking of maxCpus and arch strings from
virXPathString, as well as the leak of the machineMaxCpus array.

Don't use 'str' for the strings we don't want to free, to allow
freeing of 'str' in the cleanup label and free machineMaxCpus
in virCapsReset too.
Fix unitialized data in virSocketAddrMask

The virSocketAddrMask method did not initialize all fields
in the sockaddr_in6 struct. In paticular the 'sin6_scope_id'
field could contain random garbage, which would in turn
affect the result of any later virSocketAddrFormat calls.
This led to ip6tables rules in the FORWARD chain which
matched on random garbage sin6_scope_id. Fortunately these
were ACCEPT rules, so the impact was merely that desired
traffic was blocked, rather than undesired traffic allowed.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
bhyve: host API support

New functionalities:
- connectGetMaxVcpus - on bhyve hardcode this value to 16
- nodeGetFreeMemory - do not use physmem_get on FreeBSD, since
                      it might get wrong value on systems with
                      more than 100GB of RAM
- nodeGetCPUMap - wrapper only for mapping function, currently not
                  supported by FreeBSD
- nodeSet/GetMemoryParameters - wrapper only for future improvements,
                                currently not supported by FreeBSD
is_selinux_enabled() returns -1 on error, account for this.

Per the documentation, is_selinux_enabled() returns -1 on error.
Account for this. Previously when -1 was being returned the condition
would still be true. I was noticing this because on my system that has
selinux disabled I was getting this in the libvirt.log every 5
seconds:

error : virIdentityGetSystem:173 : Unable to lookup SELinux process context: Invalid argument

With this patch applied, I no longer get these messages every 5
seconds. I am submitting this in case its deemed useful for inclusion.
Anyone have any comments on this change? This is a patch off current
master.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Use K&R style for curly braces in tests/

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Use K&R style for curly braces in src/xen*/

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Use K&R style for curly braces in src/util/

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Use K&R style for curly braces in src/rpc/

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Use K&R style for curly braces in src/conf/

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Use K&R style for curly braces in src/qemu/

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Use K&R style for curly braces in src/storage/

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Use K&R style for curly braces in src/openvz/

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Use K&R style for curly braces in src/nwfilter/

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Use K&R style for curly braces in src/test/test_driver.c

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Use K&R style for curly braces in src/uml/

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Use K&R style for curly braces in src/lxc/lxc_driver.c

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Use K&R style for curly braces in src/network/bridge_driver.c

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Use K&R style for curly braces in src/vbox/

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Use K&R style for curly braces in remaining files

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>