]> git.ipfire.org Git - thirdparty/open-vm-tools.git/log
thirdparty/open-vm-tools.git
14 years agoTrivial fix to check for NULL pointer prior to strncmp
VMware, Inc [Tue, 13 Mar 2012 20:08:37 +0000 (13:08 -0700)] 
Trivial fix to check for NULL pointer prior to strncmp

The MSG_MAGICAL() macro needs to check for a NULL pointer
prior to calling strncmp on it.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoGive CursorPosition it's own loglevel
VMware, Inc [Tue, 13 Mar 2012 20:08:18 +0000 (13:08 -0700)] 
Give CursorPosition it's own loglevel

This change gives mksCursorPosition it's own loglevel to cut
down on traffic in the mks loglevel.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoStop flooding the event log with VMCI messages.
VMware, Inc [Tue, 13 Mar 2012 20:08:10 +0000 (13:08 -0700)] 
Stop flooding the event log with VMCI messages.

We should only be sending warnings or *really* important stuff to the
event log.  Turns out we were also sending some things to the log that
should really only go to the debugger, even in release builds!

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Tue, 13 Mar 2012 20:07:58 +0000 (13:07 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

VGAuth is already disabled for open-vm-tools.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoProvide GuestOS functionality for the scheme code.
VMware, Inc [Tue, 13 Mar 2012 20:07:40 +0000 (13:07 -0700)] 
Provide GuestOS functionality for the scheme code.

This attempts to provide the functionality used by monitor mode that
relates to guest OS types.  Doing this required re-jiggering some of
the enums and tables used by the guest_os so that we could get a hold
of them from the scheme code.  Mostly this involved making macro
generators that can then be instantiated in more than one place.  With
that in place the actual scheme implementation was pretty
straightforward.

One small unfortunate detail is that the strings used by the guestOS
code are often generated by letting the compiler concatenate two
strings together, but when using macros to pull this into scheme we
end up with two distinct strings.  This meant the scheme code had to
include a string-append to fix this for every entry even though most
didn't need it.  As one small bit of premature optimiztion, I modified
the implementation of string-append to special case the case of having
only one string.

I got scared away from table-ifying the strings themselves due to the
comments about GuestInfoGetOSName.

I also modified VMOvhdGetVMConfigStr slightly so that it can be passed
a NULL (or nil) default string.

Testing:
Played around with the new scheme functions and some logging.
Used some logging and some VMs from eregsuite to make sure the C version
of GuestOSID didn't give different results.
frobos (BT-intel, BT-amd, VT, SVM, EPT, RVI)

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoInternal branch sync. Included in this change:
VMware, Inc [Tue, 13 Mar 2012 20:07:11 +0000 (13:07 -0700)] 
Internal branch sync. Included in this change:

. VIX: plumb in VGAuth - Guest AUthentication (disabled for open-vm-tools
  though).

. hgfsServer: fix warning when compiling with clang.

. lib/file: don't drop advisory file locks during atomic file updates

. Added number of strings parameter to utf::string::split

. Fix restarting network on SLES11SP2

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Tue, 13 Mar 2012 20:06:45 +0000 (13:06 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agolib/file: consistent style
VMware, Inc [Tue, 13 Mar 2012 20:06:40 +0000 (13:06 -0700)] 
lib/file: consistent style

Move a few things to maintain consistent style.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoFix HGFS Server malformed header for change notification events sent to the clients.
VMware, Inc [Tue, 13 Mar 2012 20:06:33 +0000 (13:06 -0700)] 
Fix HGFS Server malformed header for change notification events sent to the clients.

The change notification events generate HgfsRequestNotifyV4 requests
to be sent to the clients to report changes. Unfortunately, the
server packed the header badly as it calculated the total packet
size incorrectly: the size of file name length field was added twice.

This means that the clients that handle notification events will
receive them prefixed with headers with the packetSize field greater
than the total packet size sent.

This was not noticed until now as the Windows HGFS client (currently
the only client enabled for change notification support) did not
validate the header from the server request correcty or thoroughly.
When this code was corrected, the notification requests failed with
a protocol error validating the header.

Furthermore, since this code has shipped in the HGFS server,
clients have to effectively ignore that field for these request
type.

Cleaned up some code, so that unused functions now used instead
of duplicating code.

Cleaned up some possible memory leaks too.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoUsing service name from find_networking_script for Sysv 'service' command.
VMware, Inc [Tue, 13 Mar 2012 20:06:05 +0000 (13:06 -0700)] 
Using service name from find_networking_script for Sysv 'service' command.

Directly runing init script to start network service fails on
distros like OpenSuse 12.1. so we need to first try Sysv's 'service'.

The currently approach of finding network service name
with 'service status xxx' will fail when network service is down (return 3),
as a result, suspend vm will fail. This patch fixes the issue by
using the network service name returned from find_networking_script, thus
avoided 'service status xxx' command.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agocompat_ethtool.h: adjust to newer kernel API
VMware, Inc [Tue, 13 Mar 2012 20:05:51 +0000 (13:05 -0700)] 
compat_ethtool.h: adjust to newer kernel API

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Tue, 13 Mar 2012 20:05:45 +0000 (13:05 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoDisable desktopEvents plugin when running in Windows on physical box
VMware, Inc [Tue, 13 Mar 2012 20:05:37 +0000 (13:05 -0700)] 
Disable desktopEvents plugin when running in Windows on physical box

... not that open-vm-tools expected to build on Windows.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agotoolbox-cmd: fix checking if wiper is enabled before shrinking
VMware, Inc [Tue, 13 Mar 2012 20:05:29 +0000 (13:05 -0700)] 
toolbox-cmd: fix checking if wiper is enabled before shrinking

We may not be allowed to shrink volume(s) even if wiper
functionality is available (because of presence of snapshots,
linked clones and other factors). Unfortunately CS 1409972
broke this and resulted in toolbox-cmd proceeding to wipe disk
only to be informed later that shrink could not be completed.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoVMCI: Add creation flags to vPageChannel
VMware, Inc [Tue, 13 Mar 2012 20:05:07 +0000 (13:05 -0700)] 
VMCI: Add creation flags to vPageChannel

This change adds flags to CreateInVM() for vPageChannel.

NOTIFY_ONLY replaces the notifyOnly boolean. DELAYED_CB
makes delayed callbacks an option (they used to be the default)
and PINNED makes pinned queuepairs an option. More explanation
in vmci_page_channel.h.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoUpdate Chinese/German/Japanese/Korean translations
VMware, Inc [Tue, 13 Mar 2012 20:04:43 +0000 (13:04 -0700)] 
Update Chinese/German/Japanese/Korean translations

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoAdd support for injecting ACPI tables to EFI
VMware, Inc [Tue, 13 Mar 2012 20:04:59 +0000 (13:04 -0700)] 
Add support for injecting ACPI tables to EFI

And support for removing ACPI tables from the guest for both EFI and
legacy BIOS.  And make both processes available in beta/release builds
too.  Only restricted functionality is setting vendor of the platform
in ACPI to match SLIC table - that works only in obj builds, or if
table comes from NX1000.

Both of the options are usable mainly for debugging, but we have had
requests in the past to be able to expose some random stuff via ACPI,
and this provides way how to do that.

Option for adding table(s) is acpi.addtable.filename -
- for example acpi.addtable.filename = "/.vmware/waet.tbl" to add ACPI
  tables from waet.tbl to the VM.

Option for removing table(s) is acpi.skiptables - and it lists table
signatures to remove - for example acpi.skiptables = "WAET,BOOT,HPET"
to remove WAET, BOOT, and HPET from the VM.

acpi.skiptables is processed before acpi.addtable, so you can use this
mechanism to replace arbitrary ACPI table - by blacklisting table
generated by the BIOS, and injecting tweaked replacement.

If you blacklist vital tables (RSDT, FACS, FADT, DSDT), you are on
your own.  Your guest probably won't boot, or maybe even firmware will
crash.

Making all this available for user required some additional changes in
slicvendor handling.  Most important is that exclusion is now per
vendor/device, rather than one VM on the box.  And in obj build this
restriction can be overriden with config option.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoReturn an error if the specified run script text is too large.
VMware, Inc [Tue, 13 Mar 2012 20:04:05 +0000 (13:04 -0700)] 
Return an error if the specified run script text is too large.

VixMsg_AllocRequestMsg() ASSERTs if the message size exceeds
VIX_COMMAND_MAX_REQUEST_SIZE. Made code changes to return an error
if the specified script text is too large.

Defined a new error code for this specific error case.
Added a remark in the documentation for VixVM_RunScriptInGuest() function.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoInternal branch sync. Included in this change:
VMware, Inc [Tue, 13 Mar 2012 20:03:53 +0000 (13:03 -0700)] 
Internal branch sync. Included in this change:

. cleanup in machineID.c code.

. more GOS indentifiers.

. updates to our trademark strings.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoFix FileLockIntrinsic to propagate the exclusivity flag
VMware, Inc [Tue, 13 Mar 2012 20:03:34 +0000 (13:03 -0700)] 
Fix FileLockIntrinsic to propagate the exclusivity flag

The exclusivity flag determines whether we ask for an exclusive
lock or a read-shared lock.  We had neglected to initialize it.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoVMCI: report VMCI_ERROR_DST_UNREACHABLE when VMX goes away
VMware, Inc [Tue, 13 Mar 2012 20:03:30 +0000 (13:03 -0700)] 
VMCI: report VMCI_ERROR_DST_UNREACHABLE when VMX goes away

When a VMCI driver with host side only attempts to route to an
unknown context ID, it reports
VMCI_ERROR_DEVICE_NOT_FOUND. Change that to
VMCI_ERROR_DST_UNREACHABLE, since that is more descriptive.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agolib/log: Clean up the Log Facility API
VMware, Inc [Tue, 13 Mar 2012 20:03:21 +0000 (13:03 -0700)] 
lib/log: Clean up the Log Facility API

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoFix for HGFS file perms when modified on the host
VMware, Inc [Tue, 13 Mar 2012 20:02:40 +0000 (13:02 -0700)] 
Fix for HGFS file perms when modified on the host

Saving and replacing a text file on the host's shared folder breaks
permissions in the guest. After a file on the host has been modified
listing the permissions from the guest results in:
the permissions will show up as ??????????????????

Incorporate changes from a user supplied patch to address this.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agolib/lock: Adjustable MXUser statistics overhead
VMware, Inc [Tue, 13 Mar 2012 20:02:30 +0000 (13:02 -0700)] 
lib/lock: Adjustable MXUser statistics overhead

Don't let the apparent size of this change put you off, this is almost
entirely a mechanical variable name change.

It turns out that the timer routines used my the MXUser statistics
system can be very expensive. Make the MXUser statistics overhead
tunable - off, light (basic statistics) and heavy (full).

"Typical" performance numbers (on my old AMD box running Linux)

mode 0 - 47 ns
mode 1 - 61 ns
mode 2 - MUCH larger. We've got an issue with timers that Kevin
filed a PR for.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Tue, 13 Mar 2012 20:02:22 +0000 (13:02 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoSlim down malloc/realloc/calloc/strdup wrappers in non-debug builds.
VMware, Inc [Tue, 13 Mar 2012 20:02:15 +0000 (13:02 -0700)] 
Slim down malloc/realloc/calloc/strdup wrappers in non-debug builds.

The way we wrap malloc, realloc, calloc, strdup etc.
causes us to pass a set of extra parameters into the
functions that do the actual work, including a bug number
(which is almost always -1), __FILE__ and __LINE__.

In the release vmx alone, this costs us approximately 55 KB
of extra text.

This change slims down the wrappers in non-debug builds so
that we avoid passing the extra arguments.

One can argue about exactly which build type(s) should use
slim wrappers; my proposal is anything without VMX86_DEBUG.

Kevin tells me that there is some sort of scenario due to how
gobuild works (for official? sandbox? only? builds) where we
may end up calling the non-debug version of a library from a
debug call site (you say huh? I say huh?!). To handle this case,
all build types contain both versions of the work functions
with differently suffixed names ("0" and "1").

I've also cleaned up the mksMemMgr code slightly. It no longer
directly accesses Util_SafeInternal functions, although it still
reaches into the internal malloc data structures in a not so nice
way.

Updated release vmx size data, accounting for the need to handle
the build weirdness:

text    data     bss     dec     hex filename
8926420  414752 1498600 10839772  a566dc  current wrapping
8871692  414752 1498600 10785044  a49114  leaner wrapping
------------------
saved: 54728 bytes
------------------

Tests: build WS obj/opt/release, boot/halt xp64 with obj and opt,
test-esx, sandbox wsall beta build.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoBump up the major version for VMCI/vSock.
VMware, Inc [Tue, 13 Mar 2012 20:02:00 +0000 (13:02 -0700)] 
Bump up the major version for VMCI/vSock.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoAdd AllocTrack_Init's allocation to its overhead value
VMware, Inc [Tue, 13 Mar 2012 20:01:48 +0000 (13:01 -0700)] 
Add AllocTrack_Init's allocation to its overhead value

AllocTrack_Init allocates some ring buffers and a hash table.  They
should be included in AllocTrack's overhead.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoHGFS: fix compilation issues on SLES11SP2
VMware, Inc [Tue, 13 Mar 2012 20:01:24 +0000 (13:01 -0700)] 
HGFS: fix compilation issues on SLES11SP2

"warning: initialization from incompatible pointer type"

fsync() method was originally changed in Linux v3.1, but SUSE backported
it to their 3.0 kernels.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoInternal branch sync. Included in this change:
VMware, Inc [Tue, 13 Mar 2012 20:01:18 +0000 (13:01 -0700)] 
Internal branch sync. Included in this change:

. hgfsServer: fix compiler warning.

. adjustments to allow using clang to compile certain code.

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

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoUpdate copyright to 2012
VMware, Inc [Tue, 13 Mar 2012 20:00:38 +0000 (13:00 -0700)] 
Update copyright to 2012

Happy new year, though this could have been done when the branch
was cut since afaik no product expected to ship in 2011.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Tue, 13 Mar 2012 20:00:34 +0000 (13:00 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agolib/lock: improve a log message
VMware, Inc [Tue, 13 Mar 2012 20:00:30 +0000 (13:00 -0700)] 
lib/lock: improve a log message

Had a strange failure and it would have been nice to know what the
executionID was. Output it now.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agolib/lock: reapply previously reverted commit
VMware, Inc [Tue, 13 Mar 2012 20:00:12 +0000 (13:00 -0700)] 
lib/lock: reapply previously reverted commit

Now that the big change is in, reapply this change.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agolib/lock: No need for stats all of the time
VMware, Inc [Tue, 13 Mar 2012 20:00:06 +0000 (13:00 -0700)] 
lib/lock: No need for stats all of the time

Way back when there was a concern that a release build might need
to be performance analyzed (for locks) in the field. At the time the
VMX wasn't considered to be a major bottleneck so the MXUser
statistics were built into every type of build.

Now a days, we have stats builds in the field when we need numbers
and the VMX is turning into a bottleneck. Remove the stats code
from all but stats builds. This saves ~7 clocks when acquiring
an uncontended exclusive lock in a release build.

The statsMem pointer is left in all builds to maintain the size of
the structure until will can find where a lock is used across two
copies of lib/lock with different build types.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agolib/misc: pick up review comments
VMware, Inc [Tue, 13 Mar 2012 19:59:59 +0000 (12:59 -0700)] 
lib/misc: pick up review comments

Regis had a few, nice suggestions.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agolib/lock: more sign checking
VMware, Inc [Tue, 13 Mar 2012 19:59:53 +0000 (12:59 -0700)] 
lib/lock: more sign checking

Found more places where the sign is confused.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agolib/lock: handle lock reference count consistently
VMware, Inc [Tue, 13 Mar 2012 19:59:36 +0000 (12:59 -0700)] 
lib/lock: handle lock reference count consistently

The native data type of the lock reference count is an "int" and
the checking is done assuming this. The output said unsigned. Fix
this. Add an extra assert.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agolib/lock: save some stats memory
VMware, Inc [Tue, 13 Mar 2012 19:59:30 +0000 (12:59 -0700)] 
lib/lock: save some stats memory

We keep the holder address around. No need, we can grab it when
we need it, saving a bit of memory.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agolib/lock: move a function
VMware, Inc [Tue, 13 Mar 2012 19:59:26 +0000 (12:59 -0700)] 
lib/lock: move a function

Move a function to get better grouping for a later change

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoReturn an error in 'mount' call when shared folders are disabled
VMware, Inc [Tue, 13 Mar 2012 19:59:17 +0000 (12:59 -0700)] 
Return an error in 'mount' call when shared folders are disabled

WHile adapting to the newer kernel API we have changed the way a root
dentry is filled. At the time of mount call, we don't send any request
to the HGFS server to check if the shared folders are enabled or not.
So, irrespective of the state of the HGFS server in the VMX, the 'mount'
call succeeds. We should ideally return an error if the shared folders
are disabled.

This is done by issuing a getAttr request to the server and returning
an error if the getAttr request fails.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoUse sysv's "service" to stop / start networking.
VMware, Inc [Tue, 13 Mar 2012 19:59:11 +0000 (12:59 -0700)] 
Use sysv's "service" to stop / start networking.

If we find a working "service" interface to init scripts, use it instead
of fiddling directly with /etc/init.d and friends.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoInternal branch sync. Included in this change:
VMware, Inc [Tue, 13 Mar 2012 19:59:02 +0000 (12:59 -0700)] 
Internal branch sync. Included in this change:

. lib/file: fix ASSERT that was too strict and fired too often.

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

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agolib/lock: less checking in non-debug builds
VMware, Inc [Tue, 13 Mar 2012 19:58:51 +0000 (12:58 -0700)] 
lib/lock: less checking in non-debug builds

Remove checking from non-debug builds. The original requirements
called for checking all the time but this is turning out to be
too expensive. Times in NS/Cycles (exclusive lock, uncontended):

Before: 44/177
After:  39/103
Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agolib/misc: Mac Hostinfo_SystemTimerNS can go faster
VMware, Inc [Tue, 13 Mar 2012 19:58:39 +0000 (12:58 -0700)] 
lib/misc: Mac Hostinfo_SystemTimerNS can go faster

The Mac Hostinfo_SystemTimerNS can do its calculations a bit more
economically. This results in ~2% overhead decrease.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoAllow certain libraries compile on Android & iOS.
VMware, Inc [Tue, 13 Mar 2012 19:58:31 +0000 (12:58 -0700)] 
Allow certain libraries compile on Android & iOS.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agolib/lock: MXUser statistics are too expensive
VMware, Inc [Tue, 13 Mar 2012 19:58:04 +0000 (12:58 -0700)] 
lib/lock: MXUser statistics are too expensive

Dmitriy specifically wanted the statistics measurement code to
actually measure the time it took to acquire an uncontended lock.
This turns out to be a very large overhead and not something we
really care about or can measure accurately.

Refactor the MXUser statistics code to only measure the acquisition
time when the lock is contended - most of our locks will have virtually
no overhead in a statistics build this way.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoUpdating open-vm-tools version for release 2011.12.20-562307. 2011.12.20-562307
VMware, Inc [Thu, 22 Dec 2011 00:56:23 +0000 (16:56 -0800)] 
Updating open-vm-tools version for release 2011.12.20-562307.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
14 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Thu, 22 Dec 2011 00:49:46 +0000 (16:49 -0800)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
14 years agoVMCI: adjust to craziness of grsecurity patches
VMware, Inc [Thu, 22 Dec 2011 00:49:21 +0000 (16:49 -0800)] 
VMCI: adjust to craziness of grsecurity patches

Apparently grsecurity patchset redefines struct file_operations
as read only so we need to use static initializers.

Also did some additional cleanup in module initialization.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
14 years agoSend the proper reply size back to the VMX.
VMware, Inc [Thu, 22 Dec 2011 00:48:20 +0000 (16:48 -0800)] 
Send the proper reply size back to the VMX.

In the present tools code, for few commands (like Hgfs packets),
the reply size is not sent correctly back to the VMX. An extra 4 bytes
is added to the reply size. We really don't require the extra 4 bytes.
Modified the code to get rid of the extra 4 bytes.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
14 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Thu, 22 Dec 2011 00:48:03 +0000 (16:48 -0800)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
14 years agoFix tools build.
VMware, Inc [Thu, 22 Dec 2011 00:47:28 +0000 (16:47 -0800)] 
Fix tools build.

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

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
14 years agofix build breakage
VMware, Inc [Thu, 22 Dec 2011 00:46:32 +0000 (16:46 -0800)] 
fix build breakage

#include <stdlib.h>

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
14 years agolib/misc: constification
VMware, Inc [Thu, 22 Dec 2011 00:46:17 +0000 (16:46 -0800)] 
lib/misc: constification

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
14 years agoUse bash shell first when starting a program inside the guest.
VMware, Inc [Thu, 22 Dec 2011 00:45:59 +0000 (16:45 -0800)] 
Use bash shell first when starting a program inside the guest.

Check the bug 772203 for more details. Use the bash shell first when
starting a program. If the bash shell doesn't exist, then use the
bourne shell.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
14 years agofree allocated string
VMware, Inc [Thu, 22 Dec 2011 00:45:43 +0000 (16:45 -0800)] 
free allocated string

Since malloc() worked in Asprintf(), assume free() OK.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
14 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Thu, 22 Dec 2011 00:45:25 +0000 (16:45 -0800)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
14 years agoExecute HGFS_ASSERT_INPUT only in successful code paths.
VMware, Inc [Thu, 22 Dec 2011 00:44:40 +0000 (16:44 -0800)] 
Execute HGFS_ASSERT_INPUT only in successful code paths.

Check bug 816476 for more details. In changeset #1611812, we have
removed the special logic related to the default session. So, in case of
any error, HgfsParseRequest() doesn't guarantee that all the attributes of
HgfsInputParam datastructure will be filled. In case of an error, the
code should not execute HGFS_ASSERT_INPUT.

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

. vix: correctly return error for unsupported credential types.

. vmci: rename the new packet API.

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

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
14 years agolib/file: without the test code left in...
VMware, Inc [Thu, 22 Dec 2011 00:38:27 +0000 (16:38 -0800)] 
lib/file: without the test code left in...

Doh!

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
14 years agolib/lock: FileLock_IsLocked crashes
VMware, Inc [Thu, 22 Dec 2011 00:38:14 +0000 (16:38 -0800)] 
lib/lock: FileLock_IsLocked crashes

Don't mix signed and unsigned arithmetic...

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
14 years agolib/misc: publish the PtrHash interface
VMware, Inc [Thu, 22 Dec 2011 00:37:34 +0000 (16:37 -0800)] 
lib/misc: publish the PtrHash interface

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
14 years agolib/file: problems in a build
VMware, Inc [Thu, 22 Dec 2011 00:37:15 +0000 (16:37 -0800)] 
lib/file: problems in a build

Unused varaible.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
14 years agolib/file: IsLocked err argument is optional
VMware, Inc [Thu, 22 Dec 2011 00:36:53 +0000 (16:36 -0800)] 
lib/file: IsLocked err argument is optional

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
14 years agolib/file: clean up before a change
VMware, Inc [Thu, 22 Dec 2011 00:36:35 +0000 (16:36 -0800)] 
lib/file: clean up before a change

Make the new code more consistent with the existing code.

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

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
14 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Thu, 22 Dec 2011 00:35:50 +0000 (16:35 -0800)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
14 years agoUse $(MAKE) instead of make.
VMware, Inc [Thu, 22 Dec 2011 00:35:07 +0000 (16:35 -0800)] 
Use $(MAKE) instead of make.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
14 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Thu, 22 Dec 2011 00:34:40 +0000 (16:34 -0800)] 
Changes in shared code that don't affect open-vm-tools functionality.

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

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
14 years agoFix signal source initialization.
VMware, Inc [Thu, 22 Dec 2011 00:33:49 +0000 (16:33 -0800)] 
Fix signal source initialization.

Code was doing initialization multiple times and probably leaking a few
fds in the process.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
14 years agoRevert of a previous change.
VMware, Inc [Thu, 22 Dec 2011 00:33:35 +0000 (16:33 -0800)] 
Revert of a previous change.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
14 years agolib/lock: restore minor merge issue
VMware, Inc [Thu, 22 Dec 2011 00:32:59 +0000 (16:32 -0800)] 
lib/lock: restore minor merge issue

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
14 years agoFix a security issue in HGFS server.
VMware, Inc [Thu, 22 Dec 2011 00:32:42 +0000 (16:32 -0800)] 
Fix a security issue in HGFS server.

When a packet is received by the HGFS server, all sanity tests related to
the header size and packet sizes should be done first before doing any
other tests. Moved the header and packet size checks to the beginning of
the validation process.

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

. vmci: Add support for pinning small queuepairs.

. vmci: add packet API.

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

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
14 years agoRemove the special logic implemented for default session.
VMware, Inc [Thu, 22 Dec 2011 00:26:54 +0000 (16:26 -0800)] 
Remove the special logic implemented for default session.

Recently, I have submitted a changeset #1571619 to make the HGFS
server more robust for the file transfers. As a part of that
changeset, we have implemented the separate HGFS sessions for
Transport layer and Sessions layer. In order to handle old file
copy library clients, we have implemented the concept of default
session. This default session is created when the transport
session is initially created and exists till the transport sessions
is destroyed.

But, because of this special default session, we had implemented
special logic in various parts of the code. In future, it will be
difficult to maintain/write any new code. We decided to remove
this special logic. Modified the HGFS server code to get rid of the
special handling for default session.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
14 years agoIgnore EBUSY when freezing filesystems.
VMware, Inc [Thu, 22 Dec 2011 00:26:34 +0000 (16:26 -0800)] 
Ignore EBUSY when freezing filesystems.

Thanks to bind mounts (and apparently some other changes in Fedora 15), we
may try to freeze the same superblock more than once. Ignore the EBUSY
errors the kernel returns in these cases.

Log some more information and fix a memory leak in the process.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
14 years agolib/lock: put back another piece
VMware, Inc [Thu, 22 Dec 2011 00:26:02 +0000 (16:26 -0800)] 
lib/lock: put back another piece

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
14 years agolib/lock: put more stuff back in
VMware, Inc [Thu, 22 Dec 2011 00:25:30 +0000 (16:25 -0800)] 
lib/lock: put more stuff back in

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
14 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Thu, 22 Dec 2011 00:25:13 +0000 (16:25 -0800)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
14 years agoRevert of previous change.
VMware, Inc [Thu, 22 Dec 2011 00:24:53 +0000 (16:24 -0800)] 
Revert of previous change.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
14 years agoAdd VMCI RPC channel RIDs and allow messages to them from vSockets.
VMware, Inc [Thu, 22 Dec 2011 00:24:22 +0000 (16:24 -0800)] 
Add VMCI RPC channel RIDs and allow messages to them from vSockets.

As part of the work to replace backdoor in the libRPC, we need two
additional VMCI channels in the VMX.  This change adds the resource IDs
for those channels.  One is privileged, meaning only admin/root guest
users can send to it.  The other allows messages from any user in the guest.

This change does not add handlers for the new channels, those will be added
in a future change.

This change also modifies vSockets to allow DGRAM sockets to send messages
over these new channels (we have explicit checks when sending to the VMX).

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
14 years agoFix crash in tools log reconfig handler.
VMware, Inc [Thu, 22 Dec 2011 00:22:53 +0000 (16:22 -0800)] 
Fix crash in tools log reconfig handler.

Certain changes in the config file could trigger a NULL dereference in
the code. Just add a NULL check.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
14 years agovmxnet(3) fix building with Linux kernel 3.2
VMware, Inc [Thu, 22 Dec 2011 00:22:35 +0000 (16:22 -0800)] 
vmxnet(3) fix building with Linux kernel 3.2

API changes for skb->frag and multicast list
Also, downstreaming change to prohibit vlan tag adding/removing
when interace is in promiscuous mode.

Also incorporated more changes from upstream to the driver.
Some linux systems expose versions as 2.6.40 and 2.6.41 instead of
3.0.0 and 3.1.0 and so on. To make the version checking easier, this
patch introduces a macro COMPAT_LINUX_VERSION_CHECK_LT(). This macro
must be used to compare versions 3.0 and beyond only.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
14 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Thu, 22 Dec 2011 00:21:31 +0000 (16:21 -0800)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
14 years agoFix potential issue with 32-bit cmpxchg8 / Atomic_Write64
VMware, Inc [Thu, 22 Dec 2011 00:20:54 +0000 (16:20 -0800)] 
Fix potential issue with 32-bit cmpxchg8 / Atomic_Write64

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
14 years agolib/lock: perThread tracking information fixes
VMware, Inc [Thu, 22 Dec 2011 00:20:11 +0000 (16:20 -0800)] 
lib/lock: perThread tracking information fixes

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
14 years agosyncDriver: do not use stale errno on Linux
VMware, Inc [Thu, 22 Dec 2011 00:19:41 +0000 (16:19 -0800)] 
syncDriver: do not use stale errno on Linux

close() may clobber errno so cache it immediately after calling
ioctl(fd, FIFREEZE) instead of it directly later.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
14 years agoFix HGFS for linux kernel 3.2.x.
VMware, Inc [Thu, 22 Dec 2011 00:19:27 +0000 (16:19 -0800)] 
Fix HGFS for linux kernel 3.2.x.

'struct inode' got changed in linux kernel 3.2.0. With the new change,
'i_nlink' attribute of the inode data structure was changed to a const
type. So, we can't directly access the i_nlink attribute directly.
Starting from Linux 3.2.x, we should use set_nlink(inode *, int *)
function to set the i_nlink count.

Designed a new function with the same name set_nlink() for kernel versions
before 3.2.0. Modified the code to call set_nlink(). If the user tries
out a latest kernel, the new kernel function gets called else the new
function that is added in this changeset will be called.

While testing the fix, noticed that build process couldn't resolve
module_param function in tcp.c file. Not sure if anything got changed
in linux kernel 3.2.x. Fixed the build issue by including proper header
file in tcp.c.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
14 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Thu, 22 Dec 2011 00:18:40 +0000 (16:18 -0800)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
14 years agoModify the return value of HgfsServerSessionInvalidateInactiveSessions.
VMware, Inc [Thu, 22 Dec 2011 00:17:50 +0000 (16:17 -0800)] 
Modify the return value of HgfsServerSessionInvalidateInactiveSessions.

Modified the function signature for
HgfsServerSessionInvalidateInactiveSessions. With the new changes, the
function will return the number of active sessions left in the HGFS
server. This return value reflects the total number of sessions that still
need to be either invalidated or destroyed. Based on this return value,
the caller can make a decision whether to call the invalidator one more
time or not.

Modified the vixTools code to handle this new function signature.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
14 years agomake FileIOAligned_PoolInit thread-safe
VMware, Inc [Thu, 22 Dec 2011 00:17:18 +0000 (16:17 -0800)] 
make FileIOAligned_PoolInit thread-safe

This function actually does have to be thread-safe because its caller, FileIO_OptionalSafeInitialize, is not (and doesn't have to be since it just performs idempotent operations). Most straightforward solution is to turn alignedPool.lock into a singleton.

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

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
14 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Thu, 22 Dec 2011 00:15:52 +0000 (16:15 -0800)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
14 years agoAdd a new HGFS error code (HGFS_STATUS_TOO_MANY_SESSIONS)
VMware, Inc [Thu, 22 Dec 2011 00:14:51 +0000 (16:14 -0800)] 
Add a new HGFS error code (HGFS_STATUS_TOO_MANY_SESSIONS)

- Added a new HGFS error code (HGFS_STATUS_TOO_MANY_SESSIONS). This
error code is returned to the client when the maximum number of sessions
were already created and a new session couldn't be created in the
HGFS server.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
14 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Thu, 22 Dec 2011 00:13:59 +0000 (16:13 -0800)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
14 years ago[unity] Remove Unity_SetActiveDnDDetWnd.
VMware, Inc [Thu, 22 Dec 2011 00:13:41 +0000 (16:13 -0800)] 
[unity] Remove Unity_SetActiveDnDDetWnd.

No code was calling this function. Also, remove the UnityDnD type (which
was only used by this function) and any code related to this function in
the unity back-ends.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
14 years agoFix HGFS server stale session error
VMware, Inc [Thu, 22 Dec 2011 00:12:59 +0000 (16:12 -0800)] 
Fix HGFS server stale session error

The Windows HGFS server currently is the only server that returns
the correct stale session error to a client. The platform specific
error returned by the platform independent code was not translated
for Posix HGFS servers correctly.

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