]> git.ipfire.org Git - thirdparty/open-vm-tools.git/log
thirdparty/open-vm-tools.git
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>
16 years agoopen-vm-tools: check for libproc.so, scrnsaver.h
VMware, Inc [Thu, 17 Dec 2009 21:41:14 +0000 (13:41 -0800)] 
open-vm-tools: check for libproc.so, scrnsaver.h

. some newer distros apparently started to ship procps 3.2.8, so try
to link against libproc.so and, only if that fails, try
libproc-3.2.7.so. For other cases the user will have to manually
intervene.

. check for scrnsaver.h being there since our code includes it (and
add a macro that simplifies doing that check for X11 libraries).

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoFix minor memory leak in guest info plugin.
VMware, Inc [Thu, 17 Dec 2009 21:40:43 +0000 (13:40 -0800)] 
Fix minor memory leak in guest info plugin.

This only affected the case when the plugin decided not to be loaded
(e.g. when running on a boot camp partition running on the bare metal).
The service will quit soon in that case, but it's still good to have the
code do the right thing.

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

. Hostinfo: Identify CentOS and Oracle Enterprise Linux distros.

. Fix race condition with RPC callback registration and remove unnecessary
  SetPrinter functionality.

. Get rid of dependency on X86 architecture for vmxnet3.

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

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoThis change was reviewed as multiple pieces but is being checked in as one big chunk
VMware, Inc [Thu, 17 Dec 2009 21:31:13 +0000 (13:31 -0800)] 
This change was reviewed as multiple pieces but is being checked in as one big chunk
to prevent build breaks since parts depend on other pieces.

Add VMCILOG to the guest

The guest and the host crosstalk drivers have different notions of logging macros. Really we should unify them.
To keep this change from getting any larger I have instead added a temporary VMCILOG macro to the guest.
====
Add VMCI_CanScheduleDelayedWork and VMCI_ScheduleDelayedWork to all VMCI platforms

This change is a precursor to supporting VMCI delayed event callbacks. It provides basic
infrastructure to ask that a callback be scheduled and run in a delayed work context.
Right now this is only implemented on linux and vmkernel. Other platforms currently provide
dummy implementations and return VMCI_ScheduleDelayedWork() as FALSE.
====
Add support for delayed linux VMCI events.

This is the intial change to add delayed event callbacks to vmciEvent.c.
In particular this change:
1. Defines a flags field and requires that all callers pass in delayed or none flags when calling
VMCIEvent_RegisterSubscription.
2. Changes the lock rank of the event callbacks to be above queuepairs.
3. Change the VMCIEvent cleanup routine to require all VMCI events to be unregsitered before the module is unloaded.
4. Reference count the individual vmci event subscriptions so they don't go away while callbacks can be firing.
5. Wait for all callbacks to fire before allowing unsubscription to continue.
6. Modify VMCIEvent_Dispatch to allow callbacks to be fired in a delayed work context with no locks held.
====
Pull in vmciEvent.c changes from the host into vmciEvent.c

This change is a setup change to unify vmciEvent.c on the guest and the host module. This change just pulls in
host side vmciEvent.c code into the guest. Followup changes will make this code actually work.
====
Remove HelperQueue VMKERNEL call from vmciEvent.c.

Previous to this change the VMkernel went through the vmci event subscriber array in a helper world because it
wanted to take the subscriber array lock which was lower rank than the queuepair lock. Now that the VMK always uses
the delayed work mechanism ... this is no longer needed.
====
Make vmkernel work with the new vmciEvent code.

This modifies the core vmkernel vmci interface code to use the new vmci event flag field. This lets
vmkernel continue to compile and lets external (to the module) vmkernel clients use vmci if they desire.
====
Merge bora-vmsoft vmciEvent.c into bora vmciEvent.c

Now that the vmciEvent code is in a state where it can work on both the guest and the host, merge the guest
vmciEvent.c code to be 100% the same as the host code. In the future we can consider just using the same file
for the host and guest.
====
Add extra VMCIEvent_Subscribe param to vsock linux build.

This change just modifies the linux vsock code to pass in the new required param for Event subscribe to existing
calls. This should not change anything about how linux vsock actually works.
====
Register for VMCI_EVENT_CTX_ID_UPDATE

This change makes linux vsock register for VMCI_EVENT_CTX_ID_UPDATE and use the new vmciEvent delayed callback code.
Right now stream sockets break if a vm's cid ever changes and vsock is not reloaded (new stream sockets will not
succeed in being connected). This change fixes that by registering for the VMCI_EVENT_CTX_ID_UPDATE call and
reregistering the datagram handler for the control port.
====
Make common vsock code pass in the new argument to VMCIEvent_Subscribe

This change is required to have the common vsock code continue building. There should be no functional changes
here.
====

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoLinux HGFS: Fix warnings when building kernel module
VMware, Inc [Thu, 17 Dec 2009 21:30:24 +0000 (13:30 -0800)] 
Linux HGFS: Fix warnings when building kernel module

Fix the following compiler warnings when buildling vmhgfs module:

bora-vmsoft/hgfs/linux/fsutil.c: In function 'HgfsBuildPath':
bora-vmsoft/hgfs/linux/fsutil.c:1059: warning: pointer targets in assignment differ in signedness

bora-vmsoft/hgfs/linux/tcp.c: In function 'HgfsSocketDataReady':
bora-vmsoft/hgfs/linux/tcp.c:128: warning: pointer targets in passing argument 2 of 'set_bit' differ in signedness

bora-vmsoft/hgfs/linux/tcp.c: In function 'HgfsSocketChannelSend':
bora-vmsoft/hgfs/linux/tcp.c:807: warning: pointer targets in passing argument 2 of 'HgfsSocketSendMsg' differ in signe

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoRemove MSI depndency on kernel version.
VMware, Inc [Thu, 17 Dec 2009 21:30:02 +0000 (13:30 -0800)] 
Remove MSI depndency on kernel version.

No need to worry about the suboptimal MSI implementation in older
kernels. Now that we only build for 2.6.16 and higher, get rid of those
MSI dependencies.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoUse kernel pages for SGL's.
VMware, Inc [Thu, 17 Dec 2009 21:29:40 +0000 (13:29 -0800)] 
Use kernel pages for SGL's.

SGL pages don't need to reside in the scarce DMA addressable space, we
can instead allocate generic kernel pages for these and use the
map/unmap API's to consistently access these pages.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoUse pci_io(un)map API's
VMware, Inc [Thu, 17 Dec 2009 21:29:12 +0000 (13:29 -0800)] 
Use pci_io(un)map API's

Use the standard iomap API's for PCI devices.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoReduce typedef usage.
VMware, Inc [Thu, 17 Dec 2009 21:28:53 +0000 (13:28 -0800)] 
Reduce typedef usage.

Userdefined typedef's are considered evil, atleast for Linux drivers.
So use the struct keyword. While at it, also cleaned up some indentation
glitches.

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:28:01 +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 agoUpdating open-vm-tools version for release 2009.11.16-210370. 2009.11.16-210370
VMware, Inc [Tue, 17 Nov 2009 23:17:50 +0000 (15:17 -0800)] 
Updating open-vm-tools version for release 2009.11.16-210370.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoExpand "non-commsrc" in comments.
VMware, Inc [Tue, 17 Nov 2009 22:14:36 +0000 (14:14 -0800)] 
Expand "non-commsrc" in comments.

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

. Add a module parameter to vmxnet3_shm to adjust the size of the shared
  memory pool.

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

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoFix the build.
VMware, Inc [Tue, 17 Nov 2009 22:11:42 +0000 (14:11 -0800)] 
Fix the build.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoGuestInfo: Fix a botched merge.
VMware, Inc [Tue, 17 Nov 2009 22:11:19 +0000 (14:11 -0800)] 
GuestInfo: Fix a botched merge.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoClean up the Tools Core "utils" API.
VMware, Inc [Tue, 17 Nov 2009 22:11:10 +0000 (14:11 -0800)] 
Clean up the Tools Core "utils" API.

Get rid of a bunch of functions that were either sort of redundant or
not really needed at all. Now an app that needs to use the vmtools.dll
logging just needs to call two functions:

VMTools_LoadConfig() (or load the config data some other way)
VMTools_ConfigLogging()

And those same functions provide all the functionality previously offered
by the other, now defunt, functions.

Change all call sites to use the new functions.

Also, two minor improvements to the library:
. the logging subsystem is not activated by default when a process loads
the library. This makes it opt-in (users have to explicitly call
VMTools_ConfigLogging() to enable the vmtools.dll logging code).
. the log reset code now handles keeping log files opened also for
sub-domains (previously only the default log domain would get that
treatment).

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoWiper: Recognize EXT4.
VMware, Inc [Tue, 17 Nov 2009 22:10:54 +0000 (14:10 -0800)] 
Wiper: Recognize EXT4.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoMinor improvements to vmtoolsd and public interfaces.
VMware, Inc [Tue, 17 Nov 2009 22:10:19 +0000 (14:10 -0800)] 
Minor improvements to vmtoolsd and public interfaces.

. constify ToolsAppCapability::name.
. skip files that don't end with the platform's shared library extension
when loading plugins
. compile with "-subsystem:windows" on Win32; to allow logging to a
console, add new command line flag that attaches to the parent's
console and redirects standard output streams.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoIntroduce COMMUNITY_SOURCE_AMD_SECRET.
VMware, Inc [Tue, 17 Nov 2009 22:10:00 +0000 (14:10 -0800)] 
Introduce COMMUNITY_SOURCE_AMD_SECRET.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Tue, 17 Nov 2009 22:09:01 +0000 (14:09 -0800)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoGuestInfo: Fix NicInfo caching. [1/2]
VMware, Inc [Tue, 17 Nov 2009 22:08:31 +0000 (14:08 -0800)] 
GuestInfo: Fix NicInfo caching. [1/2]

NicInfoV3 introduced considerably more complex XDR types.  Comparing
said types is non-trivial, so this change introduces "isEqual" routines
for each of the new types.

The IsEqual code bodies are similar to some of the existing test code,
and the latter will be refactored to use these soon.

I also have a bunch of unit tests coming in a second change.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoVmblock-FUSE: respond to reads from control file
VMware, Inc [Tue, 17 Nov 2009 22:08:08 +0000 (14:08 -0800)] 
Vmblock-FUSE: respond to reads from control file

Because we can't implement the same control mechanism in FUSE-based
vmblock module as in-kernle one (FreeBSD and Solaris use ioctl and
we don't have a device node here) userspace needs to be able to
detect the kind of vmblock being used and adjust accordingly. Change
vmblock-fuse to allow reading from the control file and respond with
a pre-defined string ("I am VMBLOCK-FUSE").

Ths change complements change 816902 that implemented fuse/legacy
selector in DND code.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoGuestDiskInfo - small API cleanup
VMware, Inc [Tue, 17 Nov 2009 22:06:45 +0000 (14:06 -0800)] 
GuestDiskInfo - small API cleanup

Provide GuestInfo_InitDiskInfo(), GuestInfo_CopyDiskInfo() and
GuestInfo_FreeDiskInfo() instead of having users muck with the data,
manually freeing it. Copying will not re-allocate memoty if number
of entries is the same. Also make GuestInfo_GetDiskInfo() cleanup
after itself in case of failure.
Reset cached disk info after resume to make sure we send the most
up-to-date information to host.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoVmblock test: fix to work with fuse-based vmblock module
VMware, Inc [Tue, 17 Nov 2009 22:06:35 +0000 (14:06 -0800)] 
Vmblock test: fix to work with fuse-based vmblock module

We need to adjust the path to blocked filesystem when using FUSE.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Tue, 17 Nov 2009 22:06:22 +0000 (14:06 -0800)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoXdrUtil: Add optional string, opaque field macros.
VMware, Inc [Tue, 17 Nov 2009 22:05:48 +0000 (14:05 -0800)] 
XdrUtil: Add optional string, opaque field macros.

During the NicInfoV3 mess, it was a fairly common operation to have to
assign arbitrary data to optional string, opaque, and optional opaque
fields.  This change introduces a few macros which make it a little easier
to do just that.

Not sure that I'm happy with them, but they get the job done for initializers
used in test code.

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

. Unity/X11: Better handle plain unmapping, new window creation.

. Fix unchecked returns in /lib/misc/posixPosix.c.

. Adjust some assignment operators to allow copy elision.

. Don't initialize resolution set plugin if we are not running in a VM.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoInternal branch sync. Included in this change:
VMware, Inc [Tue, 17 Nov 2009 21:56:45 +0000 (13:56 -0800)] 
Internal branch sync. Included in this change:

. Fix probable memory leaks in vmxnet2 FreeBSD driver.

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

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoPosix Hostinfo_GetOSName fixes.
VMware, Inc [Tue, 17 Nov 2009 21:54:30 +0000 (13:54 -0800)] 
Posix Hostinfo_GetOSName fixes.

1.  NUL-terminate osNameFull.
2.  Insert a space between uts.sysname & uts.release  (i.e., report
Linux 2.6.18 instead of Linux2.6.18).
3.  When setting the "other24linux" or "other26linux" defaults, make the
decision based on uts.release /starting with/ 2.4 or 2.6.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoTools API: be nice to C++ users.
VMware, Inc [Tue, 17 Nov 2009 21:54:15 +0000 (13:54 -0800)] 
Tools API: be nice to C++ users.

Automatically wrap function declarations in 'extern "C"'. Also remove
a check for a "magic" macro we were using to protect against misuses
of the rpcChannel library (other things will break if you try to
compile the rpcChannel without that macro; users shouldn't need to worry
about it).

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoChange xxx_GetAsString return value to be const char*.
VMware, Inc [Tue, 17 Nov 2009 21:53:59 +0000 (13:53 -0800)] 
Change xxx_GetAsString return value to be const char*.

xxx_GetAsString() returns string which should not be freeed().
Let's make it clear by returning 'const char*' instead of 'char*'.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoFix build bustage.
VMware, Inc [Tue, 17 Nov 2009 21:53:35 +0000 (13:53 -0800)] 
Fix build bustage.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoAdd versioning information for resolutionSet plugin.
VMware, Inc [Tue, 17 Nov 2009 21:53:16 +0000 (13:53 -0800)] 
Add versioning information for resolutionSet plugin.

Added rc file for windows, incorporated into build.
Added embed_version.h for all platforms except Mac, using hgfsServer
as an example for the change.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoMake StrUtil_SectorToCapacityType more stringent about suffixes
VMware, Inc [Tue, 17 Nov 2009 21:53:01 +0000 (13:53 -0800)] 
Make StrUtil_SectorToCapacityType more stringent about suffixes

Let's change the behavior of this function so that "bad" suffixes
are treated as errors (they were previously ignored).

This change also fixes an overflow, without which I couldn't create
a 1 TB disk.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Tue, 17 Nov 2009 21:52:37 +0000 (13:52 -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 [Tue, 17 Nov 2009 21:52:05 +0000 (13:52 -0800)] 
Internal branch sync. Included in this change:

. Handle ethtool CSO operations in vmxnet2.

. Sync vmxnet3 driver with upstreamed version.

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

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoRe-organize the Tools Core public headers (2/2).
VMware, Inc [Tue, 17 Nov 2009 21:46:28 +0000 (13:46 -0800)] 
Re-organize the Tools Core public headers (2/2).

Fix all files that reference the old headers. No real code changes
here.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoRe-organize the Tools Core public headers (1/2).
VMware, Inc [Tue, 17 Nov 2009 21:46:11 +0000 (13:46 -0800)] 
Re-organize the Tools Core public headers (1/2).

These headers will form the base of the public Tools Core interface, so
they need to be moved to the "fully qualified" location.

This change just moves the headers to the new location. (For the
perforce-minded folks, I am branching / editing the new files, so
history is kept as far as where the contents come from.)

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Tue, 17 Nov 2009 21:45:40 +0000 (13:45 -0800)] 
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 of tools.
VMware, Inc [Tue, 17 Nov 2009 21:45:01 +0000 (13:45 -0800)] 
Fix release build of tools.

ASSERTS + release build = unused variable...

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoFix a few issues with app provider registration in vmtoolsd.
VMware, Inc [Tue, 17 Nov 2009 21:44:40 +0000 (13:44 -0800)] 
Fix a few issues with app provider registration in vmtoolsd.

. create a fake provider for the TOOLS_APP_PROVIDER type so that when
registering a provider there is no NULL dereference.
. correctly detect duplicate providers by looking at the list of existing
providers.
. if a provider is not found when registering an app, print a log message
and continue trying other app regs.
. add a provider reg to the test plugin to make sure the above works.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoReject non-UTF8 user/pass.
VMware, Inc [Tue, 17 Nov 2009 21:44:14 +0000 (13:44 -0800)] 
Reject non-UTF8 user/pass.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoBump the default QP size to 256 KB
VMware, Inc [Tue, 17 Nov 2009 21:43:30 +0000 (13:43 -0800)] 
Bump the default QP size to 256 KB

Our perf results have shown that 256 KB QPs perform much better than
64KB QPs in many situations. Switch the default QP size to 256 KB.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoIntroduce loglevels to linux vsock
VMware, Inc [Tue, 17 Nov 2009 21:43:17 +0000 (13:43 -0800)] 
Introduce loglevels to linux vsock

This change introduces LOGLEVEL_THRESHOLD as a module param to linux vsock.
By default we no longer print all vsock packets.

Also some minor cleanup (make our other module param use the same case and
remove some pre-2.6.9 code)

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoGuestInfo and friends: Plug some leaks.
VMware, Inc [Tue, 17 Nov 2009 21:42:47 +0000 (13:42 -0800)] 
GuestInfo and friends:  Plug some leaks.

When finished with a GLib IO channel, decrement its reference count
via g_io_channel_unref().  Do NOT simply g_free() it.  This is the
biggest source of leakaged addressed in this changeset.

Also noticed that we were abandoning XDR structures during V3-to-V2
NicInfo conversion.  Fixed.

And, finally, lib/slashProc was leaking **file descriptors**.  WTF.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoVmtoolsd: fix small memory leak
VMware, Inc [Tue, 17 Nov 2009 21:42:15 +0000 (13:42 -0800)] 
Vmtoolsd: fix small memory leak

After we collected all plugins in a given directory we were forgetting
to free the directory data causing small memory leak.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoUpdate Tools version.
VMware, Inc [Tue, 17 Nov 2009 21:41:59 +0000 (13:41 -0800)] 
Update Tools version.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoRemove vmware internal headers from rpcChannel.h.
VMware, Inc [Tue, 17 Nov 2009 21:41:37 +0000 (13:41 -0800)] 
Remove vmware internal headers from rpcChannel.h.

This header will be part of the Tools Core public headers and we don't
want to expose our internal headers through it. Replace the ASSERTS()
we have in the code with glib checks (that can be switched to asserts
at runtime).

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Tue, 17 Nov 2009 21:41:05 +0000 (13:41 -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 [Tue, 17 Nov 2009 21:40:19 +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 agoInternal branch sync. Included in this change:
VMware, Inc [Tue, 17 Nov 2009 21:38:58 +0000 (13:38 -0800)] 
Internal branch sync. Included in this change:

. Attempting to get size of a device in certain Linuxes hangs. So, don't.

. Check user->kernel tx ring desc availability. Also clear partial_tx if
  userspace writes too many frags instead of panicking.

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

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoRemove vmrpcdbg.h's dependency on util.h.
VMware, Inc [Tue, 17 Nov 2009 21:31:43 +0000 (13:31 -0800)] 
Remove vmrpcdbg.h's dependency on util.h.

This is (well, will be) a public header and should not depend on our
internal headers. So change the macro that uses util.h into a function
so we hide the dependency from consumers (and fix the few existing uses).

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoMove guestInfo library function definitions to bora-vmsoft.
VMware, Inc [Tue, 17 Nov 2009 21:31:14 +0000 (13:31 -0800)] 
Move guestInfo library function definitions to bora-vmsoft.

These functions are not part of the public interface defined in
the public guestInfo.h 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 [Tue, 17 Nov 2009 21:30:53 +0000 (13:30 -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 [Tue, 17 Nov 2009 21:30:15 +0000 (13:30 -0800)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoUse WinReg_GetSZ() to get the Tools install path.
VMware, Inc [Tue, 17 Nov 2009 21:29:38 +0000 (13:29 -0800)] 
Use WinReg_GetSZ() to get the Tools install path.

RegOpenKey() tries to open the registry key with too many permissions,
which is not allowed for all users. GetSZ() uses RegOpenKeyEx() with
just the needed permission to read the value, which should work for
more users.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Tue, 17 Nov 2009 21:29:06 +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 agoRemove rpchChannel.h's dependendy on rpcin.h.
VMware, Inc [Tue, 17 Nov 2009 21:27:24 +0000 (13:27 -0800)] 
Remove rpchChannel.h's dependendy on rpcin.h.

rpcChannel.h is part of the "public" tools core API, and shouldn't expose
internal APIs (such as those in rpcin.h). This has the downside of having
to duplicate some definitions from rpcin.h, since we still have code that
uses the rpcin library directly.

This change also standardizes rpcChannel.h's interface to use glib types
and not VMware types. This is the cause of most of the churn in this
change (Bool -> gboolean), and also required the definition of a new type
(RpcInRet) to be used while we still have code that needs to be compatible
both with vmtoolsd and vmware-user; this type can (and should) go away
once vmware-user is deprecated.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoRename nested paging controls
VMware, Inc [Tue, 17 Nov 2009 21:26:46 +0000 (13:26 -0800)] 
Rename nested paging controls

Instead of ENTER_VMM and EXIT_VMM, let's call these what they are:
RESTRICT_BACKDOOR and OPEN_BACKDOOR.  Given the more narrow usage, it
also makes sense to disable the nesting controls when
monitor_control.restrict_backdoor is set.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoRemove guestInfoServer.h, add guestInfoLib.h.
VMware, Inc [Tue, 17 Nov 2009 21:25:52 +0000 (13:25 -0800)] 
Remove guestInfoServer.h, add guestInfoLib.h.

The first one is a leftover from when the tools service was monolithic and
based on static libraries. The second one will hold declarations of functions
from the guestInfo library; later on, some declarations currently in
bora/public/guestInfo.h can be moved there.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoAdd unique MODULE_ALIAS to non-PCI linux drivers
VMware, Inc [Tue, 17 Nov 2009 21:25:23 +0000 (13:25 -0800)] 
Add unique MODULE_ALIAS to non-PCI linux drivers

To help installer figure out whether there is already a vendor-provided
kernel module (with potentially different name) that should not be
clobbered it was decided that we will use unique module alias string to
identify modules.

vmsync driver will not be upstreamed (newer kernels already have the
same functionality) and so is vmblock and thus are left alone.
vmxnet, vmxnet3, pvscsi and vmci are PCI drivers and don't require
artificial aliases.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoMove time sync-related functions to the time sync plugin.
VMware, Inc [Tue, 17 Nov 2009 21:24:43 +0000 (13:24 -0800)] 
Move time sync-related functions to the time sync plugin.

There's no use in having these functions in a public library, since they're
pretty much internal functions used by the time sync feature.

This change also cleans up a lot of the logging to avoid printing the
function name everywhere (since now the log statements are properly
identified by the timeSync log domain) and to log useful error messages
where they were missing.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoSave %rbx instead of %ebx
VMware, Inc [Tue, 17 Nov 2009 21:24:05 +0000 (13:24 -0800)] 
Save %rbx instead of %ebx

64bit environment must preserve whole %rbx, not just %ebx.  And
restrict workaround to gcc build 5493 only.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Tue, 17 Nov 2009 21:23:38 +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 agoRename unityPlatformWin32.c to have a .cpp suffix.
VMware, Inc [Tue, 17 Nov 2009 21:22:42 +0000 (13:22 -0800)] 
Rename unityPlatformWin32.c to have a .cpp suffix.

Add 'extern "C"' constructs where required for name mangling, and fix some (now required) type casts.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoRemove ifdefs on VMM64 from busmemInt.h and vm_basic_defs.h.
VMware, Inc [Tue, 17 Nov 2009 21:21:13 +0000 (13:21 -0800)] 
Remove ifdefs on VMM64 from busmemInt.h and vm_basic_defs.h.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoUpgrade tools at shutdown. This change is relevant to windows Os(es) Vista & up.
VMware, Inc [Tue, 17 Nov 2009 21:20:57 +0000 (13:20 -0800)] 
Upgrade tools at shutdown. This change is relevant to windows Os(es) Vista & up.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoAssign result of CPName_GetComponent to a signed variable.
VMware, Inc [Tue, 17 Nov 2009 21:19:57 +0000 (13:19 -0800)] 
Assign result of CPName_GetComponent to a signed variable.

This is a follow up change.  CPName_GetComponent returns -1 to report
an error thus it can't be assigned to a unsigned variable.
In the previous change most of the places where CPName_GetComponent was
assigned to a size_t variable were fixed however couple of places were missed.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoFix file names in source.
VMware, Inc [Tue, 17 Nov 2009 21:19:38 +0000 (13:19 -0800)] 
Fix file names in source.

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

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoUpdating open-vm-tools version for release 2009.10.15-201664. 2009.10.15-201664
VMware, Inc [Thu, 15 Oct 2009 22:16:22 +0000 (15:16 -0700)] 
Updating open-vm-tools version for release 2009.10.15-201664.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoStop failing every second command on pvscsi...
VMware, Inc [Thu, 15 Oct 2009 22:09:48 +0000 (15:09 -0700)] 
Stop failing every second command on pvscsi...

... and stop logging every command with KERN_ERR...  Let's revert
that part of max_cmd_len change.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoPrint default domain info when logging to shared handlers.
VMware, Inc [Thu, 15 Oct 2009 22:09:23 +0000 (15:09 -0700)] 
Print default domain info when logging to shared handlers.

This makes it easier to identify log messages printed to, let's say,
OutputDebugString, by also including the name of the application
logging the message (aside from the log domain that generated it).

Bonus: prefer glib functions in a few cases, get rid of ALL_LOG_LEVELS
since glib already provides that.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoDon't abort if log files can't be opened.
VMware, Inc [Thu, 15 Oct 2009 22:09:00 +0000 (15:09 -0700)] 
Don't abort if log files can't be opened.

glib's documentation lies about custom log handlers being able to handle
G_LOG_FLAG_RECURSION. It always uses its internal handler. So what happens is
that when our logging function calls g_warning() to log that a log file could
not be opened, it causes log recursion, which calls glib's internal handler,
which then aborts the process.

Avoid that by calling the default log handler directly instead of going
through the glib log system in that case.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoI had previously done a sandbox build, that succeeded,
VMware, Inc [Thu, 15 Oct 2009 22:08:21 +0000 (15:08 -0700)] 
I had previously done a sandbox build, that succeeded,
but I made a change for a review, and I didn't run another
sandbox build.  I'll back out my change and figure out how to fix
this.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoAdd log-only miRegionStr() utility to lib/region
VMware, Inc [Thu, 15 Oct 2009 22:07:44 +0000 (15:07 -0700)] 
Add log-only miRegionStr() utility to lib/region

I know lib/region is much-maligned and will go away, but I needed some
debugging besides the Warning()s provided by miPrintRegion(), so I
made this change.

With this change, I added a new VMX86_LOG-only function, miRegionStr(),
which allocates a string describing the contents of a region, and
stores the string inside the region structure.

When the region is changed or destroyed, the string is freed.

I consolidated the region initalization code duplicated in
miRegionCreate and miRegionInit into miRegionInit (I accidentally
modified only miRegionInit initially, and realized it was silly
to have two functions that do the exact same thing, so I figured
I'd save future coders the same trouble.)

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

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

. Refactoring of functions from lib/user to lib/misc.

. guest_os: Use the official defines instead of simple strings.

. code cleanup and code-style related changes.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoLinux HGFS: remove pre-2.6.9 compatibility code
VMware, Inc [Thu, 15 Oct 2009 21:35:54 +0000 (14:35 -0700)] 
Linux HGFS: remove pre-2.6.9 compatibility code

Drivers for older kernels come from lindrvlegacy component so
let's get rid of unneeded code on main branches.

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

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

. vmxnet3: free irqs & re-request them in suspend and resume respectively.

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

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoFix review comments on malloc-based aligned allocator
VMware, Inc [Thu, 15 Oct 2009 21:33:23 +0000 (14:33 -0700)] 
Fix review comments on malloc-based aligned allocator

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoChange for future ARM version of View Open Client (plus other small fixes)
VMware, Inc [Thu, 15 Oct 2009 21:32:48 +0000 (14:32 -0700)] 
Change for future ARM version of View Open Client (plus other small fixes)

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, 15 Oct 2009 21:31:44 +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 agoLinux HGFS: disable vsock transport by default
VMware, Inc [Thu, 15 Oct 2009 21:31:17 +0000 (14:31 -0700)] 
Linux HGFS: disable vsock transport by default

I got a bit carried away and left vsock transport enabled in
my previous commit, better keep it disabled for now.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoLinux HGFS: avoid unnecessary copying of buffers
VMware, Inc [Thu, 15 Oct 2009 21:31:03 +0000 (14:31 -0700)] 
Linux HGFS: avoid unnecessary copying of buffers

Instead of allocating additional memory chunk when sending over
TCP/Vsock channel and using local receiving buffer in TCP/Vsock
receiver thread implement per-transport memory allocation that
would allow allocating all necessary memory up-front. This also
lays ground work for allocating variable-size requests.

Additionally rework receiving thread logic so that we don't have
to wait for receive operation to time our before we can suspend
or shutdown TCP/Vsock channel.

Also move most of the duplicated channel handling logic in
generic transport code and reduce amount of locks (we really
only need channel lock).

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
16 years agoAdd Support for auto upgrading tools at windows xp shutdown.
VMware, Inc [Thu, 15 Oct 2009 21:30:26 +0000 (14:30 -0700)] 
Add Support for auto upgrading tools at windows xp shutdown.
This feature is only enabled if toolsd on the guest alerts the vmx that upgrade at shutdown is supported and if the policy is set to upgradeatpowercycle

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