]> git.ipfire.org Git - thirdparty/open-vm-tools.git/log
thirdparty/open-vm-tools.git
13 years agoBump up tools version for next hosted release
VMware, Inc [Mon, 15 Oct 2012 04:57:46 +0000 (21:57 -0700)] 
Bump up tools version for next hosted release

The new tools version for hosted products is 9.2.2

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoInternal branch sync. Included in this change:
VMware, Inc [Mon, 15 Oct 2012 04:56:50 +0000 (21:56 -0700)] 
Internal branch sync. Included in this change:

. VMCI cleanups

. tools daemon(s) will emit a log message with version upon startup

. reduce verbosity of get_capab log in vmxnet3 Solaris driver

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

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoAdd new privileged RPC call to RPC out library
VMware, Inc [Mon, 15 Oct 2012 04:56:10 +0000 (21:56 -0700)] 
Add new privileged RPC call to RPC out library

Some tools require a privileged RPC out call for example the VGAuthImport for
the namespace DB interface.

This adds the RpcOUt_SendOneRawPriv call which will make a privileged RPC call
with the same arguments as the pre-exisiting RpcOUt_SendOneRaw API. It is expected
that the caller of the RpcOUt_SendOneRawPriv be running as root or Administrator.

The intention here is to keep the same model as the RpcOUt_SendOneRaw where the
caller can just make the standalone RPC call which internally handles the RPC
creation of a connection and destroys it before returning.
So the Posix RpcOUt_SendOneRawPriv expets the caller to raise and lower the IO
privilege level (on Linux platforms only) until the RPC internally calls a kernel
mode driver to do the real privileged call. On Windows, the
RpcOUt_SendOneRawPriv opens a connection to the kernel mode driver and
pass the RPC request to it to send and then close the driver connection before
returning.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoDeal with conflict with Dell's Open Manage Software
VMware, Inc [Mon, 15 Oct 2012 04:56:04 +0000 (21:56 -0700)] 
Deal with conflict with Dell's Open Manage Software

When dell open manage software and vmware tools uses the same libraries.
There is a conflict as the versions of libraries are not the same.

This does not really affect open-vm-tools as they use system libraries
and do not ship their own.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoCopyPaste: accept TIMESTAMP data type for selection timestamps
VMware, Inc [Mon, 15 Oct 2012 04:55:51 +0000 (21:55 -0700)] 
CopyPaste: accept TIMESTAMP data type for selection timestamps

The previous fix for copy and paste was pretty strict, and it turned out
to break X selections w/ the rxvt-unicode terminal emulator. (rxvt-unicode
returns selection data w/ data type TIMESTAMP instead of the ICCCM defined
INTEGER.)

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agovmmemctl: fix a typo in balloon driver
VMware, Inc [Mon, 15 Oct 2012 04:55:38 +0000 (21:55 -0700)] 
vmmemctl: fix a typo in balloon driver

On batched unlock, the guest was sending a BATCHED_LOCK to the
monitor instead of the BATCHED_UNLOCK command.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Mon, 15 Oct 2012 04:55:26 +0000 (21:55 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoAllow string code be more strict
VMware, Inc [Mon, 15 Oct 2012 04:55:15 +0000 (21:55 -0700)] 
Allow string code be more strict

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoHGFS: fix to compile on kernels 3.6+
VMware, Inc [Mon, 15 Oct 2012 04:55:07 +0000 (21:55 -0700)] 
HGFS: fix to compile on kernels 3.6+

Can you spell "ugly"? U-G-L-Y. Ugly.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agovmmemctl: refactor backdoor_balloon.c
VMware, Inc [Mon, 15 Oct 2012 04:55:00 +0000 (21:55 -0700)] 
vmmemctl: refactor backdoor_balloon.c

All the functions in backdoor_balloon.c were very similar,
refactor those so that all the common code is on one function.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoInternal branch sync. Included in this change:
VMware, Inc [Mon, 15 Oct 2012 04:54:51 +0000 (21:54 -0700)] 
Internal branch sync. Included in this change:

. VMCI update to support VM-to-VM communication

. VIX updates

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

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agovmmemctl: fix a double free on linux balloon driver
VMware, Inc [Mon, 15 Oct 2012 04:54:23 +0000 (21:54 -0700)] 
vmmemctl: fix a double free on linux balloon driver

On unload when using the unbatched commands, b->pageHandle would
be free two times. The first one when releasing all the pages of
the balloon, and the second time when releasing the batch
structures. This was causing OOPS and sometimes panic when rmmod
the driver.

The fix is to set b->pageHandle to PAGE_HANDLE_INVALID when it's
added to the chunks or when the page is released.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agovmmemctl: update the balloon size in the unlock path
VMware, Inc [Mon, 15 Oct 2012 04:54:12 +0000 (21:54 -0700)] 
vmmemctl: update the balloon size in the unlock path

Previously, it wasn't updated so the balloon was not shrinkable.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoGuestinfo: fix memory leak detected by valgrind
VMware, Inc [Mon, 15 Oct 2012 04:54:06 +0000 (21:54 -0700)] 
Guestinfo: fix memory leak detected by valgrind

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoAdd esx50 updates to vm_tools_version.h
VMware, Inc [Mon, 15 Oct 2012 04:53:52 +0000 (21:53 -0700)] 
Add esx50 updates to vm_tools_version.h

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoSQUASH or remove both? Build breakage.
VMware, Inc [Mon, 15 Oct 2012 04:53:36 +0000 (21:53 -0700)] 
SQUASH or remove both? Build breakage.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoGOSTABLE: 2008R2 x64 should be in the WIN64 list
VMware, Inc [Mon, 15 Oct 2012 04:53:22 +0000 (21:53 -0700)] 
GOSTABLE: 2008R2 x64 should be in the WIN64 list

Got removed incorrectly in an earlier change...

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agovmmemctl: use capability based system to advertise balloon features
VMware, Inc [Mon, 15 Oct 2012 04:53:17 +0000 (21:53 -0700)] 
vmmemctl: use capability based system to advertise balloon features

Use a capability based system instead of versioning to advertise
and negotiate balloon features.

On START command, the guest is sending its capability and the
monitor returns the masked capability. That way, the guest knows
exactly what features are supported by the monitor.

Currently the capability use two bits: if the bit 1 is set, then
the unbatched lock and unlock are supported, and if the bit 2 is
set, then the batched lock and unlock are supported. Bit 1 was
chosen to be backward compatible with "protocol v2", and bit 0
is unused to avoid issue with the screwed "protocol v3".

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoLog_HexDump's second argument can/should be a const void *.
VMware, Inc [Mon, 15 Oct 2012 04:52:57 +0000 (21:52 -0700)] 
Log_HexDump's second argument can/should be a const void *.

Make it so.  That way we don't have to cast things at the callsite.
And remove some/most of the unnecessary typecasts while we're here.
And also make the third argument a size_t.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agolib/lock: Clean up trailing whitespace
VMware, Inc [Mon, 15 Oct 2012 04:52:51 +0000 (21:52 -0700)] 
lib/lock: Clean up trailing whitespace

Trivial elimination of trailing whitespace.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoGosTable: Server 2008 R2 32-bit never existed
VMware, Inc [Mon, 15 Oct 2012 04:52:16 +0000 (21:52 -0700)] 
GosTable: Server 2008 R2 32-bit never existed

According to Matt Delco Server 2008 R2 32-bit never existed. We can
remove it. This frees up a hosted bit which is good as it gives us
room to play in... until the don't use bits project is done (it's
just getting started).

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoGostable: minimal support for vmkernel6 and Mac OS 10.9
VMware, Inc [Mon, 15 Oct 2012 04:52:06 +0000 (21:52 -0700)] 
Gostable: minimal support for vmkernel6 and Mac OS 10.9

Implement then as aliases to their next earliest versions. We'll
revisit these as developments warrant. The SHOW_IN_UI is not on,
for now, so only in devel builds will they show up. Nor have I
changed the default showing for the UIs - that comes later.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agolib/misc: robustify Windows process checking
VMware, Inc [Mon, 15 Oct 2012 04:52:01 +0000 (21:52 -0700)] 
lib/misc: robustify Windows process checking

It is possible for a process to prevent itself for even having
it's name checked on Vista and later. We can use the denial of
access to determine is a process is alive.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Mon, 15 Oct 2012 04:51:48 +0000 (21:51 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoEXTERN: remove more unnecessary extern
VMware, Inc [Mon, 15 Oct 2012 04:51:42 +0000 (21:51 -0700)] 
EXTERN: remove more unnecessary extern

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agolib/lock: trivial line up
VMware, Inc [Mon, 15 Oct 2012 04:51:29 +0000 (21:51 -0700)] 
lib/lock: trivial line up

Line shouldn't have been wrapped.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoInternal branch sync. Included in this change:
VMware, Inc [Mon, 15 Oct 2012 04:51:21 +0000 (21:51 -0700)] 
Internal branch sync. Included in this change:

. fixes in VIX plugin

. define a new tools option "enableMessageBusTunnel"

. formatting changes

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoFix HGFS server destroy session handler
VMware, Inc [Mon, 15 Oct 2012 04:51:02 +0000 (21:51 -0700)] 
Fix HGFS server destroy session handler

The HGFS server destroy session handler should return the reply packet to
the client. Currently, it was deemed not warranted due to the reply only
having reserved fields. However, now that has been done, all clients cannot
validate the reply size correctly to include the full reply packet but only
accept the header size as mandatory. If they receive more than that they
can and should also validate the reply packet.

Currently, only hgfilecopy uses the destroy session, which does not look at
the reply packet at all and just uses the success or error returned. So these
changes will not break any clients currently.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoInternal branch sync. Included in this change:
VMware, Inc [Mon, 15 Oct 2012 04:50:52 +0000 (21:50 -0700)] 
Internal branch sync. Included in this change:

. add StrUtil_IsASCII (not used by the OVT code).

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

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Mon, 15 Oct 2012 04:50:40 +0000 (21:50 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoGuest OS table: add Debian 7 and SLES 12
VMware, Inc [Mon, 15 Oct 2012 04:50:29 +0000 (21:50 -0700)] 
Guest OS table: add Debian 7 and SLES 12

These need to be added - and they are easy as they are aliases. No
bits need to be allocated. Find any place Debian 6 or SLES 11 is used
and add Debian 7 and SLES 12 respectively.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoBump up tools version for Fusion 5.0.1 release
VMware, Inc [Mon, 15 Oct 2012 04:50:23 +0000 (21:50 -0700)] 
Bump up tools version for Fusion 5.0.1 release

The new version for hosted products is 9.2.1

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoInternal branch sync. Included in this change:
VMware, Inc [Mon, 15 Oct 2012 04:50:14 +0000 (21:50 -0700)] 
Internal branch sync. Included in this change:

. VIX config names cleanup

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

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Mon, 15 Oct 2012 04:49:43 +0000 (21:49 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoVMCI/vSOCK: fix event soft lockup on Linux
VMware, Inc [Mon, 15 Oct 2012 04:49:37 +0000 (21:49 -0700)] 
VMCI/vSOCK: fix event soft lockup on Linux

We make the silly mistake of assuming in our QP event CBs that we are in BH
context, because we didn't ask for a delayed CB.  But in this case, VMCI
doesn't make any guarantees about what context we are in, it could be BH or
process, we don't know.  Fixed so that we don't make this silly assumption.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoVMCI: fix context locking.
VMware, Inc [Mon, 15 Oct 2012 04:49:23 +0000 (21:49 -0700)] 
VMCI: fix context locking.

Seems like we're holding the context list lock here, when we should
be holding the context lock (or possibly not holding any lock, but
we'll start with this).

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agovmmemctl: add batching to the balloon driver.
VMware, Inc [Mon, 15 Oct 2012 04:49:10 +0000 (21:49 -0700)] 
vmmemctl: add batching to the balloon driver.

Currently, we call the monitor for each reclaimed page. Batch
those pages and do a monitor call when enough pages have been
reclaimed. Ultimately, this should improve the performance by
reducing the number of context switch.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoGuestinfo: return an empty nicinfo if an error occurs.
VMware, Inc [Mon, 15 Oct 2012 04:48:59 +0000 (21:48 -0700)] 
Guestinfo: return an empty nicinfo if an error occurs.

If an error occurs while retrieving the network information then,
instead of ignoring error, guestinfon should return an empty nicinfo
so that all corresponding entries in the MOB, VMDB, will be set to
blank values and VI client will not show any stale data.

This change also fixes another issue. If any error occurs while
retrieving the primary 'ipaddress', guestinfo plugin now returns
a blank string so that VI client and other clients show the blank
value instead of stale data.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoPass kernel version to depmod when installing kernel modules
VMware, Inc [Mon, 15 Oct 2012 04:48:50 +0000 (21:48 -0700)] 
Pass kernel version to depmod when installing kernel modules

When building Open VM Tools in chroot jail, jail kernel version could
be different from the actual kernel version and compilation fails.
Suggested fix is to use depmod -a $(KERNEL_RELEASE)

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoReturn proper error for ChangeFileAttributesInGuest API.
VMware, Inc [Mon, 15 Oct 2012 04:48:20 +0000 (21:48 -0700)] 
Return proper error for ChangeFileAttributesInGuest API.

When a user executes ChangeFileAttributesInGuest(), the code calls
File_Exists() to check if the file exists. If File_Exists() fails,
then the code used to return a hard-coded error, but it is much
better to convert the errno/GetLastError() into a more meaningful
error.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoVMCI: changes in shared code that don't affect open-vm-tools
VMware, Inc [Mon, 15 Oct 2012 04:48:11 +0000 (21:48 -0700)] 
VMCI: changes in shared code that don't affect open-vm-tools

Some VMCI header changes not affecting open-vm-tools.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Mon, 15 Oct 2012 04:47:57 +0000 (21:47 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoInternal branch sync. Included in this change:
VMware, Inc [Mon, 15 Oct 2012 04:47:48 +0000 (21:47 -0700)] 
Internal branch sync. Included in this change:

. removed SEQPACKET support from VMCI driver as we are not going to ship
  in in its current form.

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

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agovmmemctl: add the kernel stubs to the balloon driver
VMware, Inc [Mon, 15 Oct 2012 04:47:15 +0000 (21:47 -0700)] 
vmmemctl: add the kernel stubs to the balloon driver

This file is required in order to use ASSERT in the driver.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agolib/file: make simple aio manager a little more thread safe.
VMware, Inc [Mon, 15 Oct 2012 04:46:48 +0000 (21:46 -0700)] 
lib/file: make simple aio manager a little more thread safe.

The simple aio manager used a separate seek() then readv()/writev()
to do IO.  This pattern is not thread safe with respect to multiple
threads accessing the same file.  In particular, this affects
lazy checkpointing, since the IO to the mainmem file can come from
either the vcpu threads or the background save thread.  This
change replaces these non-thread safe calls with preadv()/pwritev().
The simple aio manager needs FileIO_Preadv/Pwritev to return
number of bytes processed on partial IO.  Modified the fileIO functions
to do so.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoYank VMCF/AMQP completely from Tools.
VMware, Inc [Mon, 15 Oct 2012 04:46:10 +0000 (21:46 -0700)] 
Yank VMCF/AMQP completely from Tools.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Mon, 15 Oct 2012 04:46:00 +0000 (21:46 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoHGFS: add hooks to control debug level on fly
VMware, Inc [Mon, 15 Oct 2012 04:45:50 +0000 (21:45 -0700)] 
HGFS: add hooks to control debug level on fly

This is used by the hgfs sysctl interface available on OS X.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoInternal branch sync. Included in this change:
VMware, Inc [Thu, 2 Aug 2012 06:57:41 +0000 (23:57 -0700)] 
Internal branch sync. Included in this change:

. lib/file: check for available free space before moving directory
  trees

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

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agolib/misc: add some string concatenation helpes
VMware, Inc [Thu, 2 Aug 2012 06:57:12 +0000 (23:57 -0700)] 
lib/misc: add some string concatenation helpes

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agolib/file: make File_Cwd() handle directories of any length
VMware, Inc [Thu, 2 Aug 2012 06:53:59 +0000 (23:53 -0700)] 
lib/file: make File_Cwd() handle directories of any length

In the I18n world the current working directory can be essentially
unlimited in length. Using FILE_MAXPATH is outdated. Make File_Cwd
handle a current working directory of any length.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoAdd a macro to check if glibc 2.12 is being used
VMware, Inc [Thu, 2 Aug 2012 06:53:49 +0000 (23:53 -0700)] 
Add a macro to check if glibc 2.12 is being used

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoHandle special files in HGFileCopy library.
VMware, Inc [Thu, 2 Aug 2012 06:53:30 +0000 (23:53 -0700)] 
Handle special files in HGFileCopy library.

Certain files like /proc/kallsyms can be copied from the guest only if
the special 'sequential open' mode is specified. This changeset removes
that constraint. Implemented the support in HGFilecopy library to
specify the sequential mode flag automatically if it thinks the remote
file is a special file.

This is done by implementing the support in hgfsServer to specify the
file as 'sequential only' if it thinks so. HGFSServer sets this bit when
the attributes are queried for the file. Implemented a new HGFile copy
option which a user can specify if he wants to automatically handle
the special 'sequential only' files. If the new file copy option is set,
then the HGFilecopy library automatically sets the 'sequential open' flag
if it thinks the file being copied is a 'sequential only' file.

Made changes to the vix library code to use the new HGFileCopy option
as default for the file copy functions.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Thu, 2 Aug 2012 06:52:40 +0000 (23:52 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agolib/misc: fix handling of size 0 in FileIO_Preadv
VMware, Inc [Thu, 2 Aug 2012 06:52:58 +0000 (23:52 -0700)] 
lib/misc: fix handling of size 0 in FileIO_Preadv

When file of size zero is used, we should return success.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agolib/misc: add MsgList_Present()
VMware, Inc [Thu, 2 Aug 2012 06:52:32 +0000 (23:52 -0700)] 
lib/misc: add MsgList_Present()

Add MsgList_Present (which matches Msg_Present) as a convenience for
ASSERTs.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoBump up the tools version for WS 9.0 Release
VMware, Inc [Thu, 2 Aug 2012 06:52:26 +0000 (23:52 -0700)] 
Bump up the tools version for WS 9.0 Release

This is the final tools change for WS 9.0 Release. Bump up the
tools version to 9.2.0 for WS 9.0 Release.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agolib/file: use 64 bit offset to support large files
VMware, Inc [Thu, 2 Aug 2012 06:52:15 +0000 (23:52 -0700)] 
lib/file: use 64 bit offset to support large files

Quick fix to call 64 bit offset version of preadv and pwritev.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoHGFS: OS X client logging improvements
VMware, Inc [Thu, 2 Aug 2012 06:52:07 +0000 (23:52 -0700)] 
HGFS: OS X client logging improvements

Making the logging more consistent and much more useful.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agovSock: only print warning if we could not register address family at all
VMware, Inc [Thu, 2 Aug 2012 06:50:55 +0000 (23:50 -0700)] 
vSock: only print warning if we could not register address family at all

vSockets on Linux tries to claim an address family starting from the top
of the valid range.  If someone has already claimed an address, we will
print a warning to the kernel log and then continue looping.  This
warning started appearing on Cent OS 5.4 in autoinstall tests, presumably
because someone is grabbing the top family.  Because the automation is
screenshot-based, the presence of the warning is causing the test to fail.
Fixed by moving the warning to the very end.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoInternal branch sync. Included in this change:
VMware, Inc [Thu, 2 Aug 2012 06:50:36 +0000 (23:50 -0700)] 
Internal branch sync. Included in this change:

. lib/misc - add a function to override home directory

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

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agolib/file: add support for preadv and pwritev
VMware, Inc [Thu, 2 Aug 2012 06:50:13 +0000 (23:50 -0700)] 
lib/file: add support for preadv and pwritev

Earlier we just coalesced the vectors and called a single pread/pwrite.
This change checks if there is system support for these calls. In case
there is no support, we simply fallback to the older unoptimized code.

Performance tests showed promising results:

Test suite:
I ran tests with random 32k read/write IO access patterns.The number of
outstanding IO requests was set to 64. This was done on opt build with and
without my changes.

The following vmx config changes were made to disable buffering:

hard-disk.hostBuffer = "disabled"
hard-disk.useUnbuffered = "FALSE"

Results:

*****************************
Optimized version:
*****************************

Total Read IOps :       4882.38067
Total Read MBps :       152.574396
Read IO latency :       0.204818114 millisec

Total Write IOps :      63.339208
Total Write MBps :      1.922736
Write IO latency :      15.788009222 millisec

*******************************
Unoptimized version:
*******************************

Total Read IOps :    4393.482149
Total Read MBps :    137.296317
Read IO latency :    0.227609893 millisec

Total Write IOps :   50.473344
Total Write MBps :   1.577292
Write IO latency :   19.812438027 millisec

*********************************
Improvement :
*********************************

Read Improvement:     152.574396/137.296317  = 1.111278142 = ~ 11%
Write Improvement :   1.922736/1.577292  = 1.219010811 = ~ 22%

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agolib/file: fix potential crash in FileRotateBy*()
VMware, Inc [Thu, 2 Aug 2012 06:50:06 +0000 (23:50 -0700)] 
lib/file: fix potential crash in FileRotateBy*()

The File_Rotate call may have a newFileName argument. If there is a
failure, and this argument is present we should set it to NULL to
prevent potential memory corruption or freeing garbage problems.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoPromote VIX_PROPERTY_HOST_SOFTWARE_VERSION property
VMware, Inc [Thu, 2 Aug 2012 06:49:38 +0000 (23:49 -0700)] 
Promote VIX_PROPERTY_HOST_SOFTWARE_VERSION property

The property VIX_PROPERTY_HOST_SOFTWARE_VERSION returns useful info
about the VIX build. Promote to the public vix.h.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoInternal branch sync. Included in this change:
VMware, Inc [Thu, 2 Aug 2012 06:49:18 +0000 (23:49 -0700)] 
Internal branch sync. Included in this change:

. turn VGauth support back on now that all name changes are pushed
  through

. lib/misc - add StrUtil_CapacityToBytes()

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

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoFix Linux HGFS client access failure error code
VMware, Inc [Thu, 2 Aug 2012 06:48:58 +0000 (23:48 -0700)] 
Fix Linux HGFS client access failure error code

Permissions checks return EPERM when they should be EACESS.

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

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agovmballoon: cleanup and optimization
VMware, Inc [Thu, 2 Aug 2012 06:48:30 +0000 (23:48 -0700)] 
vmballoon: cleanup and optimization

* Instead of using a new command to report the protocol to be used by
the guest, use the register ECX in the START command.

* Instead of using the protocol v2 when RR FT can be enabled, detect
that FT has been enabled and request a reset from the guest.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoAdd an entry for 'oracle linux' in distroArray.
VMware, Inc [Thu, 2 Aug 2012 06:48:14 +0000 (23:48 -0700)] 
Add an entry for 'oracle linux' in distroArray.

The 'guestinfo' plugin in VMware Tools is responsible for retrieving
details about the guest (like guest family, guest id, guest fullname
etc.). The 'guestinfo' plugin uses HostinfoOSData to retrieve the data
about the guest OS. HostinfoOSData() uses 'lsb_release' package to
reteive the details. If the 'lsb_release' command fails for some reason,
then /etc/*-release files are parsed to retrieve the necessary
information. There is a specific list of /etc/*-release files that are
parsed.

We don't have an entry for 'Oracle Linux'. We need to add an entry for
'/etc/oracle-release' file in the list. In 'Oracle Linux' guests, both
files '/etc/redhat_release' and /etc/oracle_release' exist. So, we need
to add the new entry in the code before the 'redhat' entry. Otherwise,
'/etc/redhat-release' is parsed first and improper information is
retrieved.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoInternal branch sync. Included in this change:
VMware, Inc [Thu, 2 Aug 2012 06:47:56 +0000 (23:47 -0700)] 
Internal branch sync. Included in this change:

. vmballoon balloon code.

. small changes in string library used by DnD/CP plugin

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

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoFix Lion guest and host files on shared folder show diff contents
VMware, Inc [Thu, 2 Aug 2012 06:46:07 +0000 (23:46 -0700)] 
Fix Lion guest and host files on shared folder show diff contents

The OS X hgfs client reference counts file handles that are shared for
accessing file data on the HGFS server. Unfortunately the implementor
failed to actually verify if the reference counting worked by testing
even the simplest sequence of file IO operations: opening a file,
reading it, and close should result in the reference count being set to
zero and the close request was sent to the HGFS server.  This did not
occur, as a result the open handle remainded forever open on the server
until the HGFS server was forced to shutdown. This open handle was
reused for any further accesses from the client until it was rebooted.
The behavior of OS X (and Linux) file systems mean that the HGFS client
will only receive the data that it has written to that file or the
original data stored in the file which is now cached. If a host
application modifies the contents of that file the HGFS client will not
see it, until the old handle gets closed and a new one opened.

The fix is for the reference count for the open handle to be correctly
handled.  This will mean that the matching close for an open handle will
reduce the reference count to zero and therefore a closse request will
be sent to the HGFS server. The next access to the file will get the
latest file data on disk from the host.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Thu, 2 Aug 2012 05:32:28 +0000 (22:32 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoFix vmxnet failing to compile on Fedora 16
VMware, Inc [Thu, 2 Aug 2012 05:32:06 +0000 (22:32 -0700)] 
Fix vmxnet failing to compile on Fedora 16

The kernel version check was wrong, the new stuff didn't make it in till
3.2, so 3.1 was hosed.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoFix HGFS file append on OS X
VMware, Inc [Thu, 2 Aug 2012 05:31:59 +0000 (22:31 -0700)] 
Fix HGFS file append on OS X

File appends were incorrect on OS X as they appear to be handled
differently by posix pwrite calls from Linux. On Linux if the handle is
opened for append mode then pwrite will ignore the offset and append to
the file. This is not correct for OS X, where the offset is still used.

For OS X we now check if the handle is opened for append and use the
write call instead.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoPrint warning messages before the wipe/shrink process
VMware, Inc [Thu, 2 Aug 2012 05:31:17 +0000 (22:31 -0700)] 
Print warning messages before the wipe/shrink process

During the wipe process, the toolbox cmd CLI first fills the guest's
disk space with file filled with zeroes. During this step, user may
notice few warning messages about the available free disk space in the
guest operating system. We should print a message to disregard the disk
space messages in the guest operating system.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoVMBLOCK: fix panic on unmounting on FreeBSD 9.0
VMware, Inc [Thu, 2 Aug 2012 05:30:57 +0000 (22:30 -0700)] 
VMBLOCK: fix panic on unmounting on FreeBSD 9.0

FreeBSD added a new operation vop_advlockpurge that is called
from vgonel() after an inode was released. We should not attempt
to pass this operation down to the underlying filesystem and
instead install vop_stdadvlockpurge() as our handler, exactly like
nullfs does.

Although there wasn't explicit bump of __FreeBSD_version for this
change, 900013 is the closest one and we'll use it to detect when
when we need to install vop_advlockpurge handler.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agolib/file: make FileSimpleRandom() thread safe
VMware, Inc [Thu, 2 Aug 2012 05:30:28 +0000 (22:30 -0700)] 
lib/file: make FileSimpleRandom() thread safe

The memory allocation and initialization is thread safe, the using of
the context isn't. A simple lock will solve that.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Thu, 2 Aug 2012 05:30:10 +0000 (22:30 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoFix asm constraint for Set/Test/ClearBitVector
VMware, Inc [Thu, 2 Aug 2012 05:29:55 +0000 (22:29 -0700)] 
Fix asm constraint for Set/Test/ClearBitVector

Compiling this assembly with gcc-4.4.3 in i686 results in a
compilation error stating that %dil is not a valid register.

GCC experts state that the compiler is correct and the
problem is in the assembly constraints:
https://bugzilla.redhat.com/show_bug.cgi?id=625263
(Summary for uninitiated: %dil is the low 8 bits of %edi,
which is addressible in x86_64 but NOT in ia32)

Slightly more detail: the setc instruction takes an 8-bit
operand. Which means any register chosen must also be
an 8-bit register (ia32: al, bl, cl, dl). The 'q' constraint
means "any register addressible with the -l suffix", which
is the correct constraint. At Jim's suggetion, I'm also adding
'Q' (ia32: ah, bh, ch, dh). Note that in x86_64, 'q' covers
all registers, so 'q' vs. 'r' does not hurt x86_64.

I also note that bts specifically alters CF (and we are indeed
using setc to read it!), but "cc" is not on the clobber list.
It was present on the clobber list of all the other assembly
fragments, so I suspect this was an oversight.

Why didn't we see this before?
- These BitTest funcs tend to be used only in VMX
- The only VMX that builds with gcc-4.4.3 today is ESX's, which ix x86_64
- The Linux Workstation vmx32 uses gcc-4.1.2
- (I'm experimenting with bumping Workstation Linux's gcc)
There are no correctness concerns; if constraints were wrong, the
code would fail to compile entirely due to incorrect register
selection.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoMsgList_Create: annotate with printf declaration checker
VMware, Inc [Thu, 2 Aug 2012 05:29:38 +0000 (22:29 -0700)] 
MsgList_Create: annotate with printf declaration checker

MsgList_Append has the printf declaration checker attribute
in place. I believe at the time, there were a few MsgList_Create
calls that had to be turned into MsgList_CreateStr; this change
has since happened. Which means the format specifier check
can now be fully enabled.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoInternal branch sync. Included in this change:
VMware, Inc [Thu, 2 Aug 2012 05:29:18 +0000 (22:29 -0700)] 
Internal branch sync. Included in this change:

. fix bug in ListAlias APIs - sloppy use of arrays vs pointers

. vmxnet3 - fix MTU management in Solaris version:
  - do not start with MTU as 9000 but as 1500;
  - check if accept-jumbo was set before increasing MTU above 1500;
  - allow initial MTU to be picked up from vmxnet3s.conf;
  - update max sdu when MTU changes on OpenSolaris and on Solaris 11

. vmballon - add versioning to the balloon driver handshake

. Fix up FileIsVMFS() so it correctly identifies VMFS*

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

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoPrevent crashes on invalid message strings in release builds
VMware, Inc [Thu, 2 Aug 2012 05:28:12 +0000 (22:28 -0700)] 
Prevent crashes on invalid message strings in release builds

There might be Msg_Append call sites that pass in a raw string that
lacks message ID.  We assert in debug builds, but end up dereferencing
an invalid pointer in release builds.  Let's make up a generic error
message out of the raw string instead.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agovSock: Consolidate provider info
VMware, Inc [Thu, 2 Aug 2012 05:27:49 +0000 (22:27 -0700)] 
vSock: Consolidate provider info

Our provider protocol structures were scattered across three different
installers.  Just move them into a single header, one that is already
included by everyone.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoGOSTable: New Mac hardware, new GOSTable bit
VMware, Inc [Thu, 2 Aug 2012 05:26:12 +0000 (22:26 -0700)] 
GOSTable: New Mac hardware, new GOSTable bit

We need a new GOSTable bit for darwin12 to cover the new bridge and CPU
architecture... we need to provide monitor specific settings appropriate
to the OS.

DARWIN12 will be 64-bit only so we can drop a 32-bit entry.

Clean up any fallout.

Once the monitor settings have been finalized a follow up change will
deal with monitor settings.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoFix error on file deletion on read-only HGFS share
VMware, Inc [Thu, 2 Aug 2012 05:26:04 +0000 (22:26 -0700)] 
Fix error on file deletion on read-only HGFS share

The failure was being done at the set file information call of the
Windows client instead of the create call. This only occurred when
communicating to HGFS servers on Posix platforms. The Posix platform
only uses the open mode of the HGFS open protocol request even if the
desired access is valid. On Windows HGFS servers the desired access is
checked and used if valid, and if not falls back to the Posix open mode
call.

However, for the case of delete requests, the Windows client does not
set up the Posix open mode quite correctly. It igonores the DELETE
desired access flag.  This should be mapped to a Posix open mode
requesting write access. So for occasions where read attributes and
delete is requested in the desired access the Posix open mode is still
passed as read-only. This causes the open to succeed on a read-only
share when it should be failed with access denied.

This fix is to address the HGFS Posix server to try to map a Windows
client passing the desired access mask to the Posix open mode will then
allow all Windows clients to have the open for delete access validated
by the HGFS server.  Linux clients are unaffected and do not use this
field for the open requests.  It also has the benefit of making the
Posix and Windows HGFS servers more compatible.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoInternal branch sync. Included in this change:
VMware, Inc [Thu, 2 Aug 2012 05:25:19 +0000 (22:25 -0700)] 
Internal branch sync. Included in this change:

. more VGAuth rename work (handle renaming in foundry, the automation
  socket protocol and tools)

. CopyPaste - fix up 64-bit X11 selection timestamp handling

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

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoFix toolbox 'shrink' feature on newer distributions using bind mounts
VMware, Inc [Thu, 2 Aug 2012 05:24:55 +0000 (22:24 -0700)] 
Fix toolbox 'shrink' feature on newer distributions using bind mounts

VMware toolbox-cmd utility provides two disk related features i.e.
shrink and wipe. When the user executes 'shrink' or 'wipe' command, the
utility parses /etc/mtab and checks if there is an entry matching the
specific mount point. If a match exists, then the utlity immediately
stops the parsing. This approach is not very robust and may cause few
issues especially if there are multiple entries for the specified mount
point. If the first entry maps to an unsupported partition type and the
second entry maps to a supported partition type, the current parsing
logic returns EX_UNAVAILABLE error. We should fix this.

Modified the code to continue parsing the entries if the first match entry
maps to an unsupported partition type.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoVIX: directories created via VIX api should have 0700 permissions
VMware, Inc [Thu, 2 Aug 2012 05:24:32 +0000 (22:24 -0700)] 
VIX: directories created via VIX api should have 0700 permissions

There are visibility issues with the directories created via VIX apis
(VixVM_CreateDirectory). All the directories created via VIX apis should
be tagged with 0700 permissions instead of 0755 permissions.

Added few Ex functions in file.c to create directories with the specified
permission. Modified the vix tools code to create the new Ex functions
with the specific permission mode.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoInternal branch sync. Included in this change:
VMware, Inc [Thu, 2 Aug 2012 05:23:51 +0000 (22:23 -0700)] 
Internal branch sync. Included in this change:

. Allow Mac code to be able to override the expansion of '~'

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

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoBump up the Tools version for several milestones
VMware, Inc [Thu, 2 Aug 2012 05:19:30 +0000 (22:19 -0700)] 
Bump up the Tools version for several milestones

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoI18n: prevent integer overflows
VMware, Inc [Thu, 2 Aug 2012 05:21:58 +0000 (22:21 -0700)] 
I18n: prevent integer overflows

This is an I18n and a security issue. When growing a dynbuf we
may integer overflow. Detect when overflow will occur and return
an error.

Also look further into the stack and clean up a few places more.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agolib/stubs: fix infinite loop in stub-user-msg.c
VMware, Inc [Thu, 2 Aug 2012 05:21:50 +0000 (22:21 -0700)] 
lib/stubs: fix infinite loop in stub-user-msg.c

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoGuestInfo: ignore the extra NIC information
VMware, Inc [Thu, 2 Aug 2012 05:21:40 +0000 (22:21 -0700)] 
GuestInfo: ignore the extra NIC information

If the total number of network interfaces configured for a VM exceeds
the maximum XDR limit, then the guestInfo plugin crashes.

GuestInfo plugin calls intf_loop() to retrieve the information about all
the available interfaces. ReadInterfaceDetails() is passed as a callback
function to intf_loop(). Add a check for the number of NICs processed
and ignore the extra NIC information.  By doing this, VMware Tools
returns the maximum information that it could return and drops all the
extra NIC info on the floor.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoVMCI: Restrict access to VMCI_RPC_PRIVILEGED
VMware, Inc [Thu, 2 Aug 2012 05:21:29 +0000 (22:21 -0700)] 
VMCI: Restrict access to VMCI_RPC_PRIVILEGED

As a temporary hack, we had opened up access to the privileged RPC
handler to all users.  This fix locks it down again: on Linux, only
the superuser can access it, while on other platforms, it is denied
completely (until we add seq packet support to the common code).

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Thu, 2 Aug 2012 05:21:04 +0000 (22:21 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoVMCI: remove memset() before free()
VMware, Inc [Thu, 2 Aug 2012 05:20:57 +0000 (22:20 -0700)] 
VMCI: remove memset() before free()

Strip out redundant calls to memset() before free().

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoL10n fixes for toolboxcmd utility
VMware, Inc [Thu, 2 Aug 2012 05:20:46 +0000 (22:20 -0700)] 
L10n fixes for toolboxcmd utility

Added few msg ids for proper L10n messages in the toolboxcmd utility.

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

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoCleanup and rearchitecture of HGFS server change notification part VII
VMware, Inc [Thu, 2 Aug 2012 05:20:26 +0000 (22:20 -0700)] 
Cleanup and rearchitecture of HGFS server change notification part VII

Final initial change set for fixing FSEvents polling for Lion OS X 10.7.
This is currently an OS X host only file, but now contains the main logic
to handle the file system change notifications and is platform independent.
The OS X platform specific code is now in hgfsFSEventsMac files.

In a later change set this file will be renamed to reflect that it is
common to all platforms while the platform dependent parts will implement
the FSEvent API (as done for OS X in part VI).

Currently only the OS X platform supports the change notification feature
and as such only the scons build file has been changed.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoVIX: temporarily turn off VGAuth support
VMware, Inc [Thu, 2 Aug 2012 05:20:13 +0000 (22:20 -0700)] 
VIX: temporarily turn off VGAuth support

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>