Make disk free space reporting consistent with Linux 'df' command.
On Linux, statfs syscall reports free space in two fields.
From http://man7.org/linux/man-pages/man2/statfs.2.html:
1. f_bfree => Free blocks in filesystem
2. f_bavail => Free blocks available to unprivileged user
For file systems that maintain reserved space for system
activities f_bfree > f_bavail because f_bfree includes the
reserved space in the file system. The reserved space is
typically 5% for 'ext4' file systems. Newer distros like
RHEL 7.x use 'xfs' by default and report same value for
both the fields.
The Linux 'df' command uses f_bavail in its reporting.
Tools reports, conditionally, f_bfree for root and f_bavail
for non-root. However, since vmtoolsd runs as root, Tools
always reports f_bfree, which is more free space than 'df'
would report (depending on amount of reserved space).
In order to be consistent with Linux 'df' command,
report f_bavail as the disk free space by default. This does
change the behavior a little bit in that Tools will report less
disk free space than before, the difference being the same as
the reserved space on the file system, typically 5%. This
should be OK in general because it makes the space reporting
a bit conservative. If this change in behavior is not desired
for some use cases, the old behavior can be restored by setting
the following newly added configuration in this change:
[guestinfo]
diskinfo-include-reserved=true
The existing callers that are outside the guestInfo plugin
will continue to include reserved space in their space
accounting as before.
Also fixed a few minor stuff/touchups in vmtoolsConfig.c.