John Wolfe [Fri, 11 Sep 2020 19:11:04 +0000 (12:11 -0700)]
Replace a bogus URL provided in a vmcheck.c error message.
Previously the URL "http://www.vmware.com/info?id=99" appeared in
an error message in the vmware_checkvm binary to refer to VMware Tools
updating information that may change from one release to the next.
That information is now available from the single VMware Tools URL"
https://docs.vmware.com/en/VMware-Tools/index.html.
John Wolfe [Fri, 11 Sep 2020 19:11:04 +0000 (12:11 -0700)]
Get rid of more vmware_pack files.
gcc supports the Microsoft-style "pragma pack" syntax.
Standardize on it. The conversion is somewhat non-trivial,
as gcc requires "pragma" to be before or after a statement,
not in the middle.
John Wolfe [Fri, 11 Sep 2020 19:11:03 +0000 (12:11 -0700)]
Adding null check for results passed to log function.
In several files, replies/results from RPC functions can possibly be
null if the function fails. This changeset adds a function-like macro
which does the null checks and is applied to the replies when passed
into logging functions.
John Wolfe [Fri, 11 Sep 2020 19:11:03 +0000 (12:11 -0700)]
Ensure the servicediscovery plugin isn't enabled in an open-vm-tools build for non Linux OS.
The servicediscovery plugin is supported only on Linux platforms. This
change checks that this plugin is enabled only if the OS is Linux.
Otherwise, an error message is printed.
John Wolfe [Fri, 11 Sep 2020 19:11:03 +0000 (12:11 -0700)]
Get rid of vmware_pack files (devices edition)
gcc supports the Microsoft-style "pragma pack" syntax.
Standardize on it. The conversion is somewhat non-trivial,
as gcc requires "pragma" to be before or after a statement,
not in the middle.
John Wolfe [Fri, 11 Sep 2020 19:11:02 +0000 (12:11 -0700)]
LOG: Keep the LOG_LEVEL entries sorted
This is the first in a series of changes to the Log Facility that will add
the ability to have domain specific filtering (e.g. foobar domain can have
log calls which are filtered by domain (name) and level). This will make
LOG like abilities usable in all build types, even a release build.
The LOG_LEVEL entries are difficult to find since they are in a jumbled
order. The existing grouping isn't useful as many of the modules are shared.
Create one big sorted list.
John Wolfe [Fri, 11 Sep 2020 19:11:02 +0000 (12:11 -0700)]
Add --cmdfile argument
Some OSes (Windows) have a relatively small cmdline limit.
Expose a cmdfile argument which works like --cmd, but
reads the input from a file. This allows RPCs which can
have huge arguments (guestVars, namespaceDB, DataSets) to work.
John Wolfe [Wed, 19 Aug 2020 17:01:17 +0000 (10:01 -0700)]
Code cleanup to address a Coverity issue.
Coverity reports a "dereference after NULL check" in
BkdoorChannelStart. However, at the point of dereference
it's known that chan->inStarted is TRUE, which means chan->in
is guaranteed to be non-NULL, so it's not a bug.
Still, given that an input channel, if present, must have been
started before calling BkdoorChannelStart, it's possible to do
some code cleanup that will also get Coverity to stop reporting
the issue. Change what's currently a test into an ASSERT, test
chan->in rather than chan->inStarted, and add comments to make
it clearer what's going on.
John Wolfe [Wed, 19 Aug 2020 17:01:17 +0000 (10:01 -0700)]
Implement the Set_option handler in appInfo plugin.
* Add a handler for Set_option in the appInfo plugin.
The poll loop will be immediately turned off when
the feature is turned off at the host side.
The poll loop will be immediately turned on when
the feature is turned on at the host side.
* Add code to handle VM vmotion to an older host that
doesn't have logic to send 'set_option'.
* Fix some miscellaneous issues in the appinfo plugin.
Use the proper @param and @return statements in the
function documentation for AppInfoServerSetOption.
John Wolfe [Wed, 19 Aug 2020 17:01:17 +0000 (10:01 -0700)]
Pick up the LSB distro file for ALT Linux
Improve the documentation of the Linux identification routine so others
know that nothing needs to be changed in the field.
Only VMware needs to add identification codes.
John Wolfe [Wed, 19 Aug 2020 17:01:16 +0000 (10:01 -0700)]
[AppInfo] Tweak the gather loop only for a real config reload.
The poll loop for appInfo is being tweaked (destroyed and recreated)
for every tools.conf reload, even when nothing related to appinfo changed.
This may cause a few scenarios where the 'application information'
will never be collected inside the guest. Tweak the loop only when there
is a real appinfo related config change in the tools.conf file.
John Wolfe [Wed, 19 Aug 2020 17:01:16 +0000 (10:01 -0700)]
Free old ununsed loggers when tools.conf changes.
Existing unused loggers are leaked when there is a change
in logging configuration. Added a check to free the loggers
that are not used after tools.conf is modified.
John Wolfe [Wed, 19 Aug 2020 17:01:16 +0000 (10:01 -0700)]
The SDMP plugin generates a warning message every 5 minutes when there is no
Namespace DB instance created on a VM. Change the log level to
debug to solve the problem.
1. Environment variable 'ALIVE_BASE' is used to construct the path of
the file where vcops version is stored. The variable is not available
when running the script inside serviceDiscovery plugin process, so a
hardcoded path is used.
John Wolfe [Tue, 18 Aug 2020 14:14:12 +0000 (07:14 -0700)]
Remove the guestApp.h header file that is not needed in conf.h
The configuration header file conf.h includes the guestapp header file
guestApp.h, but there are no related references to the guestapp header
file. This change removes the unnecessary header file.
The guestApp.h header file is included in the few source files with
a dependency on it.
John Wolfe [Tue, 18 Aug 2020 14:14:12 +0000 (07:14 -0700)]
[HGFS Server] Add file attributes/symlink check status cache using oplock support
An investigation found that while copying a group of small files from host
to guest using the shared folder, the HGFS_OP_GETATTR_V3 message was handled
in HGFS server 276,140 times over a period of ~35 seconds.
Caching the file attributes in HGFS on the server-side can reduce the time
significantly (from experimental results, 35s => 8s).
It was also discovered that Posix_RealPath is called repeatedly to check
whether a path is a symlink, since HgfsServerGetLocalNameInfo is called when
handling a series of requests.
Integrate a key-value cache to HGFS server to cache the symlink check results
and file attributes, using the file path as the key. This task will be divided
into multiple change:
1. Add oplock support
2. Add a customized LRU cache in HGFS server for file attributes and
symlink check results
- New files:
hgfsCache.h/c: implements a customized LRU cache which is built by
combining two data structures: a doubly linked list and
a hash table.
- The cache will be allocated only when oplock is enabled.
- The cache relies on the file change monitor provided by oplock to ensure
there is no stale data. When adding an entry into the cache, also
register the file change callback to oplock. Upon receiving the file change
callback, invalidate the cache. Once the cache is full, remove the LRU
entry and unregister the file change callback for it.
John Wolfe [Tue, 18 Aug 2020 14:14:11 +0000 (07:14 -0700)]
Define "Unknown Command" Macro to replace hard coded strings in rpc files
This changeset finds all instances of the hardcoded string "Unknown Command"
in a few rpc files and replaces it with a macro defined in a shared header
file.
John Wolfe [Tue, 18 Aug 2020 14:14:11 +0000 (07:14 -0700)]
Fix log recursion issue in DestroyRpcChannel()
Avoid calling g_xxx() logging routines in any function directly or
indirectly invoked from VmxGuestLog(). Change the g_debug() call in
DestroyRpcChannel() to a Debug() call.
John Wolfe [Tue, 18 Aug 2020 14:14:10 +0000 (07:14 -0700)]
Adding vmtools library dependency to deploypkg library
Some functions are not found in shared libraries when linking,
which generates several warnings. Added a library with
the needed functions to the list of dependencies.
John Wolfe [Fri, 7 Aug 2020 19:03:26 +0000 (12:03 -0700)]
Address some Log spew for toolsdeployPkg.log
1. Remove the extra '\n' at the tail of logging messages in imgcust.
2. Update the log printting function, do not add '\n' if the original
log message has already included it.
John Wolfe [Fri, 7 Aug 2020 19:03:24 +0000 (12:03 -0700)]
[HGFS Server] Support oplock inside HGFS server for Windows host
The motivation for this change is to cache file/directory related information
in host side, for example the file/directory attributes. To make the cache
correct, we will use the oplock(Windows)/lease(Linux) to monitor the
file/directory change event. When the file/directory changes, the item in
cache will be invalidated.
In this change, two new functions are defined:
- HgfsOplockMonitorFileChange
This function is used to monitor the change event for a file/directory,
and the callback will be called if file/directory is changed.
- HgfsOplockUnmonitorFileChange
This function is used to cancel the change event monitoring.
This patch only implements the oplock support for Windows host, the support
for Linux will be delivered in another patch.