]> git.ipfire.org Git - thirdparty/open-vm-tools.git/log
thirdparty/open-vm-tools.git
16 years agoVMCI: Fix signedness errors
VMware, Inc [Wed, 24 Feb 2010 21:11:36 +0000 (13:11 -0800)] 
VMCI: Fix signedness errors

When compiling with never compilers vmci causes the following errors
to be reported:

.../vmcrosstalk/common/vmciDs.c: In function "DsHandleMessage":
.../vmcrosstalk/common/vmciDs.c:211: warning: pointer targets in passing
argument 1 of "DsLookupAction" differ in signedness

Fix it by changing name in from int8[] to char[] and making DsHandleMessage
take size_t for "outSize" and "written".

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoRemove unused VMCID definitions
VMware, Inc [Wed, 24 Feb 2010 21:10:48 +0000 (13:10 -0800)] 
Remove unused VMCID definitions

The VMCI user level daemon was removed a year back or so, but
a few definitions escaped this removal. Remove them since they
are unused.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoUnsupported ioctls should not print log, just return -EOPNOTSUPP
VMware, Inc [Wed, 24 Feb 2010 21:06:28 +0000 (13:06 -0800)] 
Unsupported ioctls should not print log, just return -EOPNOTSUPP

Remove printk's from unsupported ioctls. http://sourceforge.net/tracker/?func=detail&aid=1959582&group_id=204462&atid=989708

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agovmtoolsd: fix console handling on Win32.
VMware, Inc [Wed, 24 Feb 2010 21:06:05 +0000 (13:06 -0800)] 
vmtoolsd: fix console handling on Win32.

The previous code required the user to instruct the code to attach to the
console manually, which was error-prone. It also had a bug where the help
wouldn't show up, since the code to attach to the console was called after
the help was shown.

This change does three things:

. auto-detects the help triggers in the command-line and attaches a console
as needed.

. make sure we have a console when command-line parsing fails, so that the
message is shown.

. attaches a console when configuring logging, whenever a log domain is
configured to output to the terminal.

As a result, the old "--console" command line option is not needed anymore.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoBack out changeset: 982833
VMware, Inc [Wed, 24 Feb 2010 21:04:39 +0000 (13:04 -0800)] 
Back out changeset: 982833

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoOVT: have configure check for presence of linux/unistd.h
VMware, Inc [Wed, 24 Feb 2010 21:03:30 +0000 (13:03 -0800)] 
OVT: have configure check for presence of linux/unistd.h

Not everyone installs kernel-headers/linux-userspace-headers package
and without it compilation fails with a puzzling error. We better
check that the required header is present upfront.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoRevised version of cs 979736
VMware, Inc [Wed, 24 Feb 2010 21:03:06 +0000 (13:03 -0800)] 
Revised version of cs 979736

cs 979736 included changes to lib/string to call GetReturnAddress()
that caused the linker to build differently.  cs 979736 was
subsequently backed out for pr 483076.  This is the same change
without the GetReturnAddress() calls.  This change should not
introduce any functional differences whatsoever; it merely introduces
a new library function in lib/string that is currently not called.

The original description of cs 979736 is:

Add Str_Strerror, a thread safe version of strerror

strerror is not thread safe, it reuses the memory for the error
string on every call.  strerror_r is thread safe, but requires
callers to manage their buffers.  Add a new Str_Strerror function
that uses thread local storage to keep the error string.  This
function is only present on GLIBC_VERSION_23 and later.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoUpdating open-vm-tools version for release 2010.01.19-226760. 2010.01.19-226760
VMware, Inc [Wed, 20 Jan 2010 21:52:06 +0000 (13:52 -0800)] 
Updating open-vm-tools version for release 2010.01.19-226760.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoFix errors in X11 library detection macro.
VMware, Inc [Wed, 20 Jan 2010 21:48:00 +0000 (13:48 -0800)] 
Fix errors in X11 library detection macro.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Wed, 20 Jan 2010 21:47:39 +0000 (13:47 -0800)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoExclude pagemap from in-guest vm-support
VMware, Inc [Wed, 20 Jan 2010 21:47:02 +0000 (13:47 -0800)] 
Exclude pagemap from in-guest vm-support

Newer kernels, such as those included in Ubuntu 9.04
and 9.10, export a 'pagemap' node to the proc filesystem.
This node maps guest virtual to guest physical pages,
allowing address look-ups for the entire valid guest
virtual address space (including unmapped regions).
Thus, archiving the entire pagemap for each process/task
is prohibitively large (not to mention extremely slow) on
64-bit systems.  More importantly, this information is
not terribly useful for our debugging.  So, we exclude it
and vm-support in Ubuntu 9.x guests won't automatically
fill the guest disk.  (See also PR 399587 for the
linux host vm-support fix for the same issue).

As the 'Collect support data...' button now runs this
script in-guest, this change is important.  (Previously,
to trigger this problem, customers would have had to run
vm-support manually inside the guest.)

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoBackout Str_Strerror changes.
VMware, Inc [Wed, 20 Jan 2010 21:46:02 +0000 (13:46 -0800)] 
Backout Str_Strerror changes.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoPVSCSI: fix signedness compile warning
VMware, Inc [Wed, 20 Jan 2010 21:44:25 +0000 (13:44 -0800)] 
PVSCSI: fix signedness compile warning

pvscsi_setup_msix() expects 'irq' argument to be an int but is being
passed unsigned int. Unsigned int is more proper type for IRQ number
so let's use it. This shuts off a compile warning with recent
compilers.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoFix VMCI module build.
VMware, Inc [Wed, 20 Jan 2010 21:43:39 +0000 (13:43 -0800)] 
Fix VMCI module build.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoAdd guest kernel-mode support to vmci on Windows
VMware, Inc [Wed, 20 Jan 2010 21:42:38 +0000 (13:42 -0800)] 
Add guest kernel-mode support to vmci on Windows

* Added new IOCTLs to create/destroy datagram handles from
kernel-mode (the existing ones rely on a process context).

* Removed the old shared memory IOCTLs and code.

* Modified the guest driver to handle the new IOCTLs.

* Modified the host driver to fail gracefully when called from
kernel-mode (since not yet supported).

* Added kernel-mode vmcilib that wraps the IOCTLs.  Interface
is exactly the same as if you linked against vmci directly.

* Added a kernel-mode version of crosstalktest for all of the
above.  Note that it is built out of bora but will run in the
guest too; it will pass on the guest but fail in the host until
support is added.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoFix VMware logo used on task bars and window decorations on Linux
VMware, Inc [Wed, 20 Jan 2010 21:41:43 +0000 (13:41 -0800)] 
Fix VMware logo used on task bars and window decorations on Linux

CS #978067 updated design of VMware logo shown in "About" tab of
the toolbox program (Linux version) but neglected to update icon
used by desktop environment on window decorations and task bars.
Fix it.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Wed, 20 Jan 2010 21:40:57 +0000 (13:40 -0800)] 
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 [Wed, 20 Jan 2010 21:39:40 +0000 (13:39 -0800)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoAdd Str_Strerror, a thread safe version of strerror
VMware, Inc [Wed, 20 Jan 2010 21:37:07 +0000 (13:37 -0800)] 
Add Str_Strerror, a thread safe version of strerror

strerror is not thread safe, it reuses the memory for the error
string on every call.  strerror_r is thread safe, but requires
callers to manage their buffers.  Add a new Str_Strerror function
that uses thread local storage to keep the error string.  This
function is only present on GLIBC_VERSION_23 and later.

The change to vmm-link-vmm-to-static.make undefines GLIB_VERSION_23,
which was erroneously set.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoopen-vm-tools: cleanup handling of GLIBC_VERSION_* macros.
VMware, Inc [Wed, 20 Jan 2010 21:35:53 +0000 (13:35 -0800)] 
open-vm-tools: cleanup handling of GLIBC_VERSION_* macros.

Centralize the macros in CPPFLAGS instead of having variables for
individual libraries. This way everybody gets the correct flags for
the glibc available on the system.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Wed, 20 Jan 2010 21:34:21 +0000 (13:34 -0800)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoUse Solaris version number to decide MAC_VERSION to be used.
VMware, Inc [Wed, 20 Jan 2010 21:32:20 +0000 (13:32 -0800)] 
Use Solaris version number to decide MAC_VERSION to be used.

The earlier fix used devo_rev to choose the MAC_VERSION to be used in
mac_alloc(). That was a workaround for incomplete header files list in
toolchain. Moreover it did not serve the purpose as devo_rev came from
our header files itself and not as a runtime parameter from Solaris
kernel.

The header files for Opensolaris 2009.06 in toolchain have been restored . This change exploits the same. Some macros and structures have
changed in Opensolaris since Solaris 10. Depending on the version for
which the driver is being compiled, the right ones are used.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoopen-vm-tools: build vmmemctl, vmxnet and vmxnet3 for OpenSolaris.
VMware, Inc [Wed, 20 Jan 2010 21:32:05 +0000 (13:32 -0800)] 
open-vm-tools: build vmmemctl, vmxnet and vmxnet3 for OpenSolaris.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoCatch exception from backdoor access.
VMware, Inc [Wed, 20 Jan 2010 21:31:56 +0000 (13:31 -0800)] 
Catch exception from backdoor access.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoUpdate tools logo and icons with the new design
VMware, Inc [Wed, 20 Jan 2010 21:31:47 +0000 (13:31 -0800)] 
Update tools logo and icons with the new design

We should be using official VMware logo in tools. Note that wireless
icon is not updated (was not provided) but since we do not user or
advertise this feature it should be OK.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoupdate to I18N encoding name cross reference table
VMware, Inc [Wed, 20 Jan 2010 21:31:35 +0000 (13:31 -0800)] 
update to I18N encoding name cross reference table

Update the I18N name to encoding cross reference table with
some new names.  Identify encodings that are supported by ICU
even if we don't support them in our stripped down ICU data
file.  This doesn't actually add any encodings, but it makes
it easier should we decide to do so in the future.

Add new encodings that are needed for [361930], and change the
ICU data path to point to the new location in toolchain.

Also add some test code that can be enabled from Unicode_Init to
verify the entries in the xRef table match what is expected in
the ICU data file.  Add a similar change to codeset to disable
getting the ICU data file from toolchain if a custom file is
being tested.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoFix unitialized variable which can cause free of garbage
VMware, Inc [Wed, 20 Jan 2010 21:31:22 +0000 (13:31 -0800)] 
Fix unitialized variable which can cause free of garbage

Fix packout to be NULL so that in the event of receiving
a search close request with a stale handle, the search
close handler does not call free on a garbage pointer value.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Wed, 20 Jan 2010 21:31:08 +0000 (13:31 -0800)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoUpdate copyright year to 2010
VMware, Inc [Wed, 20 Jan 2010 21:30:53 +0000 (13:30 -0800)] 
Update copyright year to 2010

So that our copyright string is current. The year in stubbed-out
open_source_licenses.txt file is not changed as we expect the file
to be replaced soon.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoRemove INCLUDE_ALLOW_VMMEXT. We no longer consider it useful.
VMware, Inc [Wed, 20 Jan 2010 21:30:40 +0000 (13:30 -0800)] 
Remove INCLUDE_ALLOW_VMMEXT. We no longer consider it useful.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoSwitch to using a more generic loaded-module-list func
VMware, Inc [Wed, 20 Jan 2010 21:30:24 +0000 (13:30 -0800)] 
Switch to using a more generic loaded-module-list func

There is a not-very-generic loaded-module-list function
in lib/user (which is Linux-only).  For other reasons,
I've written a more generic one in lib/coreDump
(checked in with a previous review, cn970593) that works
for Linux, Windows, and Mac.

Delete the old one, and hook up the one callsite to call the
new one.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoFix VMCI compilation on 2.6.32 and later kernels.
VMware, Inc [Wed, 20 Jan 2010 21:30:07 +0000 (13:30 -0800)] 
Fix VMCI compilation on 2.6.32 and later kernels.

This change fixes two compilation issues with the VMCI linux
module on some 2.6.32 and later kernels. First, we now include
compat_sched.h together with compat_wait.h, since linux/wait.h
apparently isn't selfcontained (thanks to Petr for pointing
this out). Also, we no longer include "pgtbl.h" for 2.6.0
kernels and later, since it isn't used for these kernels. Also
removed includes and macros used by pre 2.6.0 kernels, since
guest kernel drivers for these kernels are frozen.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoUnity/X11: Only toggle minimization when window is on same desktop.
VMware, Inc [Wed, 20 Jan 2010 21:29:59 +0000 (13:29 -0800)] 
Unity/X11: Only toggle minimization when window is on same desktop.

This is a follow-on to bug 280354 / CLN 699915.  While that CLN ignored
bogus iconify notices upon desktop change, as written it implied that all
windows were unminimized unless a state change indicated otherwise.  With
an already-minimized window, it ended up triggering unminmize events upon
desktop change.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoresolutionX11.c: Add support for autofit via RandR >= 1.2.
VMware, Inc [Wed, 20 Jan 2010 21:29:46 +0000 (13:29 -0800)] 
resolutionX11.c: Add support for autofit via RandR >= 1.2.

The new WIP Linux guest drivers no longer support the VMWARE_CTRL X11
protocol extension but instead expose multiple displays via the RandR
(Resize and Rotate) extension as outputs LVDS1..LVDS<n>.

The requested topology is implemented using modes called
'autofit-WWWWxHHHH' generated as needed for each output.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoUnity/X11: Don't remove minimized windows from tracker.
VMware, Inc [Wed, 20 Jan 2010 21:29:29 +0000 (13:29 -0800)] 
Unity/X11: Don't remove minimized windows from tracker.

CLN 953276 introduced a regression.  Unregress it.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Wed, 20 Jan 2010 21:29:19 +0000 (13:29 -0800)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoTimeSync: cleanup hanlding of the timesync loop state
VMware, Inc [Wed, 20 Jan 2010 21:28:53 +0000 (13:28 -0800)] 
TimeSync: cleanup hanlding of the timesync loop state

We used to store current state of plugin/timeloop in timeSyncState;
unfortunately we were also using presence of 'timer' to infer whether
the loop is running which is confusing. Make 'state' the pimary source
of this information.

Also we should not stop timesync loop any time sync fails, let's treat
treat this as a transient condition and keep running.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoMake vmxnet and vmxnet3s drivers work in Opensolaris 2009.06
VMware, Inc [Wed, 20 Jan 2010 21:28:41 +0000 (13:28 -0800)] 
Make vmxnet and vmxnet3s drivers work in Opensolaris 2009.06

tools-for-solaris target should build vmxnet and vmxnet3s drivers for
Opensolaris 2009.06.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoTry to auto-detect CUnit without having to define CUSTOM flags.
VMware, Inc [Wed, 20 Jan 2010 21:28:17 +0000 (13:28 -0800)] 
Try to auto-detect CUnit without having to define CUSTOM flags.

Like in other cases where there's no pkg-config or config scripts,
use a default to try to find the library. Add a new macro that does
that in a generic way and use it in other cases where that situation
occurs in configure.ac.

Bonus: remove libnotify detection code since none of the open-vm-tools
code uses libnotify.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Wed, 20 Jan 2010 21:28:04 +0000 (13:28 -0800)] 
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 [Wed, 20 Jan 2010 21:27:39 +0000 (13:27 -0800)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoRework the vmrpcdbg library to use CUnit.
VMware, Inc [Wed, 20 Jan 2010 21:27:24 +0000 (13:27 -0800)] 
Rework the vmrpcdbg library to use CUnit.

CUnit provides nicer ways to track test failures than just logging or
using hard asserts. So use CUnit to run vmtoolsd-based test code.

This required a few changes:

. to be able to use CUnit, the vmtoolsd main loop needs to be run in
the context of a CUnit test. So the code in mainLoop.c was reorganized
a bit so that all code that touches plugin code is run in that context,
and execution of the main loop is done through the vmrpcdbg library
(which sets up the CUnit context) when running in debug mode.

. the interface of the vmrpcdbg library was cleaned up a little bit.

. test code was changed to use CUnit asserts instead of
ASSERT/g_assert/logs.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoImplementing support for V4 headers in the HGFS server.
VMware, Inc [Wed, 20 Jan 2010 21:27:02 +0000 (13:27 -0800)] 
Implementing support for V4 headers in the HGFS server.

Adding capability to pack/unpack V4 headers in the server and
to process V4 packets with legacy, V3 payload.
The change does not introduce support for any new type of operation
(except HGFS_OP_CREATE_SESSION_V4/HGFS_OP_DESTROY_SESSION_V4).
New types of operations and payload will be gradually added in the future.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Wed, 20 Jan 2010 21:26:16 +0000 (13:26 -0800)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoLocalize command-line Toolbox
VMware, Inc [Wed, 20 Jan 2010 21:25:36 +0000 (13:25 -0800)] 
Localize command-line Toolbox

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoFix Linux kernel modules build on 2.6.33-rc1
VMware, Inc [Wed, 20 Jan 2010 21:25:26 +0000 (13:25 -0800)] 
Fix Linux kernel modules build on 2.6.33-rc1

linux/utsrelease.h & friends moved from linux/ to generated/.  Which
breaks all our sources, plus all our builders.

So there are two changes: (1) make sure our modules include
appropriate autoconf.h, and (2) update modconf to know that
utsrelease.h may live in different directory.

While I was in modconf I could not resist to remove some duplicated
code...

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoHostinfo: OS name cache stuff isn't architecture dependent.
VMware, Inc [Wed, 20 Jan 2010 21:25:10 +0000 (13:25 -0800)] 
Hostinfo:  OS name cache stuff isn't architecture dependent.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoChanges made to avoid compiler problems.
VMware, Inc [Wed, 20 Jan 2010 21:25:01 +0000 (13:25 -0800)] 
Changes made to avoid compiler problems.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoopen-vm-tools: remove lib/lock, lib/nothread.
VMware, Inc [Wed, 20 Jan 2010 21:24:35 +0000 (13:24 -0800)] 
open-vm-tools: remove lib/lock, lib/nothread.

These libraries aren't really used in open-vm-tools code (now that
hgfsServer can use glib), so we don't need to provide them.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoAllow hgfsServer to use glib mutexes instead of bora/lib/lock.
VMware, Inc [Wed, 20 Jan 2010 21:24:25 +0000 (13:24 -0800)] 
Allow hgfsServer to use glib mutexes instead of bora/lib/lock.

This avoids having lib/lock and its dependencies having to be part of
open-vm-tools. To make sure vmware-user still works in open-vm-tools,
make sure the glib thread library is initialized, even though it's not used
by the non-open-vm-tools version.

This change only really affects the open-vm-tools build at the moment;
eventually we might want to clean up the regular tools build also, so
that we have one less dependency on bora.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoRemove utilPosix.c from open-vm-tools.
VMware, Inc [Wed, 20 Jan 2010 21:24:09 +0000 (13:24 -0800)] 
Remove utilPosix.c from open-vm-tools.

It's not used by any OVT code and also removes one dependency on lib/lock.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoHostinfo: Add OS name caching to POSIX impl.
VMware, Inc [Wed, 20 Jan 2010 21:23:58 +0000 (13:23 -0800)] 
Hostinfo:  Add OS name caching to POSIX impl.

While investigating PR 479137, we noticed that the
Hostinfo_GetOSName may end up holding up the Tools service for a while
on a heavily loaded host.  My theory is that we're starved of either
CPU or disk, and this change brings the caching available in the Windows
implementation over to the POSIX side.

After the first invocation, we won't have to go to disk or fork any
other processes in order to identify the running operating system.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoA few type fixups
VMware, Inc [Wed, 20 Jan 2010 21:23:41 +0000 (13:23 -0800)] 
A few type fixups

For Util_SafeXXX functions, the __FILE__ macro is a
const char*, not a char*.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoUnicodify lib/system.
VMware, Inc [Wed, 20 Jan 2010 21:23:27 +0000 (13:23 -0800)] 
Unicodify lib/system.

Make sure all code is Unicode-friendly, and change
System_SetProcessPrivilege's signature to not depend on the TSTR mutable type
so that we catch mismatches at compile time. Also do some minor cleanup (like
getting rid of obsolete code).

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Wed, 20 Jan 2010 21:23:12 +0000 (13:23 -0800)] 
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 [Wed, 20 Jan 2010 21:22:41 +0000 (13:22 -0800)] 
Internal branch sync. Included in this change:

. Fix an issue where only image data would be retrieved from the clipboard,
  instead of both image and text data.

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

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoFix vm-support issue
VMware, Inc [Wed, 20 Jan 2010 21:22:05 +0000 (13:22 -0800)] 
Fix vm-support issue

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoRemove bogus error checks from af_vsock.c
VMware, Inc [Wed, 20 Jan 2010 21:21:34 +0000 (13:21 -0800)] 
Remove bogus error checks from af_vsock.c

With the new VMADDR_CID_ANY change, a datagram handle that is registered with VMCI will have a context
of invalid on the guest or hosted context id on the host. This means the error check in linux vsock
is no longer correct and was preventing sockets from working on the host. Just remove the checks since
it is really a bug if VMCI ever returns us a handle with bad values and VMCI_SUCCESS...

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoVMCI Handle array should allocate mem atomic.
VMware, Inc [Wed, 20 Jan 2010 21:21:26 +0000 (13:21 -0800)] 
VMCI Handle array should allocate mem atomic.

The VMCI handle arrays are usually appended to and copied
while holding spinlocks. As these operations may/will result
in memory being allocated, the memory allocations should be
atomic.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoOVT: remove vmxnet3 linux driver
VMware, Inc [Wed, 20 Jan 2010 21:21:13 +0000 (13:21 -0800)] 
OVT: remove vmxnet3 linux driver

Now that VMXNET3 is in mainline kernel (since 2.6.32) we should not
be distributing it here but rather have users get it with their
kernels.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoUpdating open-vm-tools version for release 2009.12.16-217847. 2009.12.16-217847
VMware, Inc [Fri, 18 Dec 2009 01:27:55 +0000 (17:27 -0800)] 
Updating open-vm-tools version for release 2009.12.16-217847.

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 Dec 2009 23:07:26 +0000 (15:07 -0800)] 
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 Dec 2009 23:07:00 +0000 (15:07 -0800)] 
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 [Thu, 17 Dec 2009 23:06:40 +0000 (15:06 -0800)] 
Internal branch sync. Included in this change:

. lib/lock: minor performance optimizations, cleanups and other improvements.

. finish removal of lib/sync.

. 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 Dec 2009 23:01:54 +0000 (15:01 -0800)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agovmtoolsd: do not store VMX options with the rest of config
VMware, Inc [Thu, 17 Dec 2009 23:01:29 +0000 (15:01 -0800)] 
vmtoolsd: do not store VMX options with the rest of config

VMX options are not persistent in the sense that they are not stored
in tools config file in GOS but rather [re]transmitted from host at
startup, resume, etc, or when they are changed. When we reload config
file (which we periodically do to switch to the latest and greatest
user-supplied settings) VMX options get flushed from memory so let's
not put them in key file in first place and instead require plugins
to store values relevant to their operation themselves.

The only user who did look up VMX option in key file - timeSync - has
already been changed to store value by itself.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoTimesync: fix backward sync when config file is reloaded
VMware, Inc [Thu, 17 Dec 2009 23:00:56 +0000 (15:00 -0800)] 
Timesync: fix backward sync when config file is reloaded

Reloading of tools configuration file causes purging of all options,
including ones that are sent via RPC by VMX. This causes issues with
timesync plugin, which 'forgets' that it is supposed to perform full
time synchronization when enabling time synchronization loop.

Solve the problem by storing value of TOOLSOPTION_SYNCTIME_STARTUP
in a private variabe instead of retrieving it from the config
dictionary.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoModify the linux vsock code to work with VMADDR_CID_ANY
VMware, Inc [Thu, 17 Dec 2009 23:00:31 +0000 (15:00 -0800)] 
Modify the linux vsock code to work with VMADDR_CID_ANY

Previous to this change VMADDR_CID_ANY was directly mapped to a context id when it was recv'd from
userland. Change this behavior to store VMADDR_CID_ANY and to register datagram handlers as
any cid for:
1. The stream control channel under all conditions.
2. The datagram handler if it is being bound to VMADDR_CID_ANY.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoAdd support for datagram handles with VMCI_FLAG_ANYCID_DG_HND.
VMware, Inc [Thu, 17 Dec 2009 23:00:06 +0000 (15:00 -0800)] 
Add support for datagram handles with VMCI_FLAG_ANYCID_DG_HND.

In certain situations (e.g. vsock) ... we really want to register datagram handles that are not
tied to one specific context id. The goal is that these datagram handles will continue to be
able to send and recv datagrams after a cid change. Without this change clients would have to go
through and manually reregister all datagram handles.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoRemove x86 dependencies from a variety of files.
VMware, Inc [Thu, 17 Dec 2009 22:59:47 +0000 (14:59 -0800)] 
Remove x86 dependencies from a variety of files.

Remove x86 dependencies from a variety of files in preparation for adding an ARM-based remotemks.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoFreeBSD VMBLOCK: avoid crash when doing lookup in a subdirectory
VMware, Inc [Thu, 17 Dec 2009 22:58:54 +0000 (14:58 -0800)] 
FreeBSD VMBLOCK: avoid crash when doing lookup in a subdirectory

When trying to reconstruct path to a vnode during lookup of a file
within subdirectory the driver gets confused and crashes the kernel.
This can be easily triggered by doing H->G DnD of a small directory.
Instead of trying to reconstruct it every time let's just store the
latest lookup that lead to discovery of the vnode (similar to how
Linux driver does this).

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoAdd support for delayed VMCI datagrams.
VMware, Inc [Thu, 17 Dec 2009 22:58:30 +0000 (14:58 -0800)] 
Add support for delayed VMCI datagrams.

This builds on top of changes 960817 and 964769.  Datagrams
can now be delivered in a delayed system context via
a worker thread, instead of directly.  Although
the code is present for all platforms, this is only
enabled for Windows, since we want datagrams at PASSIVE
rather than DISPATCH level.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoInternal branch sync. Included in this change:
VMware, Inc [Thu, 17 Dec 2009 22:58:07 +0000 (14:58 -0800)] 
Internal branch sync. Included in this change:

. Fix linux vmxnet2 driver checksum offload configuration.

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

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoFix release build.
VMware, Inc [Thu, 17 Dec 2009 22:55:38 +0000 (14:55 -0800)] 
Fix release build.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoAllow plugins to respond to registration errors.
VMware, Inc [Thu, 17 Dec 2009 22:55:27 +0000 (14:55 -0800)] 
Allow plugins to respond to registration errors.

This change adds a callback that plugins can register to be notified of
registration errors. Plugins can use this functionality to selectively
disable functionality based on the current state of the container where
they are running.

For example, if a plugin depends on a signal provided by another plugin,
but this other plugin fails to load for any reason, the first plugin is
notified that the signal connection failed, and can disable the
functionality that relied on that signal.

Plugins are never unloaded, though. So they should still be careful to not
crash even if registration errors happen.

Bonus: clarify a few spots in the API docs.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoFix open-vm-tools build issues.
VMware, Inc [Thu, 17 Dec 2009 22:55:03 +0000 (14:55 -0800)] 
Fix open-vm-tools build issues.

. codeset.c is not compiled when using --without-icu, so we shouldn't
reference symbols implemented in that file in that case.
. gcc 4.3.2 complains about calling Panic() with a non-const format string.
. Ubuntu 9.10 complains about ignoring the return value of chdir.

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 Dec 2009 22:54:27 +0000 (14:54 -0800)] 
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 Dec 2009 22:53:49 +0000 (14:53 -0800)] 
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 Dec 2009 22:52:40 +0000 (14:52 -0800)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoMake vmci, vsock, vmsync and vmnet use compat_mutex
VMware, Inc [Thu, 17 Dec 2009 22:52:21 +0000 (14:52 -0800)] 
Make vmci, vsock, vmsync and vmnet use compat_mutex

In recent rt kernels (bug 490581 reports this for
2.6.31.4-rt14), old style mutex operations are no longer
supported (DECLARE_MUTEX, init_MUTEX are gone). Since we
already have a compat_mutex.h, convert vmci, vsock, vmsync and
vmmnet to use that instead. Since vmnet used an interruptible
version of down, compat_mutex_lock_interruptible has been
added to compat_mutex.h.

Another option would be to extend the current compat_semaphore
header, but since the new Linux mutex operations are there and
are specific for mutexes, we might as well move to these.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoSample guest and host time multiple times.
VMware, Inc [Thu, 17 Dec 2009 22:51:38 +0000 (14:51 -0800)] 
Sample guest and host time multiple times.

This change adds a loop reading host and guest time.  The read of
the guest is always bracketed by reads of the host and if those
two reads are more than 2ms apart, loop to try and get a more
accurate sample.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoDynXdr: Implement xdr_inline operation.
VMware, Inc [Thu, 17 Dec 2009 22:51:24 +0000 (14:51 -0800)] 
DynXdr: Implement xdr_inline operation.

While working with SIGAR => XDR serialization, I ran into segfaults
when the rpcgen-generated code called xdr_inline, an operation which
we didn't implement.

This change fixes that.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoAdd unrestricted local encoding support to tools
VMware, Inc [Thu, 17 Dec 2009 22:51:09 +0000 (14:51 -0800)] 
Add unrestricted local encoding support to tools

Tools needs to be able to use local encodings even if they are
not supported in our stripped down version of the ICU.  In tools
builds accept any encoding as valid provided we recognize it
and it is the default local encoding.  If the encoding is not
supported in our ICU, revert to using native OS conversions with
codesetOld.

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 Dec 2009 22:50:32 +0000 (14:50 -0800)] 
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 [Thu, 17 Dec 2009 22:50:00 +0000 (14:50 -0800)] 
Internal branch sync. Included in this change:

. Start using lib/lock, a new user-level lock library that supports lock ranks.

. Change desktop background color when in Unity mode to light gray (not yet
  implemented on X11).

. Remove lib/sync (replaced with lib/lock).

. Sync up vmxnet3 with upstreamed driver: Use API provided by Linux wherever
  possible.

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

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agochar is neither signed nor unsigned
VMware, Inc [Thu, 17 Dec 2009 21:50:33 +0000 (13:50 -0800)] 
char is neither signed nor unsigned

As some of our code starts to be compiled on ARM, we need to improve
some elements of code cleanliness.  This review deals with char being
neither signed nor unsigned in the gcc type system.  (Confused?  See
this link:)
http://www.trilithium.com/johan/2005/01/char-types/
This was initially found with gcc, but MSVC also makes the distinction.

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 Dec 2009 21:49:46 +0000 (13:49 -0800)] 
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 Dec 2009 21:48:46 +0000 (13:48 -0800)] 
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 Dec 2009 21:48:26 +0000 (13:48 -0800)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoFix vmxnet3 linux module compilation.
VMware, Inc [Thu, 17 Dec 2009 21:47:43 +0000 (13:47 -0800)] 
Fix vmxnet3 linux module compilation.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoAdd explicit casts to int64.
VMware, Inc [Thu, 17 Dec 2009 21:47:23 +0000 (13:47 -0800)] 
Add explicit casts to int64.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoFactor out reading guest and host time from TimeSyncDoSync.
VMware, Inc [Thu, 17 Dec 2009 21:47:07 +0000 (13:47 -0800)] 
Factor out reading guest and host time from TimeSyncDoSync.

This change splits out reading guest and host time from the main
time sync loop.  At the same time, it converts to using "diff" and
"interruptLag" to "gosError" and "apparentError".  The polarity of
these two now match NTP/adjtime: positive values mean that time is
ahead, negative values mean that time is behind.  The names match
TimeTracker.

This change shouldn't introduce any behavioral changes.  The
change in how errors are represented makes some of the conditions
in the one time sync portion of the loop look a bit suspect, but
I'll address that later.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoMake timeSync use microseconds rather than seconds & microseconds.
VMware, Inc [Thu, 17 Dec 2009 21:46:45 +0000 (13:46 -0800)] 
Make timeSync use microseconds rather than seconds & microseconds.

A signed 64 bit value storing microseconds can represent up to
292471 years, so keeping a separate "seconds" value isn't
necessary (and complicates calculations).

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 Dec 2009 21:46:25 +0000 (13:46 -0800)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoConfigure core dump limit on POSIX automatically.
VMware, Inc [Thu, 17 Dec 2009 21:45:52 +0000 (13:45 -0800)] 
Configure core dump limit on POSIX automatically.

In this change:

. if core dumps are enabled in the config file, try to raise the core
rlimit for the process when logging is enabled; this can still fail
if the system is configured to now allow it, but it's better than
not getting core dumps because the default system setting is to set
the limit to 0.

. on POSIX systems, try to chdir to the user's home if trying to create
a core dump, but the current directory is not writable.

. don't enable the Win32 exception filter automatically when loading the
vmtools DLL; instead, do it when configuring logging and requesting
core dumps.

. avoid recursive log calls from CoreDump_CoreDump() on Win32; only Panic()
was incrementing the recursive panic count, it needs to be done in the
actual core dump function.

This change doesn't handle SIGSEGV on POSIX; that will still create a core
dump if the limit is set appropriately, but won't go through the code that
sees if the current directory is writable.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoPlumb SCM control signals through vmtoolsd in a generic way.
VMware, Inc [Thu, 17 Dec 2009 21:44:59 +0000 (13:44 -0800)] 
Plumb SCM control signals through vmtoolsd in a generic way.

Instead of individually plumbing every possible control code the SCM
sends to services through vmtoolsd, provide a generic plumbing mechanism
and let plugins decide what they want to do.

The only remaining issue is that a few control codes are only sent after
some specific registration step (e.g., RegisterDeviceNotification); for
those cases, either we'll need to have vmtoolsd blindly register for all
possible control codes (which is not future proof since MS may add new
ones), or, when possible (such as in the device notification example),
let plugins do the registration themselves.

Change the two existing control messages (SESSION_CHANGE and SHUTDOWN) to
use the new mechanism, and fix all current usage sites.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoopen-vm-tools: link against libresolv on solaris.
VMware, Inc [Thu, 17 Dec 2009 21:43:54 +0000 (13:43 -0800)] 
open-vm-tools: link against libresolv on solaris.

Apparently this is needed to find a few symbols on certain builds
of OpenSolaris.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoRemove a duplicate comment from fileIOPosix.c.
VMware, Inc [Thu, 17 Dec 2009 21:43:36 +0000 (13:43 -0800)] 
Remove a duplicate comment from fileIOPosix.c.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoDetect nested VM support
VMware, Inc [Thu, 17 Dec 2009 21:43:15 +0000 (13:43 -0800)] 
Detect nested VM support

Unless vmx.allowNested is set, VMX currently refuses to power on
if it finds the backdoor.  With the recent addtion of dynamic
backdoor toggling, we can now test for the presence of that
feature and allow nested VMs to power on when it is found.

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 Dec 2009 21:42:21 +0000 (13:42 -0800)] 
Changes in shared code that don't affect open-vm-tools functionality.

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