]> git.ipfire.org Git - thirdparty/open-vm-tools.git/log
thirdparty/open-vm-tools.git
16 years agoStyle cleanup in VMCIQPair.c
VMware, Inc [Thu, 17 Jun 2010 22:14:20 +0000 (15:14 -0700)] 
Style cleanup in VMCIQPair.c

Delete some unwanted "()"s and ":"s.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoUnification of VMCI host and guest kernel API (4+5/5)
VMware, Inc [Thu, 17 Jun 2010 22:14:11 +0000 (15:14 -0700)] 
Unification of VMCI host and guest kernel API (4+5/5)

The VMCI kernel API should be the same for both host and
guest. Currently, that is not the case. The unification will
consist of the following five changes - this is steps 4 and 5
with some additional white space clean ups:

1) Make the functions supported by the host kernel API a
superset of the functions supported by the guest kernel
API. This consists of adding VMCI_DeviceGet,
VMCI_DeviceRelease, VMCI_GetContextID, VMCI_Version and
VMCI_DsLookup.

2) Make the functions available by the guest kernel API the
same as the functions available by the host kernel API. This
means adding VMCI_ContextID2HostVmID and defining doorbell API
on all platforms. These functions return
VMCI_ERROR_UNAVAILABLE either because they don't make sense
(the first one or because they aren't implemented yet). The
unified header file will make clear what is supported where.

3) Integrate vmciHostKernelAPI.h to vmciKernelAPI.h.

4) Edit vmciKernelAPI.h to not refer to vmciHostKernelAPI.h
and integrate the VMCIQPair.h definitions into the header
file.

5) Delete old vmci*KernelAPI.h and VMCIQPair.h files, and make
all host and guest references to a kernel API header file
refer to the new unified header file.

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 22:13:48 +0000 (15:13 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoVSOCK: fix compile error on Linux kernels past 2.6.34
VMware, Inc [Thu, 17 Jun 2010 22:13:22 +0000 (15:13 -0700)] 
VSOCK: fix compile error on Linux kernels past 2.6.34

Due to sock_def_readable() RCU conversion (git commit
43815482370c510c569fd18edb57afcb0fa8cab6) sk_sleep pointer
in "struct sock" was replaced with pointer to a new structure
socket_wq and users are forced to use sk_sleep() helper.
Implement the helper for older kernels and switch our code
to use it.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoMinor code review fixes for previous ctime_r changes.
VMware, Inc [Thu, 17 Jun 2010 22:13:02 +0000 (15:13 -0700)] 
Minor code review fixes for previous ctime_r changes.

Add some newlines and comments.  Change a hard-coded size
to sizeof.  Added an assignment to force conversion to
time_t.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoUnification of VMCI host and guest kernel API (2/5)
VMware, Inc [Thu, 17 Jun 2010 22:12:48 +0000 (15:12 -0700)] 
Unification of VMCI host and guest kernel API (2/5)

The VMCI kernel API should be the same for both host and
guest. Currently, that is not the case. The unification will
consist of the following five changes - this is step 2:

1) Make the functions supported by the host kernel API a
superset of the functions supported by the guest kernel
API. This consists of adding VMCI_DeviceGet,
VMCI_DeviceRelease, VMCI_GetContextID, VMCI_Version and
VMCI_DsLookup.

2) Make the functions available by the guest kernel API the
same as the functions available by the host kernel API. This
means adding VMCI_ContextID2HostVmID and defining doorbell API
on all platforms. These functions return
VMCI_ERROR_UNAVAILABLE either because they don't make sense
(the first one or because they aren't implemented yet). The
unified header file will make clear what is supported where.

3) Integrate vmciHostKernelAPI.h to vmciKernelAPI.h.

4) Edit vmciKernelAPI.h to not refer to vmciHostKernelAPI.h
and integrate the VMCIQPair.h definitions into the header
file.

5) Delete old vmci*KernelAPI.h and VMCIQPair.h files, and make
all host and guest references to a kernel API header file
refer to the new unified header file.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoUnification of VMCI host and guest kernel API (1/5)
VMware, Inc [Thu, 17 Jun 2010 22:12:29 +0000 (15:12 -0700)] 
Unification of VMCI host and guest kernel API (1/5)

The VMCI kernel API should be the same for both host and
guest. Currently, that is not the case. The unification will
consist of the following five changes - this change is step 1:

1) Make the functions available by the host kernel API a
superset of the functions supported by the guest kernel
API. This consists of adding VMCI_DeviceGet,
VMCI_DeviceRelease, VMCI_GetContextID, VMCI_Version and
VMCI_DsLookup.

2) Make the functions available by the guest kernel API the
same as the functions available by the host kernel API. This
means adding VMCI_ContextID2HostVmID and defining doorbell API
on all platforms. These functions return
VMCI_ERROR_UNAVAILABLE either because they don't make sense
(the first one or because they aren't implemented yet). The
unified header file will make clear what is supported where.

3) Integrate vmciHostKernelAPI.h to vmciKernelAPI.h.

4) Edit vmciKernelAPI.h to not refer to vmciHostKernelAPI.h
and integrate the VMCIQPair.h definitions into the header
file.

5) Delete old vmci*KernelAPI.h and VMCIQPair.h files, and make
all host and guest references to a kernel API header file
refer to the new unified header file.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agovmmemctl: remove Solaris 9 support
VMware, Inc [Thu, 17 Jun 2010 22:11:50 +0000 (15:11 -0700)] 
vmmemctl: remove Solaris 9 support

We do not support Solaris 9 and stopped generating PBMs for it,
let's remove references to it in the code.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agovmmemctl: do not require userspace component on Solaris
VMware, Inc [Thu, 17 Jun 2010 22:11:38 +0000 (15:11 -0700)] 
vmmemctl: do not require userspace component on Solaris

Instead of using userspace program to provide a separate thread on
Solaris create a proper kernel thread.

This removes vmmemctld and the need to start/stop and muck around
with it.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agovmmemctl: do not try to prevent multiple initializations
VMware, Inc [Thu, 17 Jun 2010 22:11:14 +0000 (15:11 -0700)] 
vmmemctl: do not try to prevent multiple initializations

We are kernel drivers, we should have at least some idea what is
going on and what gets called when.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agovmmemctl: do not store driver name in "state"
VMware, Inc [Thu, 17 Jun 2010 22:11:01 +0000 (15:11 -0700)] 
vmmemctl: do not store driver name in "state"

It is quite silly to pass and maintain name of the driver in global
"state", let's simply use proper "defines" where needed.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoSimplify and consolidate VThreadBase ID allocation
VMware, Inc [Thu, 17 Jun 2010 22:10:46 +0000 (15:10 -0700)] 
Simplify and consolidate VThreadBase ID allocation

Now that VTHREAD_UI_ID has been removed, there is only
one caller of VThreadBase_InitThread.  So inline the
behavior.  Add a TLS destructor too, to ensure SimpleID-
allocated memory gets freed.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoTweak Atomic_Init to better occur by default
VMware, Inc [Thu, 17 Jun 2010 22:10:12 +0000 (15:10 -0700)] 
Tweak Atomic_Init to better occur by default

Turns out vobd never called Atomic_Init, which tripped up
an ASSERT that verifies Atomic_Init isn't initialized racily.

Two fixes:
1) Atomic_Init really is idempotent.  So let's remove the ASSERT
and deal with the race a different way.
2) Any code that uses Atomic_Init is Really Likely to be using
VThreadBase too, so let's stick an Atomic_Init in anytime
we see a new thread.  This should cover 99% of self-
initialization.

Nominally this *slightly* weakens our Atomic_Init check - one
could end up with two threads (that don't use bora/lib but do
use atomics) running without correct atomic initialization.  In
reality, forgetting Atomic_Init entirely is far more likely
than doing Atomic_Init racily, so this tweak ought to cover
more cases than the old ASSERT.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoRemove FileIO Stats.
VMware, Inc [Thu, 17 Jun 2010 22:09:09 +0000 (15:09 -0700)] 
Remove FileIO Stats.

The FileIO stats are not thread-safe (PR 488887), but no one ever
looks at them anyway (PR 563363). This change removes stats from
FileIO.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoAdd MSI/MSI-X support to VMCI
VMware, Inc [Thu, 17 Jun 2010 22:07:22 +0000 (15:07 -0700)] 
Add MSI/MSI-X support to VMCI

This change adds MSI/MSI-X support to VMCI.

The device is now MSI/MSI-X capable, and supports up to 2
vectors in MSI-X mode, one for datagrams and another for
the notification bitmap.

The Windows and Linux drivers have been updated to use
MSI/MSI-X when running on the new device.  The drivers only
support one vector for now, for datagrams.

Verified on Windows guests by checking the Device Resources.
MSI-X is selected on Win7, while on Win2K, it correctly
falls back to legacy mode.  The old Windows driver runs
correctly on the new device.

Verified on Linux by checking lspci.  MSI-X is selected on
newer kernels where CONFIG_PCI_MSI is defined, otherwise
it falls back to legacy mode.  The old Linux driver runs
correctly on the new device.

Verified on v7 and v8 hardware.  On v7, the new driver falls
back to legacy mode.  Suspending on v7 and resuming on v8
works correctly, it will use legacy and continue to fire
interrupts as expected.  On v8, it will use MSI/MSI-X
if possible.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoDon't call pthread_kill on exited pthread_t's
VMware, Inc [Thu, 17 Jun 2010 22:06:36 +0000 (15:06 -0700)] 
Don't call pthread_kill on exited pthread_t's

Nominally, man pages say that pthread_kill on an
exited thread return ESRCH.  Unfortunately, man
pages lie; glibc bounds the space allowed for
dead thread stacks and munmaps memory once past
that bound, so pthread_kill's implementation
ends up hitting a SEGV.

The only way to avoid this is to know when threads
exit.  The manual way (VThreadBase_ForgetSelf) is
pretty good, but not good enough: roll-your-own
threading code (VMHS, in this bug) exits without
telling anyone.  So also do an automatic hook:
install a Posix TLS destructor.  Doing so removes
the need to call pthread_kill at all, so remove
it.

The cleanup needed: remove the pthread_t from
the global list of active threads (used to
recycle VThreadIDs).

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agobit functions: a little nicer implementation
VMware, Inc [Thu, 17 Jun 2010 22:06:10 +0000 (15:06 -0700)] 
bit functions: a little nicer implementation

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoReport correct error from POSIX version of "HgfsPlatformFileExists"
VMware, Inc [Thu, 17 Jun 2010 22:05:52 +0000 (15:05 -0700)] 
Report correct error from POSIX version of "HgfsPlatformFileExists"

Current implementation always reports -1 when the file does not exist.
Fixing it to report actual error - usually ENOENT.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoleast and most significant bit set functions: support !x86*
VMware, Inc [Thu, 17 Jun 2010 22:05:31 +0000 (15:05 -0700)] 
least and most significant bit set functions: support !x86*

Since the chances of not using a GNU compiler for ARM or any
other architecture we'll use is very small (we know GNU well
and "like" it), code the least and most significant bit set
functions such that they should work "anywhere" via the GCC
intrinsic functions.

This is a cautious beginning to possibily using the instrinics
outside the monitor and vmkernel and possibly within. For now
the X86* support is left unmodified.

Many experiments will soon follow this change...

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoFix error on creating new files/folders in root share
VMware, Inc [Thu, 17 Jun 2010 22:05:00 +0000 (15:05 -0700)] 
Fix error on creating new files/folders in root share

When a user or inadvertently tries to create a new file or folder
or overwrite a folder in the root share fail with the correct
error. Previously the Windows hgfs client always failed with
name not found which is not the correct error and confuses some
applications which then mislead the user.

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 22:04:47 +0000 (15:04 -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 22:04:33 +0000 (15:04 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoAdding create/destroy session support.
VMware, Inc [Thu, 17 Jun 2010 22:03:49 +0000 (15:03 -0700)] 
Adding create/destroy session support.

1. Implementing handlers for creating and destroying sessions in server.
2. Implementing sending create/destroy session requests in the Windows client.

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 22:03:32 +0000 (15:03 -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 22:03:13 +0000 (15:03 -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 22:03:00 +0000 (15:03 -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 22:02:35 +0000 (15:02 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agovmmemctl: switch to using OS-specific methods to format stats
VMware, Inc [Thu, 17 Jun 2010 22:02:19 +0000 (15:02 -0700)] 
vmmemctl: switch to using OS-specific methods to format stats

The common routine to output ballooning statistics does not work
for Solraris (which uses kstats) and is awkward on Linux/BSD,
where we need to allocate additional memory, introduce a wrappers
around snprintf and so on. Let's leave it to every OS to generate
stats in the most natural way for that particular OS.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agolib/lock: clean up and simplify
VMware, Inc [Thu, 17 Jun 2010 22:00:54 +0000 (15:00 -0700)] 
lib/lock: clean up and simplify

Too much class name data being pushed around. Inherit the name
whenever possible.

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 22:00:35 +0000 (15:00 -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 22:00:21 +0000 (15:00 -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:59:58 +0000 (14:59 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoChange ctime() to ctime_r() in lib/misc/timeutil.c
VMware, Inc [Thu, 17 Jun 2010 21:58:47 +0000 (14:58 -0700)] 
Change ctime() to ctime_r() in lib/misc/timeutil.c

ctime() is not thread safe because it uses an internal static buffer.
Use ctime_r() instead.  The man page says a buffer of length 26 is
sufficient.

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:58:33 +0000 (14:58 -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
VMware, Inc [Thu, 17 Jun 2010 21:58:12 +0000 (14:58 -0700)] 
Fix open-vm-tools build

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoMake change notification pretty.
VMware, Inc [Thu, 17 Jun 2010 21:57:49 +0000 (14:57 -0700)] 
Make change notification pretty.

I am splitting the original change notification change because there are
just too many minor changes that needs to be done with the existing code.
This will make things easy to review. Hopefully.

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

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoWe've discovered a race in MXUserWaitCondVar, where waiting threads
VMware, Inc [Thu, 17 Jun 2010 21:56:45 +0000 (14:56 -0700)] 
We've discovered a race in MXUserWaitCondVar, where waiting threads
may miss a signal. Backing out until this is addressed.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoFix a couple of gsource handle leaks in the vmbackup plugin.
VMware, Inc [Thu, 17 Jun 2010 21:56:27 +0000 (14:56 -0700)] 
Fix a couple of gsource handle leaks in the vmbackup plugin.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoSoft power ops: changes for Mac OS X support.
VMware, Inc [Thu, 17 Jun 2010 21:56:08 +0000 (14:56 -0700)] 
Soft power ops: changes for Mac OS X support.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoHGFS: Shared memory support for linux guest
VMware, Inc [Thu, 17 Jun 2010 21:55:40 +0000 (14:55 -0700)] 
HGFS: Shared memory support for linux guest

Support for Async operations is now present. We use shared memory mechanism
to notify guest.

Shared memory support is very minimalistic. There is no flow control
here. Here is how it works --

1) Guest on startup allocates 16 pages and sends it to the hgfs Server.
Number of pages are fixed in the system. Guest always recycles between
those pages.
2) Host will use up those pages and send notifications. When host wants to send stuff
and it doesn't find memory, it sends datagram to the guest asking for more memory.
3) Guest happily obliges and sends number of free pages.
4) This process repeats.

Note that one page can contain many requests while one request can
span many pages. When request spans many pages we need to chain
pages together. Here is how page chaining looks -

First iov from which the chain starts sets chain (Bool) to true.
Last iov sets chain to false. First iov len contains total length
of the chain.

Minor -
While I was here - I did some minor cleanup to remove HgfsReceiveFlags that
nobody was using.

Note that currently all the requests are still processed sync. I have added
terminate session request so that host doesn't touch any guest pages after
the module is unloaded or it will end up corrupting guest.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoDelete vsockLookup.
VMware, Inc [Thu, 17 Jun 2010 21:54:16 +0000 (14:54 -0700)] 
Delete vsockLookup.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoInternal branch sync. Included in this change:
VMware, Inc [Thu, 17 Jun 2010 21:53:17 +0000 (14:53 -0700)] 
Internal branch sync. Included in this change:

. fix bug where VM was unable to grab input after GH DnD.

. Unity changes that don't affect open-vm-tools.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoBackout previous change.
VMware, Inc [Thu, 17 Jun 2010 21:43:18 +0000 (14:43 -0700)] 
Backout previous change.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoThread fixes for HostinfoOSVersionInit
VMware, Inc [Thu, 17 Jun 2010 21:42:25 +0000 (14:42 -0700)] 
Thread fixes for HostinfoOSVersionInit

Make HostinfoOSVersionInit atomic.  Clean it up some
while we're in there.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoThread fix for TimeUtil_DaysAdd
VMware, Inc [Thu, 17 Jun 2010 21:42:07 +0000 (14:42 -0700)] 
Thread fix for TimeUtil_DaysAdd

TimeUtil_DaysAdd was not thread safe because it kept the number
of days in each of the 12 months in a static array, and set the
value for February based on whether the function was operating
on a common year or a leap year.  A simple fix is to keep two
arrays, one for common years and another for leap years.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoOVT: remove Linux vmmemctl (balloon) driver
VMware, Inc [Thu, 17 Jun 2010 21:41:49 +0000 (14:41 -0700)] 
OVT: remove Linux vmmemctl (balloon) driver

Now that the balloon driver has been accepted upstream there is
no need to distribute it in open-vm-tools package.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agorestore condvar related lock changes
VMware, Inc [Thu, 17 Jun 2010 21:41:28 +0000 (14:41 -0700)] 
restore condvar related lock changes

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agolib/misc: more cleanup
VMware, Inc [Thu, 17 Jun 2010 21:41:14 +0000 (14:41 -0700)] 
lib/misc: more cleanup

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agolib/misc: a little cleanup
VMware, Inc [Thu, 17 Jun 2010 21:41:04 +0000 (14:41 -0700)] 
lib/misc: a little cleanup

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agolib/misc: more review comments
VMware, Inc [Thu, 17 Jun 2010 21:40:55 +0000 (14:40 -0700)] 
lib/misc: more review comments

Cache the mac timer scaling information; make things have a little
bit lower overhead.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agolib/misc: more review comments
VMware, Inc [Thu, 17 Jun 2010 21:40:35 +0000 (14:40 -0700)] 
lib/misc: more review comments

Picking up even more review comments...

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agolib/lock: pick up review comments
VMware, Inc [Thu, 17 Jun 2010 21:40:26 +0000 (14:40 -0700)] 
lib/lock: pick up review comments

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agolib/misc: hostinfo timer functions
VMware, Inc [Thu, 17 Jun 2010 21:40:15 +0000 (14:40 -0700)] 
lib/misc: hostinfo timer functions

Pick up a bunch of comments.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agotemp revert of various ulCondVar usages/changes
VMware, Inc [Thu, 17 Jun 2010 21:39:57 +0000 (14:39 -0700)] 
temp revert of various ulCondVar usages/changes

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agolib/lock: MXUser needs to use the lib/thread watchdog
VMware, Inc [Thu, 17 Jun 2010 21:39:32 +0000 (14:39 -0700)] 
lib/lock: MXUser needs to use the lib/thread watchdog

On long MXUser condVar wait operations periodically call the
lib/thread watchdog so as to allow panics and crashes to be caught.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agolib/thread and lib/lock: cleanup the cooperation
VMware, Inc [Thu, 17 Jun 2010 21:37:51 +0000 (14:37 -0700)] 
lib/thread and lib/lock: cleanup the cooperation

The watchdog routine needs to be used by both MX and MXUser
however planting the callback in only done in userland - move
ownership of the callback (and planting it) to MXUser.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agolib/lock: use the new lock routines
VMware, Inc [Thu, 17 Jun 2010 21:37:31 +0000 (14:37 -0700)] 
lib/lock: use the new lock routines

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agolib/misc: create a hostinfo time base with ns units
VMware, Inc [Thu, 17 Jun 2010 21:37:22 +0000 (14:37 -0700)] 
lib/misc: create a hostinfo time base with ns units

Provide nanosecond reporting routines; microseconds are getting a bit
"long in the tooth" for some timing applications. Refactor the
existing code to have the lowest overhead possible based on the
platform. Obtain the best we can from the existing clock sources.

The quest for better timer sources will come next...

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:36:57 +0000 (14:36 -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: establish the condVar idiom
VMware, Inc [Thu, 17 Jun 2010 21:35:28 +0000 (14:35 -0700)] 
lib/lock: establish the condVar idiom

A condVar should be destroyed before the lock it is associated with.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoAdd a "VMX logger" to Tools.
VMware, Inc [Thu, 17 Jun 2010 21:35:14 +0000 (14:35 -0700)] 
Add a "VMX logger" to Tools.

This logger using the "log" RPC to log to the host's vmware.log. It's
useful when enabling file logging in the guest is not possible (such as
for backup tests) or to make it easier to collect logs when debugging
some VMX -> Tools interaction.

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:34:42 +0000 (14:34 -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: fix an ifdef
VMware, Inc [Thu, 17 Jun 2010 21:34:21 +0000 (14:34 -0700)] 
lib/lock: fix an ifdef

An ifdef sneeked in that is not in the style of the rest of the code.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agominor lock-related cleanup
VMware, Inc [Thu, 17 Jun 2010 21:34:08 +0000 (14:34 -0700)] 
minor lock-related cleanup

As a result of review comments that didn't make it in time for the previous checkin.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoUse the new bit function names.
VMware, Inc [Thu, 17 Jun 2010 21:33:53 +0000 (14:33 -0700)] 
Use the new bit function names.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agomore bora/lib ranking, condvar usage
VMware, Inc [Thu, 17 Jun 2010 21:33:18 +0000 (14:33 -0700)] 
more bora/lib ranking, condvar usage

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agolib/lock: maintain the lock header information for condVars
VMware, Inc [Thu, 17 Jun 2010 21:32:54 +0000 (14:32 -0700)] 
lib/lock: maintain the lock header information for condVars

This makes the code cleaner and it will be possible to look for
other run time conditions if we decide to do so.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agolib/lock: generalize MXUser condVar support
VMware, Inc [Thu, 17 Jun 2010 21:32:28 +0000 (14:32 -0700)] 
lib/lock: generalize MXUser condVar support

The MXUser condVar code dealt only with a lock count of 1,
something that is OK for exclusive locks and recursive locks with
that lock count but not correct for recursive locks in the general
case. Fix this by properly preserving the lock count.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agovmmemctl: remove some old FreeBSD code
VMware, Inc [Thu, 17 Jun 2010 21:32:15 +0000 (14:32 -0700)] 
vmmemctl: remove some old FreeBSD code

We are not shipping modules for FreeBSD 5 so no need to handle
anything lower either.

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

Finally getting around to simplifying the logic based on review
comments.

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:31:14 +0000 (14:31 -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: add an assert
VMware, Inc [Thu, 17 Jun 2010 21:30:43 +0000 (14:30 -0700)] 
lib/lock: add an assert

No condVar operations with bound locks

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agolib/lock: a bit of cleanup
VMware, Inc [Thu, 17 Jun 2010 21:30:32 +0000 (14:30 -0700)] 
lib/lock: a bit of cleanup

Use a few defines.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agolib/lock: pick up a few changes from review comments
VMware, Inc [Thu, 17 Jun 2010 21:30:23 +0000 (14:30 -0700)] 
lib/lock: pick up a few changes from review comments

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoReplace RpcOut API with RpcChannel_Send() in vmtoolsd plugins.
VMware, Inc [Thu, 17 Jun 2010 21:30:02 +0000 (14:30 -0700)] 
Replace RpcOut API with RpcChannel_Send() in vmtoolsd plugins.

This doesn't cover all existing cases, but the others can't switch just
yet.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoDon't use GHI XDR definitions in vmtoolsd test code.
VMware, Inc [Thu, 17 Jun 2010 21:29:52 +0000 (14:29 -0700)] 
Don't use GHI XDR definitions in vmtoolsd test code.

Use the test's own XDR structures instead, and avoid exporting the GHI
functions in vmtoolslib.

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

Pass the timeout value through now that timeouts are possible

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agolib/lock: give each lock type a unique signature
VMware, Inc [Thu, 17 Jun 2010 21:29:23 +0000 (14:29 -0700)] 
lib/lock: give each lock type a unique signature

The signature word in the MXUser header had the same value for all
of the lock types. Make the signature unique to each lock type. This
helps, a bit, when poking around memory.

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:29:11 +0000 (14:29 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

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

Caught a typo...

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

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

Typo...

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agolib/lock: refactor condVar code before large change
VMware, Inc [Thu, 17 Jun 2010 21:28:13 +0000 (14:28 -0700)] 
lib/lock: refactor condVar code before large change

Refactored the MXUser condVar code to make it much easier to
read and maintain. Doing this before a big change so as to make
the change and code read easy.

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

The assertion with the tryLock failed... in the wrong place.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agolib/lock: lock creation error on XP
VMware, Inc [Thu, 17 Jun 2010 21:27:36 +0000 (14:27 -0700)] 
lib/lock: lock creation error on XP

The code needs to return an error number, not a bool.

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

Undo an earlier change since the code isn't headed in the way first
anticipated.

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

If an attempt was made to acquire the lock involved
with a condVar (on one thread) while the lock had been freed as part
of a condVar wait (on another thread), an assertion failure would
occur on the acquisition.

The problem is caused by the implicit unlocking and relocking of the
lock involved with the condVar. The MXUser lock reference count was
not in sync with the locked/unlocked state. Decrement and increment
the reference count before/after the native condVar wait.

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

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

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

The MXUser RW lock release code has a bug in it... it asserts on
an unexpected reference count. The bug was caused by not decrementing
the reference count before the assertion.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agolib/lock: cleanup/simplify before change
VMware, Inc [Thu, 17 Jun 2010 21:26:05 +0000 (14:26 -0700)] 
lib/lock: cleanup/simplify before change

Clean up a bit before a change to fix a bug

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:25:50 +0000 (14:25 -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:25:38 +0000 (14:25 -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:25:09 +0000 (14:25 -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:24:49 +0000 (14:24 -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: cleanup
VMware, Inc [Thu, 17 Jun 2010 21:24:26 +0000 (14:24 -0700)] 
lib/lock: cleanup

Cleanup a bit...

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agolib/lock: minor cleanup and optimization
VMware, Inc [Thu, 17 Jun 2010 21:23:24 +0000 (14:23 -0700)] 
lib/lock: minor cleanup and optimization

Use the Windows native "lock" directly... it's a bit faster

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoRemove some old bit functions.
VMware, Inc [Thu, 17 Jun 2010 21:23:03 +0000 (14:23 -0700)] 
Remove some old bit functions.

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:21:31 +0000 (14:21 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

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