Oliver Kurth [Tue, 27 Aug 2019 19:55:38 +0000 (12:55 -0700)]
More Coverity annotations for open-vm-tools.
Add Coverity annotations for four additional issues so that Coverity
scans of open-vm-tools will automatically classify these issues as
"intentional." Such annotations are useful both for internal use as
well as for partners who run Coverity scans of open-vm-tools.
Oliver Kurth [Tue, 27 Aug 2019 19:55:37 +0000 (12:55 -0700)]
Add more Coverity annotations to open-vm-tools source.
Add Coverity annotations for three issues so that Coverity scans of
open-vm-tools will automatically classify these issues as
"Intentional." These annotations are useful both for internal
use as well as for partners who run Coverity scans on open-vm-tools.
Oliver Kurth [Tue, 27 Aug 2019 19:55:37 +0000 (12:55 -0700)]
Get rid of PhysMem's thread registration calls for most threads.
A previous change eliminated the need to register threads before doing
a PPN to BPN conversion on them. This change removes some of the
remaining infrastructure.
Oliver Kurth [Tue, 27 Aug 2019 19:55:37 +0000 (12:55 -0700)]
Address Coverity issues reported in bora/lib/file/file.c.
Fix a minor memory leak in the function File_ExpandAndCheckDir.
Also add annotations for unchecked return values in functions
GetOldMachineID and File_MoveTree, so that Coverity scans of
open-vm-tools will automatically classify these issues as
"Intentional". These annotations are useful both for internal
use as well as for partners who run Coverity scans on open-vm-tools.
Oliver Kurth [Tue, 27 Aug 2019 19:55:36 +0000 (12:55 -0700)]
Bool type may not be a char (1 bytes).
Change structures exposed to the guest to not use Bool -
- while currently Bool is defined as char, we might use C's
_Bool or C++'s bool for booleans - and neither standard
mandates _Bool/bool to be 1 byte.
Oliver Kurth [Tue, 27 Aug 2019 19:55:35 +0000 (12:55 -0700)]
Add Coverity annotations.
Add source code annotations so that Coverity scans will automatically
classify certain issues as "intentional." These annotations serve to
memorialize these classifications in open-vm-tools source, both for
internal reference as well as for partners like Red Hat who run their
own Coverity scans on open-vm-tools.
Oliver Kurth [Mon, 5 Aug 2019 18:22:00 +0000 (11:22 -0700)]
Avoid freezing mount points for same device.
Loopback device setup could cause a cyclic dependency
between 2 mount points. In order to break the cycle,
avoid freezing the mount points to the same device.
This change also skips some system mount points for 'tmpfs'
and 'cgroup' etc as those share the same device/FS name.
This is fine because we can't quiese those mount points
anyway (system mount points don't support quiescing).
Oliver Kurth [Fri, 2 Aug 2019 18:07:21 +0000 (11:07 -0700)]
Bumping HGFS_LARGE_IO_MAX_PAGES to 127 and defining the legacy values
This change bumps up HGFS_LARGE_IO_MAX_PAGES to 127 and define the
legacy values of HGFS_LARGE_IO_MAX_PAGES, HGFS_LARGE_IO_MAX and
HGFS_LARGE_PACKET_MAX. A switch is also added to make sure we still
use the legacy value unless "hgfs.packetSize.large" is set to "TRUE" in vmx.
Oliver Kurth [Fri, 2 Aug 2019 18:07:21 +0000 (11:07 -0700)]
Avoid freezing mount points for same device.
Loopback device setup could cause a cyclic dependency
between 2 mount points. In order to break the cycle,
avoid freezing the mount points to the same device.
This change also skips some system mount points for 'tmpfs'
and 'cgroup' etc as those share the same device/FS name.
This is fine because we can't quiese those mount points
anyway (system mount points don't support quiescing).
Oliver Kurth [Fri, 2 Aug 2019 18:07:20 +0000 (11:07 -0700)]
Remove residual data when the DNS nameserver configuration changes.
If the list of DNS nameservers available should shorten or both IPv4 and
IPv6 entries are present, residual data can still be available for display.
This change to nicInfoPosix.c corrects the problem.
Oliver Kurth [Sun, 21 Jul 2019 00:15:19 +0000 (17:15 -0700)]
Make DEBUG_ONLY work with toplevel commas (Change part 3)
Now that all the C pre-processors in use support variadic macros, make
DEBUG_ONLY work with toplevel commas (i.e. commas which are outside of
any parentheses pair). This is useful in at least 2 ways:
In C code, to easily pass debug arguments to functions in debug builds
without any overhead in non-debug builds.
void
foo(DEBUG_ONLY(int debugArg,) // IN
int nonDebugArg) // IN
{
ASSERT(DebugFunc(debugArg));
NonDebugFunc(nonDebugArg);
}
Oliver Kurth [Sun, 21 Jul 2019 00:15:19 +0000 (17:15 -0700)]
Use two new inline functions to replace most of the uses of
HGFS_LARGE_IO_MAX and HGFS_LARGE_PACKET_MAX macros.
In preparation to bump up HGFS_LARGE_IO_MAX and HGFS_LARGE_PACKET_MAX,
replace most uses of the two macro constants with inline functions that
can return either the new limits or the older defaults based on the
configuration.
Oliver Kurth [Sun, 21 Jul 2019 00:15:18 +0000 (17:15 -0700)]
Avoid emitting a trailing comma in the GuestInfoSendDiskInfoV1 JSON RPC
Although currently accepted by the JSMN library that we are using
in VMX, that superfluous comma is strictly invalid according to the
JSON standard - ECMA-404.
Oliver Kurth [Sun, 21 Jul 2019 00:03:42 +0000 (17:03 -0700)]
Avoid emitting a trailing comma in the GuestInfoSendDiskInfoV1 JSON RPC
Although currently accepted by the JSON library that we are using
in VMX, that superfluous comma is strictly invalid according to the
JSON standard - ECMA-404.