The entries in the VMCI queue pair broker are assumed to be
stored from the guest point of view, but if the queue pair is
created by the host endpoint, the sizes are not assigned
correctly. Instead, the produce queue will have the consume
queue size and vice versa. This change ensures that the values
stored in the queue pair broker entries are always from the
guest point of view.
If the host detaches from a queue pair that is in an unmapped
state, it will erronously put it into a mapped state
(SHUTDOWN_MEM). This change makes the host detach move the
queue pair into SHUTDOWN_NO_MEM if the queue pair is already
in a *_NO_MEM state.
This change allows the host side of a queue pair to deal with a VM
being temporarily stunned in two ways; it may either block in the
queue pair enqueue or dequeue operation until the VM becomes available
or it can use a non-blocking behaviour, where the operation will
return a would block error message.
The VMCI queue pair implementation is being simplified to only
supporting VM to host communication. This new approach will
use the VM memory directly for the queue pair content, making
any host side queue pair operations work directly on the VMs
main memory, instead of operating on special shared memory
that has been remapped into the VM.
Apparently thread IDs are reclaimed immediately on POSIXen. On Windows
thread IDs are essentially unique leading to huge amounts of
MXUser (lock) tracking memory being wasted.
The fix is simple - use VThread_CurID. This is our bounded, quickly
recycled thread ID service.
Fix for Coredump in Tools when PAM fails to start.
Whenever PAM fails to start for any reason (i.e., pam_start() returns with error), calling pam_end() after that causes tools to coredump. For all other pam calls, if there is any failure pam_end() should be called.
Preserve hidden attribute for files copied from guest to MAC hosts.
Implemented the code to preserve the hidden attribute when a
file is copied from the gues to the MAC host.
Note: I have copied couple of functions from hgfsServerLinux.c. In
future, at some point of time, we should move those function to
a common file which will be consumed by various HGFS components.
Recently, we have submitted a changeset to preserve the permissions of
the directory when it is copied from the guest to host. As a part of
the changeset, a dummy fileInfo structure is added into the linked
list. When a user DND a folder from the guest to the host, we should
not display any progress when the dummy entry is processed. Modified
the code accordingly.
Modified the way, the arguments are passed while calling
HgfsSetHiddenXAttr in hgfsServerLinux.c. Re-factored the code
in ChangeInvisibleFlag() function.
Commit e2270ea62ae4d7a47d6d72942cdb8c669be6357a removed HAVE_NET_*
feature macros so we need to cope with it. Luckily most of them
were present since before 2.6.9 so we can just remove references
to them.
This is a minimal change needed to build for 3.1 and suitable for
cross-porting; more cleanups will follow.
So, like, napkin cost-benefit analysis showed this plugin wasn't worth
keeping around. Workstation & Fusion users overwhelmingly stick with the
"official" Tools, and appliance vendors aren't particularly interested in
Unity. Meanwhile, we're still getting bit with build failures by dealing
with disjoint build systems. (Oh, and GHI has been busted since October,
anyway.)
Use individual arguments for the components of opening a menu and opening a specific item in a menu.
Rather than having the library do all the serialization to a DynBuf (containing an ASCII
representation sent over the backdoor) return the individual items in their original form
and defer the serialization to the plugin which is more acquainted with the transport
requirements.
The problem is that the test is broken for Linux, and it
appears to work with INET but actually it doesn't.
What happens with /st is that when we do the send(), we
actually get a SIG_PIPE, and the process exits, but there's
no error message, so it looks like the test passes. Based
on this pass, when running the same test for vSockets, it
seems like we don't match the behavior because we fail.
But fixing the signal problem, by passing MSG_NOSIGNAL to
the send, makes it fail for INET too. So now the test
fails for both system sockets and vSockets
The correct behavior on Linux is for the final recv() to
succeed. Even with a local shutdown, the socket should
return 0 after a recv().
This change fixes the test to expect 0 on Linux (and
failure only for Windows, which is correct).
Change MXUserGetNativeTID to MXUserGetThreadID - don't imply anything
about where the thread ID is derived from, we may choose native and
portable implementations.
[unity] Move glib signal from lib/unity to unity plugin.
The dnd plugin expects the unity plugin to emit a g_signal whenever
we enter or exit unity so that it can update some state. Since the
signal is strictly a plugin thing, move it out of the unity library
code and into the unity plugin code, which feels like a better fit.
Two things that we don't need in vm_assert.h; both of
these disappeared >5 years ago.
- LogDB/WarningDB: we don't need special hooks anymore for
logging these. (They weren't hooked up to anything special.)
- FILECODE: we stopped using this ~2005. Six years later, the
warnings probably aren't useful.
The main purpose of this change is to allow using Linux ioctls that were
added in 2.6.29 (and backported to a few distro kernels) instead of our
own vmsync driver to freeze/thaw file systems.
This particular change required changing the way the POSIX sync driver
backend works, since it now has to try different backends to see what is
available or not. This means having a second "null" backend (the other
one is in the vmbackup plugin).
On top of that, I decided to clean up some of the code. Mainly:
. put the POSIX backends in their own files, make the syncDriverPosix.c
just call into the backends.
. get rid of the "DrivesAreFrozen()" call which wasn't really that useful,
and couldn't be implemented in some situations (e.g., the Linux ioctls).
Eliminate duplicate handle field from VMCI resources.
Each VMCI resource has handle field, which is a
duplicate of the handle that is already stored within
the hash entry, which is also embedded inside the
resource.
This change removes the handle field and adds an
accessor to retrieve the handle from resource via
the hash entry. The doorbell code has been modified
to use this accessor.
We have a backdoor command i.e. VIX_BACKDOORCOMMAND_CHECK_USER_ACCOUNT but
is not used anywhere in the code. VMX forwards "check user account" commands
through backdoor using VIX_BACKDOORCOMMAND_COMMAND.
I have removed the code that is related to
VIX_BACKDOORCOMMAND_CHECK_USER_ACCOUNT.
VMware, Inc [Mon, 22 Aug 2011 20:26:45 +0000 (13:26 -0700)]
Correct the definition of COMPAT_NETDEV_TX_BUSY
NETDEV_TX_* became enum after 2.6.31. Hence the current definition
fails to define COMPAT_NETDEV_TX_BUSY properly. It is defined as 0x1
instead of 0x10. This changes fixes the definition of
COMPAT_NETDEV_TX_BUSY
VMware, Inc [Mon, 22 Aug 2011 20:21:37 +0000 (13:21 -0700)]
Fix disk device detection on Mac OS.
A recent reorg of this code seems to have uncovered an issue where our
FreeBSD-targeted WiperIsDiskDevice doesn't really work on MacOS, in spite
of what the comments say.
VMware, Inc [Mon, 22 Aug 2011 20:21:04 +0000 (13:21 -0700)]
Move unity back-ends into subdirs.
Move the per-platform unity code into subdirs. This change has
the makefile and source code changes required.
Note that I had to rename lib/unity/x11/platform.cc to
lib/unity/x11/x11platform.cc to work around a problem in the
open-vm-tools build; platform.h was renamed for consistency.
VMware, Inc [Mon, 22 Aug 2011 20:12:40 +0000 (13:12 -0700)]
tools: remove the last vestige of fixed length strings
The caching technique used in the guestInfo server was built around
fixed length strings. This is unnecessary and can lead to an assertion
failure (too long) should real data exceed the hard limits. Change
this to allow strings of any length.
VMware, Inc [Mon, 22 Aug 2011 20:12:14 +0000 (13:12 -0700)]
lib/misc: Do not constrain the OS name string
The Hostinfo API for obtaining the OS name constrains the name
of the OS. These strings are highly variable in length and may
grow unexpectedly. Refactor the API to not care about the length
and fixup the call sites.
In a future change the internals of lib/misc will be overhauled
to also not care about the size. For now the (internal) size will
be inflated to more than large enough (512).
Another future change will remove any limitations found within the
tools code.
This warning is more annoying than useful. It breaks too easily with
our ASSERT (which is a no-op in non-debug builds) and other styles of
coding we use for cross-platform support.
VMware, Inc [Mon, 22 Aug 2011 20:02:44 +0000 (13:02 -0700)]
Support for VMODL Guest Operations inside a FreeBSD Guest OS.
The following changeset reflects support for the GuestProcessManager APIs only.
(GuestFileManager APIs will be worked upon next).
. Enable some Posix_ & ProcMgr_ functions for FreeBSD
. Enable Impersonate functions for Start, Stop, GetUserInfo for FreeBSD
. Write new function for Listing Processes using libkvm (procfs is not auto mounted in FreeBSD for security reasons)
. Use the original process envp pointer (from the AppToolsContext) in VixTools_Initialize() to build the user env hash table. This was suggested by Marcelo over trying to use the "environ" global variable, since "environ" might reflect additional env changes done by the loader scripts, that should not be returned to the VixClient user.
VMware, Inc [Mon, 22 Aug 2011 19:57:41 +0000 (12:57 -0700)]
Fix OS X 10.7 unzip of files in shared folders using Archive Utility
Using Finder to double click on a zip file invokes the Archive
utility which fails to unzip a file on HGFS shares.
This was due to a read request of zero bytes being incorrectly handled.
The request was forwarded to the HGFS server which misinterpreted
the request for backdoor V3 read operation to instead using the
shared memory. This caused a protocol error to be returned from the
HGFS server.
The fix therefore is really two fold:
- The HGFS client should short-circuit the empty read and complete it
successfully immediately.
- The HGFS server should correctly handle zero length read requests
and not assume they will never be sent from any client.
VMware, Inc [Mon, 22 Aug 2011 19:48:33 +0000 (12:48 -0700)]
Fix Mac OS tools.
Two fixes:
. Enable Hostinfo_TouchBackDoor for Mac OS. The comment doesn't seem to be
true, at least not anymore.
. On Mac OS, create the glib main loop with the "running" flag set. Since
we don't call g_main_loop_run() on Mac OS, that's the only way to signal
that the loop is running.
The file locking code for POSIXen was depending on /proc, a
Linuxism. Should /proc not be accessible, create a default
process descriptor instead of failing.
Improve the robustness and information logging of the process
validation used by the file locking code.
Define an improved, upwards compatible format for the execution
ID such that is is possible to include the name of the process
should it be available. This change is done such that older
code will run properly, even if it sees a newer lock file.
Now that there's only one call site, move functions of questionable general
utility to the place where they're needed, or replace them with equivalent
code.
gcc 4.6 complains about "set but unused" variables by default with -Werror.
Fix the code that triggers that warning. Also sneak in a fix to
rpcgen_wrapper.sh.
Capture screen is not working well with CP enabled
The reason for the bug is that there is a race condition between regular
copy/paste and guest screen capture copy/paste.
1. There is image A on host clipboard.
2. After switch from host to guest, image A is copied to guest clipboard
3. User does a guest screen capture and it is put into host clipboard
4. After switch from guest to host, image A is copied again from guest
to host and overwrites the new guest screen capture in host clipboard.
The fix is not to do step 3. To do this, clipboard timestamp after step
2 is recorded. When user switches from guest to host (step 4), the
timestamp will be checked. If the timestamp is not changed, the guest
clipboard will not be copied to host.
Use the newly introduced HOSTINFO_DAEMONIZE_LOCKPID flag to lock the pid
file vmtoolsd generates when daemonizing so that vmtoolsd will refuse to
run multiple instances using the same pid file.
In Hostinfo_Daemonize prevent two processes from daemonizing using the
same PID file by taking an advisory exclusive lock on the PID file
before daemonizing the process.
In HgfsDirLlseek() function, a copy of mutex/semaphore is retrieved
and a lock is acquired on the copy. This is not correct and can lead
to issues. We should ideally acquire a lock on the original
mutex/semaphore of the inode.