]> git.ipfire.org Git - thirdparty/open-vm-tools.git/log
thirdparty/open-vm-tools.git
16 years agobit functions: an easy change
VMware, Inc [Thu, 17 Jun 2010 21:20:59 +0000 (14:20 -0700)] 
bit functions: an easy change

These are trivial and easy changes.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoStart using the new, unambiguous and consistent bit functions
VMware, Inc [Thu, 17 Jun 2010 21:20:49 +0000 (14:20 -0700)] 
Start using the new, unambiguous and consistent bit functions

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoConsistent, unambiguous, non-colliding bit function names
VMware, Inc [Thu, 17 Jun 2010 21:20:34 +0000 (14:20 -0700)] 
Consistent, unambiguous, non-colliding bit function names

We don't have complete set of find most/least significant bit
set functions available throughout the source base. Create them.

I created these functions by taking the monitor's complete set of
functions, moving them to vm_basic_asm.h and renaming them such that
they have consistent, unambiguous names that don't collide with ANSI,
Linux or MacOS functions or differ in data types. The immediately
problematic functions were ffs, fls, ffsl, flsl and fls64.

Here is a table to assist with reviewing the change:

NAME      FUNCTION               BITS          ON ZERO    MONITOR NAME
-----     --------               ----          -------    ------------
lssb32    LSB set (uint32)       1..32         0          ffs
lssb32_0  LSB set (uint32)       0..31         -1         ffs0
lssb64    LSB set (uint64)       1..64         0          ffs64
lssb64_0  LSB set (uint64)       0..63         -1
lssbPtr   LSB set (uintptr_t)    1..32|64      0          ffsl
lssbPtr_0 LSB set (uintptr_t)    0..31|63      -1         ffs0l
mssb32    MSB set (uint32)       1..32         0          fls
mssb32_0  MSB set (uint32)       0..31         -1         fls0
mssb64    MSB set (uint64)       1..64         0          fls64
mssb64_0  MSB set (uint64)       0..63         -1
mssbPtr   MSB set (uintptr_t)    1..32|64      0          flsl
mssbPtr_0 MSB set (uintptr_t)    0..31|63      -1         fls0l

This change is the first of several. It establishes the functions and
make one use of them in an obvious, easy place.

I'll start converting the source base to use these functions in pieces.
The monitor will be the last piece touched and there I'll demonstrate
no size or performance changes - and correctness too.

In the end the entire source base will be using the one consistent set
of bit functions.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agolib/lock: add RW lock singleton function
VMware, Inc [Thu, 17 Jun 2010 21:20:09 +0000 (14:20 -0700)] 
lib/lock: add RW lock singleton function

The exclusive and recursive locks have a singleton function...

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Thu, 17 Jun 2010 21:19:54 +0000 (14:19 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoLet hgfsServer use MXUser locks directly
VMware, Inc [Thu, 17 Jun 2010 21:19:02 +0000 (14:19 -0700)] 
Let hgfsServer use MXUser locks directly

hgfsServer avoided pulling in MXUser locks when VMTOOLS_USE_GLIB was set.
Mark Bellon put together a change to split MX and MXUser locks so MXUser
can be used in tools.  This follow-on change lets hgfsServer use MXUser
locks directly.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoUpper-bound some gcc workarounds in public/vm_basic_*
VMware, Inc [Thu, 17 Jun 2010 21:18:23 +0000 (14:18 -0700)] 
Upper-bound some gcc workarounds in public/vm_basic_*

Put an upper bound on a few gcc workarounds.
vm_basic_defs.h / GetFrameAddr()
See bug 554369 for details; this bug was fixed in gcc-4.2.0,
so apply that upper bound.
vm_basic_types.h / INLINE_SINGLE_CALLER
Verified that it occurs for gcc-4.4.3.  This attribute is
now well-documented; it is no longer necessary to check
at each compiler bump.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoBump tools version.
VMware, Inc [Thu, 17 Jun 2010 21:17:58 +0000 (14:17 -0700)] 
Bump tools version.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Thu, 17 Jun 2010 21:17:42 +0000 (14:17 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agovmmemctl: use Solaris kernel native ASSERT
VMware, Inc [Thu, 17 Jun 2010 21:17:24 +0000 (14:17 -0700)] 
vmmemctl: use Solaris kernel native ASSERT

Do not include vm_assert.h in the kernel driver code and instead
rely on kernel-provided ASSERT (which does not require Panic()
and others).

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Thu, 17 Jun 2010 21:17:12 +0000 (14:17 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agolib/lock: missed a few pieces for tools usage
VMware, Inc [Thu, 17 Jun 2010 21:16:53 +0000 (14:16 -0700)] 
lib/lock: missed a few pieces for tools usage

Adding lib/lock to the tools build didn't quite have all of the
pieces necessary. Here are the rest...

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoTry to alloc from lower 4GB rather than lower 16 MB
VMware, Inc [Thu, 17 Jun 2010 21:16:33 +0000 (14:16 -0700)] 
Try to alloc from lower 4GB rather than lower 16 MB

Could call pci_set[consistent_]_dma_mask but the defaults
already seem to fit what vmxnet supports and I have no
idea when these functions first appeared in the kernel.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoUse new print functions in remaining toolbox cli commands, add i18n.
VMware, Inc [Thu, 17 Jun 2010 21:14:27 +0000 (14:14 -0700)] 
Use new print functions in remaining toolbox cli commands, add i18n.

. use ToolsCmd_Print / ToolsCmd_PrintErr everywhere they make sense, to
make the "quiet" flag consistent.
. i18n'ize all user-visible messages (except the ones coming from external
libraries).
. all commands that have boolean output can have the output suppressed, and
the status can be figured out from the exit value (EXIT_SUCCESS for TRUE,
EX_UNAVAILABLE for FALSE).
. fix stat command error messages which all printed the same thing.
. a few minor stylistic changes to messages.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoDon't crash when reconfiguring file log handler.
VMware, Inc [Thu, 17 Jun 2010 21:14:06 +0000 (14:14 -0700)] 
Don't crash when reconfiguring file log handler.

The log code has a log statement that prints info about the core dump
config; when using the file handler, and swithing between "no logging"
and "log enabled", the new log data would then open the log file; later,
when restoring the previous log config, that would cause an assert.

Fix is easy: just change the order in which those things are done.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoFix crash when log domain has no level configured.
VMware, Inc [Thu, 17 Jun 2010 21:13:54 +0000 (14:13 -0700)] 
Fix crash when log domain has no level configured.

Sourceforge bug:
https://sourceforge.net/tracker/?func=detail&atid=989708&aid=2994264&group_id=204462

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Thu, 17 Jun 2010 21:13:38 +0000 (14:13 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agolib/lock: propogate rank inform when binding to MX
VMware, Inc [Thu, 17 Jun 2010 21:13:15 +0000 (14:13 -0700)] 
lib/lock: propogate rank inform when binding to MX

The binding MX to MXUser functions need to propogate the rank
information into the MXUser lock header since the MXUser
"get the rank" function takes the rank information from there.
Some code gets the rank (for asserts and other sundry things)
from the MX lock directly and some from the MXUser lock.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoFix open-vm-tools compilation.
VMware, Inc [Thu, 17 Jun 2010 21:12:49 +0000 (14:12 -0700)] 
Fix open-vm-tools compilation.

Looks like this code was triggering a bug in some GCC versions. Work
around it. Also avoid two format string-related warnings.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoChange Linux kernel version check to 2.6.32 to fix build error.
VMware, Inc [Thu, 17 Jun 2010 21:12:27 +0000 (14:12 -0700)] 
Change Linux kernel version check to 2.6.32 to fix build error.

While creating PBMs for Ubuntu 10.04 RC, which is a 2.6.32-21.32
kernel, we were getting a compile-time error due to type mismatch
for the setsockopt prototype. An earlier change to this file assumed
that the error would occur on 2.6.34 or later, but in fact it is
a problem starting with 2.6.32-rc3.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoFix the build
VMware, Inc [Thu, 17 Jun 2010 21:12:05 +0000 (14:12 -0700)] 
Fix the build

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agolib/lock: press for a harder MX/MXUser separation
VMware, Inc [Thu, 17 Jun 2010 21:11:54 +0000 (14:11 -0700)] 
lib/lock: press for a harder MX/MXUser separation

Since there is a function for MX to register hook functions with
MXUser, enhance it to provide additional function that allow
removing even more MX references throughout MXUser.

This change makes it possible to expose the bind MX to MXUser
functionality to userland - we can use that functionality outside
the VMX now.

The mutex.h and userlock.h include files are tweaked so that things
work properly if either of them comes first and the userlock.h file
is able to stand on its own inside and outside the VMX.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agolib/lock: assertion failure
VMware, Inc [Thu, 17 Jun 2010 21:10:57 +0000 (14:10 -0700)] 
lib/lock: assertion failure

The new hook function implanting function caught a panic when it
was invocated a second time. Make the function tolerate multiple
invocations, only panicing if the later invocations attempt to
plant hook functions different than the first time.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Thu, 17 Jun 2010 21:10:13 +0000 (14:10 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoFix tinderbox: missing includes.
VMware, Inc [Thu, 17 Jun 2010 21:06:24 +0000 (14:06 -0700)] 
Fix tinderbox: missing includes.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoMake code use new shared definitions from tclodefs.h.
VMware, Inc [Thu, 17 Jun 2010 21:06:14 +0000 (14:06 -0700)] 
Make code use new shared definitions from tclodefs.h.

Better than hardcoding the same string in several different places.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoAdd auto-upgrade command to toolbox CLI.
VMware, Inc [Thu, 17 Jun 2010 21:05:56 +0000 (14:05 -0700)] 
Add auto-upgrade command to toolbox CLI.

This change adds a new "upgrade" command to the toolbox CLI on Win32 and
Linux (non-open-vm-tools), which are the only platforms where we have
auto-upgrade.

Add a few utility functions to the common toolbox CLI code to do a few
useful things:
. print messages based on the status of the "quiet" flag.
. send RPCs to the host using the RpcChannel API.

On top of that, put some common definitions of commands and replies in a
shared header to avoid having duplicated strings in different parts of the
source code.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agolib/lock: make the userland portion available for tools
VMware, Inc [Thu, 17 Jun 2010 21:05:13 +0000 (14:05 -0700)] 
lib/lock: make the userland portion available for tools

We're using MXUser (userland) locks all over bora/lib. Some of these
libraries are showing up in the open source tools build. Make only
the MXUser portion of lib/lock available to the tools. We're OK with
open sourcing this.

Once this change goes in bora/lib changes that depend on it will
start showing up almost immediately.

I've elected to a a minimumally invasive approach to ulRec.c, one
that optimized out the conditional for acquisition and release
(by far the largest usage) and leaving the farless used TryLock
and IsLocked routines using the same conditional as before this
change.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoOVT: detect presence of procps-3.2.8
VMware, Inc [Thu, 17 Jun 2010 21:04:35 +0000 (14:04 -0700)] 
OVT: detect presence of procps-3.2.8

3.2.8 is the latest version of the package and distributions are
switching to it. While it is impractical to have configure script
test for every version of the package, testing for 2 latest
versions should be OK.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoOVT: allow compiling against libpng 1.4
VMware, Inc [Thu, 17 Jun 2010 21:04:21 +0000 (14:04 -0700)] 
OVT: allow compiling against libpng 1.4

Direct usage of png_ptr->jmpbuf, which had been deprecated in
libpng 1.0.6, finally produces compile error when using libpng 1.4;
we need to use png_jmpbuf() instead.

This is import of a patch from Dominique Leuenberger
<Dominique.Leuenberger@tmf-group.com> who has a signed contribution
agreement with VMware.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Thu, 17 Jun 2010 21:02:51 +0000 (14:02 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Thu, 17 Jun 2010 21:02:34 +0000 (14:02 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Thu, 17 Jun 2010 21:02:02 +0000 (14:02 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Thu, 17 Jun 2010 21:01:47 +0000 (14:01 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoFix packet header validation.
VMware, Inc [Thu, 17 Jun 2010 21:01:22 +0000 (14:01 -0700)] 
Fix packet header validation.

Validation assumes that all HGFS V4 requests must come with V4 header and
all HGFS V3 requests come with V3 headers.
At the moment it is not true for FAST_READ_V4/FAST_WRITE_V4. Besides V3 requests
may come with V4 headers.
Fixing validation function to remove assumption that header type depends on
operation and use explicit information about header version instead.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Thu, 17 Jun 2010 21:01:05 +0000 (14:01 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoThread fixes for Hostinfo_MachineID
VMware, Inc [Thu, 17 Jun 2010 20:59:46 +0000 (13:59 -0700)] 
Thread fixes for Hostinfo_MachineID

Hostinfo_MachineID caches its results.  Make the cache atomic.
This uses atomic pointers because zero is a valid value for both
the name hash and hardware ID.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agothread fixes for gmtime and localtime in bora/lib
VMware, Inc [Thu, 17 Jun 2010 20:59:25 +0000 (13:59 -0700)] 
thread fixes for gmtime and localtime in bora/lib

Change gmtime and localtime calls to the _r versions.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoUpdating open-vm-tools version for release 2010.04.25-253928. 2010.04.25-253928
Marcelo Vanzin [Tue, 27 Apr 2010 03:50:45 +0000 (20:50 -0700)] 
Updating open-vm-tools version for release 2010.04.25-253928.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoUnity,GHI/X11: Attempt better mapping of "window" paths to executables.
VMware, Inc [Mon, 26 Apr 2010 18:42:50 +0000 (11:42 -0700)] 
Unity,GHI/X11: Attempt better mapping of "window" paths to executables.

GHI/X11's unity.get.window.path handler was flawed w.r.t. its
intended purpose in that it may frequently return a path of no use
to the host.  As an example, while a Firefox window belongs to the
executable installed at /usr/lib/firefox-3.6.3/firefox-bin, knowing
the latter does us no good, because the binary is meant to be started
from a wrapper script rather than executed directly.

This change introduces some fuzzing whereby vmware-user will try to
associate plain pathnames with their regular GHI menu item entries.
Put differently, when the host UI asks for the window path of a
random Firefox window, instead of returning

file:///usr/lib/firefox-3.6.3/firefox-bin (busted)

we'll return

file:///usr/bin/firefox?DesktopEntry=%2fusr%2fshare%2fapplications%2ffirefox.desktop

When the host UI then uses the latter path to launch Firefox (say,
from a docker [Fusion] or pinned start menu item [Workstation for
Windows]), it will provide enough information to vmware-user to use
the correct launcher.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Mon, 26 Apr 2010 18:42:17 +0000 (11:42 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoFix open-vm-tools build on FreeBSD.
VMware, Inc [Mon, 26 Apr 2010 18:41:54 +0000 (11:41 -0700)] 
Fix open-vm-tools build on FreeBSD.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoRefactor toolbox-cmd command handling.
VMware, Inc [Mon, 26 Apr 2010 18:41:44 +0000 (11:41 -0700)] 
Refactor toolbox-cmd command handling.

This is mostly a mechanical change to have the sources better organized.
The change moves the command / help handlers to the command-specific
source files, so that there is a clear interface between the main()
function and the command handlers, and also so that it's less messy to
add new commands.

On top of that, a couple of minor issues (missing parameters to vararg
calls) were fixed, and the translations were updated to match the new
help messages (which have the command as a parameter, instead of hardocded
in the message).

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoFix copyrights in tools-for-linux
VMware, Inc [Mon, 26 Apr 2010 18:41:18 +0000 (11:41 -0700)] 
Fix copyrights in tools-for-linux

This CSet updates the copyright markings in tools-for-linux
to 2010

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoChange lib/file to use Posix_Getmntent_r for I18n and thread-safety.
VMware, Inc [Mon, 26 Apr 2010 18:40:54 +0000 (11:40 -0700)] 
Change lib/file to use Posix_Getmntent_r for I18n and thread-safety.

lib/file calls the thread-unsafe getmntent.  It also ignores the
local I18N encoding.  Change it to call Posix_Getmntent_r, which
takes care of both problems.  On UTF-8 based systems, our Posix
variant is defined to the underlying getmntent_r call, so check
for cases where the supplied buffer is exhausted.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Mon, 26 Apr 2010 18:40:34 +0000 (11:40 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agomulti thread fix for evct and fcvt use in bsd printf
VMware, Inc [Mon, 26 Apr 2010 18:40:14 +0000 (11:40 -0700)] 
multi thread fix for evct and fcvt use in bsd printf

Can't use mxuser locks for this because they'll pull in lib/lock
all over the place.  On Windows use the thread-safe functions _ecvt_s
and _fcvt_s instead of having to dynamically allocate a mutex.
There are thread-safe versions for Linux, too, ecvt_r and fcvt_r,
but they are not available on Mac.  Since there was going to be a
mutex in this code for Mac, might as well use it for Linux, too.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoPower scripts: Refactor as PI statechange.sh and PD network scripts. [2/2]
VMware, Inc [Mon, 26 Apr 2010 18:39:38 +0000 (11:39 -0700)] 
Power scripts: Refactor as PI statechange.sh and PD network scripts. [2/2]

This is a follow-up to my previous change whereby the packaging
targets are updated to consume the new scripts.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoFix vmhgfs-local target to reflect vmci dependency.
VMware, Inc [Mon, 26 Apr 2010 18:33:01 +0000 (11:33 -0700)] 
Fix vmhgfs-local target to reflect vmci dependency.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoFail more gracefully on unrecognized I18N encodings
VMware, Inc [Mon, 26 Apr 2010 18:31:44 +0000 (11:31 -0700)] 
Fail more gracefully on unrecognized I18N encodings

Unicode_Init has a check for unsupported local character encodings,
but the code that prints the unsupported encoding name calls
Unicode_EncodingEnumToName(), which assumes that the enum passed
into it is valid.  Since the encoding name wasn't found, the enum
is STRING_ENCODING_UNKNOWN, which results in a not particularly
graceful or informative NOT_REACHED() down inside lib/unicode.
The fix is to use the string that codeset gave us instead of
trying to convert STRING_ENCODING_UNKNOWN back into an encoding
name.  Also add an ASSERT to Unicode_EncodingEnumToName() to
check that STRING_ENCODING_UNKNOWN is not passed to it.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years ago[RC Fix] Fix bug 548177.
VMware, Inc [Mon, 26 Apr 2010 18:31:16 +0000 (11:31 -0700)] 
[RC Fix] Fix bug 548177.

When user deletes a share on the host, nautilus (ubuntu file manager)
does not like us sending -EIO on a share. We detect this error and map
it to success and create minimal fake attributes.

In future we this client will this mask new error codes that we add to
the server as well, which is sad.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoA few changes to make Tools more test-friendly.
VMware, Inc [Mon, 26 Apr 2010 18:30:24 +0000 (11:30 -0700)] 
A few changes to make Tools more test-friendly.

. tweak vmtoolsd so that it allows any container name when running in
debug mode (GuestRPC is still restricted to the two "blessed" names).
Also fix the hgfsServer plugin to handle the debug case without
crashing.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Mon, 26 Apr 2010 18:29:57 +0000 (11:29 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Mon, 26 Apr 2010 18:29:22 +0000 (11:29 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoVMCI support for Windows client.
VMware, Inc [Mon, 26 Apr 2010 18:28:24 +0000 (11:28 -0700)] 
VMCI support for Windows client.

Implementing VMCI support for HGFS Windows redirector.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agovmballoon: switch to using DblLnkList
VMware, Inc [Mon, 26 Apr 2010 18:27:06 +0000 (11:27 -0700)] 
vmballoon: switch to using DblLnkList

Instead of creating homegrown double-linked-list implementation use the
standard one provided by dbllnklst.h

Also throw in some formatting changes and remove the logic preventing
reinitialization - we are a kernel driver and should know better whether
we called init or not.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoFix renames across volumes for HGFS Windows guests
VMware, Inc [Mon, 26 Apr 2010 18:26:50 +0000 (11:26 -0700)] 
Fix renames across volumes for HGFS Windows guests

For non-Windows hosts, the HGFS server will not be able to
handle cross volume renames returning the error
HGFS_STATUS_GENERIC_ERROR. A new error should be returned and
mapped to the Windows system status STATUS_NOT_SAME_DEVICE
and EXDEV by the guest file system client. This will cause
the application (Windows Explorer, Posix mv) to break the move
file operation into a copy and delete file operations.

Windows HGFS server does not currently return this error at
all, and furthermore, handles the cross volume rename
operations internally. However, since non-Windows hosts and
guests both use the new HGFS_STATUS_NOT_SAME_VOLUME error
for this rename error, the Windows server could be later modified
to return this too for consistency and then all guest clients
can let the guest application handle it accordingly.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agolib/file: comment cleanups
VMware, Inc [Mon, 26 Apr 2010 18:26:35 +0000 (11:26 -0700)] 
lib/file: comment cleanups

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agolib/file: general cleanup
VMware, Inc [Mon, 26 Apr 2010 18:26:19 +0000 (11:26 -0700)] 
lib/file: general cleanup

Some comment and message cleanup, nothing serious.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agovmbackup: add null provider, do late initialization of sync provider.
VMware, Inc [Mon, 26 Apr 2010 18:26:11 +0000 (11:26 -0700)] 
vmbackup: add null provider, do late initialization of sync provider.

This change adds a null provider so that systems that don't have
either VSS nor the sync driver (or have them disabled) can still execute
at least backup scripts when taking a quiesced snapshot. This should
bring feature parity to the previous quiesced snapshot approach, which
would use the VIX path if the vmbackup protocol wasn't supported by
the Tools.

Also initialize the sync provider late, only when starting a backup
operation. This allows the users to change the Tools configuration
and not have to restart the Tools service to get the new settings,
making it easier to switch between VSS / sync driver / null provider.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agolib/file: add parameter comments
VMware, Inc [Mon, 26 Apr 2010 18:25:33 +0000 (11:25 -0700)] 
lib/file: add parameter comments

Some function parameter clean ups.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agolib/file: clean up
VMware, Inc [Mon, 26 Apr 2010 18:25:23 +0000 (11:25 -0700)] 
lib/file: clean up

Remove evil tabs, clarify a comment, add an assert.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoFix the Tools build.
VMware, Inc [Mon, 26 Apr 2010 18:25:16 +0000 (11:25 -0700)] 
Fix the Tools build.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agosuidWrapper: Ignore SIGUSR1, SIGUSR2.
VMware, Inc [Mon, 26 Apr 2010 18:25:07 +0000 (11:25 -0700)] 
suidWrapper: Ignore SIGUSR1, SIGUSR2.

Ubuntu 9.10+'s Upstart may result in the services script and
vmware-user launching concurrently.  When this happens, the services
script may deliver SIGUSR1 and/or SIGUSR2 to vmware-user while it's
still executing inside the suidWrapper or appLoader.  Neither were
handling SIGUSR1/2, and so they'd terminate.

This change sets the handler to SIG_IGN for these signals.
Note that SIG_IGN persists across fork() and execve(), so we
don't need to block the handles again inside the appLoader driver
(toolbox/linux/vmwareuser/loader).

As a setuid application, classically we avoided pulling in other
libraries, but the vmsignal library is safe.  It's tiny and doesn't
use bora/bora-vmsoft at all, so its use here is okay.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agolib/misc: use a proper context for Random_Quick
VMware, Inc [Mon, 26 Apr 2010 18:24:30 +0000 (11:24 -0700)] 
lib/misc: use a proper context for Random_Quick

The Random_Quick context pointer is "void *" when it should be
"struct rqContext *". Use the not having to define the structure
trick so as to not expose the contents of the context.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agolib/misc: fix function name
VMware, Inc [Mon, 26 Apr 2010 18:24:12 +0000 (11:24 -0700)] 
lib/misc: fix function name

An RNG was added without the appropriate prefix. Fix this.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agolib/file: pick up some review comments
VMware, Inc [Mon, 26 Apr 2010 18:23:57 +0000 (11:23 -0700)] 
lib/file: pick up some review comments

Picking up a few review comments from the last lib/file change
review.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Mon, 26 Apr 2010 18:23:48 +0000 (11:23 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agolib/file: fix the build
VMware, Inc [Mon, 26 Apr 2010 18:23:32 +0000 (11:23 -0700)] 
lib/file: fix the build

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoFix the build
VMware, Inc [Mon, 26 Apr 2010 18:23:25 +0000 (11:23 -0700)] 
Fix the build

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agolib/file: fix a spelling mistake
VMware, Inc [Mon, 26 Apr 2010 18:23:16 +0000 (11:23 -0700)] 
lib/file: fix a spelling mistake

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agolib/file: tolerate Windows better
VMware, Inc [Mon, 26 Apr 2010 18:23:04 +0000 (11:23 -0700)] 
lib/file: tolerate Windows better

Windows doesn't have a way of being deterministically correct
when handling files as some file operations may return a "busy"
even when not no thread/process is operating on the targetted
file. This is due to the parent directory being used by another
thread/process at the time of the file operation.

The only recourse is to retry. The good news is these problems
are rare. Unfortunately we're seeing more of this on Vista++ than
in the past.

The old code did a fixed number of retries while it slightly
wobbled the amount of time slept between retries to try to
fight its way through these kinds of problems. This proved
insufficient.

The new way is to fully wobble the retries, using a highly variable
sleep duration after a failed attempt and bounding the retries based
on the total time waited rather than a fixed retry count.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agolib/misc: cleanup
VMware, Inc [Mon, 26 Apr 2010 18:22:47 +0000 (11:22 -0700)] 
lib/misc: cleanup

code standard cleanup

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoopen-vm-tools: fix Solaris/FreeBSD hgfs module compilation.
VMware, Inc [Mon, 26 Apr 2010 18:22:36 +0000 (11:22 -0700)] 
open-vm-tools: fix Solaris/FreeBSD hgfs module compilation.

Need to add vmk_exports.h (needed by sha1.c). Also remove duplication of
the sha1 sources.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agolib/file: pretty up structures
VMware, Inc [Mon, 26 Apr 2010 18:22:16 +0000 (11:22 -0700)] 
lib/file: pretty up structures

Silly alignment of variables...

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoHGFS node cache from causing the VMX to go into an infinite loop
VMware, Inc [Mon, 26 Apr 2010 18:22:02 +0000 (11:22 -0700)] 
HGFS node cache from causing the VMX to go into an infinite loop

If the HGFS server node cache becomes full and all the nodes are
of the type that cannot be foreclosed and so cannot be removed
the removal goes into an infinite loop.

Fix it by only checking the number of entries in the list and then
exiting with failure.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoPower Scripts: Refactor power-off, power-on default scripts.
VMware, Inc [Mon, 26 Apr 2010 18:21:41 +0000 (11:21 -0700)] 
Power Scripts: Refactor power-off, power-on default scripts.

The default power-off and power-on scripts are identical across all of
the POSIXy platforms, so there's no need to have a separate instance for
each.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoUnity/X11: Ignore decoration widget windows.
VMware, Inc [Mon, 26 Apr 2010 18:21:23 +0000 (11:21 -0700)] 
Unity/X11: Ignore decoration widget windows.

KDE 4's kwin provides decoration windows by creating independent windows
of _NET_WM_WINDOW_TYPE_NORMAL and reparenting them to a top-level/frame
window.  This window and the application's client window become siblings.

The problem is that Unity/X11 never had this case in mind.  Whenever we
saw a new top-level window, we expected it to either (a) stay as a top-
level window / become an override-redirect window, or (b) be reparented
to a different window and receive the WM_STATE property (which identifies
*this* window as the client window).

Usually a window manager would create its decorations immediately as
children of the frame window, not graft the decorations into the frame's
tree.  This caused Unity/X11 to treat these windows independently,
expecting them to eventually become a client window.  This might not
normally be a problem, but as window coordinates are relative to one's
parent, Unity/X11 thought these windows' coordinates were relative to the
root window rather than some regular frame window.

A correct fix for this would be to associate this window and its frame,
such that once the frame is ever associated with a client window, any
remaining client window "candidates" would be ignored.  (They are, after
all, unimportant children of the frame.  The only child relevant to us
is the application's client window.)  Unfortunately I don't have enough
time to work on that, so I'm instead sticking in a safe hack in order
to meet C&C RC stability requirements.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Mon, 26 Apr 2010 18:20:09 +0000 (11:20 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Mon, 26 Apr 2010 18:17:35 +0000 (11:17 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoLinux Guest driver support for VMCI doorbell notifications
VMware, Inc [Mon, 26 Apr 2010 18:17:02 +0000 (11:17 -0700)] 
Linux Guest driver support for VMCI doorbell notifications

This change introduces three new functions to the VMCI guest
kernel API dealing with the HW v8 support for doorbell
notifications. The actual implementation of these doorbell
calls are embedded in a new notification module, that handles
allocating notification bitmap indexes,
registration/unregistration of callbacks for a given index,
and firing the handlers for a given index.

The Linux device initialization now opts in to use
notification, if the hardware supports it.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoUnity/X11: Work area struts are [x1,x2) and [y1,y2).
VMware, Inc [Mon, 26 Apr 2010 18:16:40 +0000 (11:16 -0700)] 
Unity/X11: Work area struts are [x1,x2) and [y1,y2).

The region code defines a 25x25 rectangle with its upper left corner
at the origin as (x1,x2,y1,y2) = (0,25,0,25); upper bounds are
exclusive.  However, the strut code works with inclusive coordinates,
so we should instead use (0,24,0,24).  Without doing this, we run
into problems.

Consider a multihead setup of 2 displays at 1600x1200 in a horizontal
configuration.  There should be a single 25px top strut attached to the
left display.  By adding a pixel, we have a strut that ranges from
[0,1600], occupying a single pixel on the right display.  The guest will
now reserve the top 25px on the right display while the host does not.

Should someone maximize a window on that display, the guest places
the window's upper left corner at (0,25) while the host places it at
(0,0), and all hell breaks loose.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agorpctool: exit with failure if RPC command failed.
VMware, Inc [Mon, 26 Apr 2010 18:15:52 +0000 (11:15 -0700)] 
rpctool: exit with failure if RPC command failed.

Some recent change overwrote the return value of the RPC call, making
the tool return success (0) even if the RPC failed.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agovmware-user: Eliminate racy exit situation.
VMware, Inc [Mon, 26 Apr 2010 18:15:18 +0000 (11:15 -0700)] 
vmware-user: Eliminate racy exit situation.

Vmware-user's signal handler was destroying RPC channels when it
shouldn't have.  Rather than having a few cases where we decide to
call VMwareUserCleanupRpc before exiting the main loop, this change
simply places a call to VMwareUserCleanupRpc /after/ the main loop
has exited.  (The X I/O error handler is a special case, as apps
are -not- supposed to return from that handler.)

In the case of bug 542135, vmware-user received SIGUSR2 while still
initializing, destroying gRpcIn, before control was returned to the
initialization and eventmanager routines which expected gRpcIn to
still exist.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoInstall toolbox-cmd's translations in open-vm-tools.
VMware, Inc [Mon, 26 Apr 2010 18:14:55 +0000 (11:14 -0700)] 
Install toolbox-cmd's translations in open-vm-tools.

Add the translation catalogs to the open-vm-tools package, and install
them when performing a "make install".

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Mon, 26 Apr 2010 18:14:24 +0000 (11:14 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoInternal branch sync. Included in this change:
VMware, Inc [Mon, 26 Apr 2010 18:13:55 +0000 (11:13 -0700)] 
Internal branch sync. Included in this change:

. Add debug domain to resolutionSet plugin.

. Reset Unity options when exiting unity.

. Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Mon, 26 Apr 2010 18:09:15 +0000 (11:09 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Mon, 26 Apr 2010 18:08:50 +0000 (11:08 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Mon, 26 Apr 2010 18:08:12 +0000 (11:08 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoAtomic_Write64 is not atomic for 64-bit immediate operand
VMware, Inc [Mon, 26 Apr 2010 18:07:53 +0000 (11:07 -0700)] 
Atomic_Write64 is not atomic for 64-bit immediate operand

There is no move instruction for 64-bit immediate to memory, so unless
the immediate value fits in 32-bit (i.e. can be sign-extended), GCC
generates two movl instructions.  Use asm instruction to make GCC load
the immediate value into a register first.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoTrivial: Fix warning
VMware, Inc [Mon, 26 Apr 2010 18:04:49 +0000 (11:04 -0700)] 
Trivial: Fix warning

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoTrivial: Remove hgfsServer.h dependency
VMware, Inc [Mon, 26 Apr 2010 18:04:36 +0000 (11:04 -0700)] 
Trivial: Remove hgfsServer.h dependency

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoUnity/X11: Avoid sending spurious & incorrectly terminated updates.
VMware, Inc [Mon, 26 Apr 2010 18:04:17 +0000 (11:04 -0700)] 
Unity/X11: Avoid sending spurious & incorrectly terminated updates.

CLN 1022282 introduced a regression whereby Unity/X11 began sending
spurious and sometimes incorrectly terminated updates.  1022282 was
correct, but it exposed a bug elsewhere in Unity/X11's update code.

1.  The initial buffer update buffer should not start with a nul, so
trim it at init.
2.  Don't append the terminating double nul unless we actually have
an update to send.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Mon, 26 Apr 2010 18:03:30 +0000 (11:03 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoUpdate the PAM modules for vmguestd to include pam_unix.so
VMware, Inc [Mon, 26 Apr 2010 18:02:13 +0000 (11:02 -0700)] 
Update the PAM modules for vmguestd to include pam_unix.so

Ubuntu 10.04 does not include either the pam_unix2.so nor
the pam_unix_auth.so module for PAM.  As a result, none
of our authentication is working.  This CSet adds pam_unix.so
to our list of pam_modules to use for accounts and auth.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoUnity: Purge update buffer after successful send.
VMware, Inc [Mon, 26 Apr 2010 18:01:54 +0000 (11:01 -0700)] 
Unity: Purge update buffer after successful send.

The Unity/X11 code to handle the "new" update channel code was broken,
but problems didn't surface until CLN 953276 in November.  When single
"remove" updates were sent, the update buffer should've been purged but
wasn't.  As a result, the update buffer might look something like this
(! = nul):

> remove 01234567!!add 712456 windowPath=file:///foo/bar!move 712456...!!

When the VMX parses the update, it stops at the first double nul,
discarding everything afterward.  The result on QA's VM was that
windows created before entering Unity never appeared after entering
Unity, while all windows created afterward did.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Mon, 26 Apr 2010 17:59:48 +0000 (10:59 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoToolbox GTK: make file selection dialog modal
VMware, Inc [Mon, 26 Apr 2010 17:57:52 +0000 (10:57 -0700)] 
Toolbox GTK: make file selection dialog modal

Otherwise crafty users may switch back to main window and wreck
havoc upon us.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Mon, 26 Apr 2010 17:57:21 +0000 (10:57 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>