VMware, Inc [Tue, 19 Oct 2010 20:07:05 +0000 (13:07 -0700)]
Make failure to find the install path non-fatal.
On Windows if the InstallPath registry key cannot be found loading an
old-style configuration file raises an ASSERT. This is only because
some of the default configuration options seeded into the configuration
dictionary require the install path.
VMware, Inc [Tue, 19 Oct 2010 20:05:57 +0000 (13:05 -0700)]
Make VMCI not advertise masking capability for MSI
The initial MSI/MSI-X implementation for VMCI was "inspired"
by the vmxnet3 one. Recently, a performance issue in certain
RHEL 5.X guest for MSI was fixed in vmxnet3 emulation by no
longer advertising the masking capability for MSI. VMCI
suffers from the same performance problem for these guests, so
don't advertise masking for VMCI either.
This change also adds module parameters to selective disable
MSI-X and MSI, and defaults to MSI instead of MSI-X for pre
2.6.19 linux kernels, since MSI-X has known performance issues
there.
VMware, Inc [Tue, 19 Oct 2010 20:05:11 +0000 (13:05 -0700)]
GHI/X11: Fixed item menu (places, bookmarks), DE-agnosticism
o Switched back to Glib::ustring for std::string and glibmm compatibility.
o Introduced "pseudo app" concept to represent fake applications shown in
GNOME and KDE "Places" menus. (Still not fully populated, but I'll add
those shortly.)
Some back-ends don't need helper threads in the first place (x11),
and even if a back-end does need a helper thread, the front-end
should not know or care about it.
VMware, Inc [Tue, 19 Oct 2010 19:53:47 +0000 (12:53 -0700)]
unity: Clear all windows from tracker on unity exit.
Since we are no longer using the REMOVE_UNTOUCHED flag in our call to
UWT_RequestUpdates(), we must remove any remaining windows left in the
UWT ourselves when we exit unity. Otherwise, if the windows are closed
by the user while we are in single window mode, they are never removed
from the UWT and show up as "blank" rectangles on the host screen the
next time we enter unity.
VMware, Inc [Tue, 19 Oct 2010 19:50:21 +0000 (12:50 -0700)]
VMCI QPair ops must check for valid queues.
When a host (on hosted platforms) creates a VMCI queue pair,
the actual queue content isn't available until a guest
attaches, since the guest is responsible for creating the
queue pair page files and handing them down to the host. Only
at that point will pointers to queue data and queue header be
valid. This works fine with VMCI Sockets in blocking mode,
since connecting a stream socket only returns when both sides
are attached to the queue pair. However, for non-blocking
sockets, we will return earlier - while the stream socket is
still in the connecting state. A subsequent poll to determine
the state of the connecting stream socket may then attempt to
access the queue header to figure out whether the socket has
available data or free space. If the queue header is invalid,
bad things happen. This change adds checks to the VMCIQPair
API implementation, that detects queues with no data, and in
that case reports the queues as having no available data or no
free space, which is essentially true. For the operations that
retrieves pointers, VMCI_ERROR_QUEUEPAIR_NOTATTACHED is now
returned, since we don't want to depict a state that isn't
correct.
VMware, Inc [Tue, 19 Oct 2010 19:21:58 +0000 (12:21 -0700)]
Unix Balloon: do not use ASSERT()s in kernel driver
Our VMware-defined ASSERT() uses Panic() which is not available
in kernel drivers. Instead of implementing stubs we better
remove recently-introduced ASSERTS().
VMware, Inc [Tue, 19 Oct 2010 19:21:35 +0000 (12:21 -0700)]
lib/lock: capture the return address of the caller differently
Right now, regardless of builds, the return address of the caller
to an MXUser lock function is captured and passed around. It is only
recorded in one place in a debug build.
Remove the capturing, making things slightly faster in a release
build and provide the ability to see all of the holders of RW lock.
VMware, Inc [Tue, 19 Oct 2010 19:20:43 +0000 (12:20 -0700)]
Fix search read error.
Fix a search read issue when we fail to stat an entry but still
want to return success. The entry was supposed to return a fudged
entry with attributes for a regular file, but it failed to set
the attribute mask field to say the type was valid. This causes
the hgfilecopy operation to be canceled.
VMware, Inc [Tue, 19 Oct 2010 19:19:57 +0000 (12:19 -0700)]
Lazily attach console when logging to stdout.
Instead of attaching a console when configuring the logger, do it when
the first log message is written. This ensures that a console only pops
up when the application actually tries to use it. The console is also
detached when the last log domain using it is shut down.
This avoids an issue where consoles would pop up when you configured std
logging for a different application, but all applications sharing the tools
config file ended up attaching a console to their process.
Also fix an issue where an invalid handler was set up for the app's main
log domain, which could cause an ASSERT to be hit.
VMware, Inc [Tue, 19 Oct 2010 19:19:37 +0000 (12:19 -0700)]
Tools l10n: relocate the vmsg catalogs to a "l10n" directory.
This makes the vmsg-based apps more consistent with the other apps we have.
Also rename the Chinese files to "zh_CN" (simplified Chinese) as per
l10n team's instructions.
VMware, Inc [Tue, 19 Oct 2010 19:19:09 +0000 (12:19 -0700)]
Minor changes to the Tools plugin API.
While working on a VMCF provider plugin, I ran into some issues that are
better solved by making some slight modifications to the API. Since the
incompatible changes are not really used by any production code yet, and
the API is not yet public, these should be OK without the need to change
the current "API version".
The changes are:
. provide a pointer to the plugin that owns an app registration to the
app provider's callback. This allows app providers to call the plugin's
error callback directly at their own convenience.
. add an inline function that plugins can use to print state information
in a consistent manner.
. add a convenience macro to make calls to VMTools_WrapArray look less
cluttered.
. stop app providers before sending the SHUTDOWN signal, so plugins can
then safely free their internal state without causing issues with app
providers that reference that data. Also only call a provider's shutdown
handler when it was successfully activated.
. allow debug plugins to also export a regular plugin interface. This
should make it safer for these plugins to register for signals at the
right times, and to also test more complicated applications.
VMware, Inc [Tue, 19 Oct 2010 19:12:47 +0000 (12:12 -0700)]
OVT: Unity/GHI depends on GLib/GIO 2.24+.
New icon handling code relies on GAppInfo/GDesktopAppInfo from GIO
2.24. Enforce this by having configure.ac test for the library unless
user disables Unity, and then make use of the appropriate cppflags/libs
macros when building the plugin.
CS 1162826 introduced regressions in error handling of memory
allocation for chunks:
- page was not unlocked/freed when we could not get a new
chunk to store the page;
- we were returning hard error instead of memory allocation
error causing inflation cycle to stop prematurely instead
of retrying with "sleep" allocation.
VMware, Inc [Tue, 19 Oct 2010 19:04:23 +0000 (12:04 -0700)]
GHI/X11: Reimplement menus, icons using gnome-menus & GIO.
This change replaces GHI/X11's handling of launch menus by using
libgnome-menu as its XDG menu-spec implementation. As written,
this code only works with Ubuntu 10.04 GNOME and KDE guests. (This
will be fixed soon.)
To avoid trying to lock the pages repeatedly when balloon target
was decresed while balloon is being inflated recognize
BALLOON_ERROR_PPN_NOTNEEDED status returned by the hypervisor
and interrupt the cycle immediately.
Also cleaned up the ballon inflation code to match the version
used in mainline Linux kernel. Driver version is updated to match
upstream version (which will be 1.2.1.2-k).
VMware, Inc [Tue, 19 Oct 2010 18:54:15 +0000 (11:54 -0700)]
Cleanup rpcin interface.
Now that vmware-user is gone, there's no code left that needs to work
both with the old RpcIn interface and the new RpcChannel interface. So
we can do some cleanup:
(i) remove the new-style callbacks from the old-style RpcIn interface.
The spots in the old code that used the new API were reverted to use
the old API. So now code using the old RpcIn interface directly is
stuck with the old API.
(ii) Remove the RpcInRet type, which was used by VIX code when it needed
to compile both in vmtoolsd and vmware-user. That type was added in
change 946632.
(iii) Remove some debug logging that was ifdef'd out anyway, and didn't
make sense in this day and age of mostly binary RPCs.
VMware, Inc [Tue, 19 Oct 2010 18:48:18 +0000 (11:48 -0700)]
Text copy using CTRL+A from KDE fails from guests to host
There are 2 different types of selections on Linux: primary and
clipboard. Our internal protocol only supports 1 type at a time. The
reason for the bug is that with current implementation, we almost pick
primary selection if it is available. And in this bug case both primary
and clipboard are available, and clipboard data is more recent, but
we still pick the primary selection. The fix is to first check timestamp,
and if both primary and clipboard are available, we pick the latest one.
VMware, Inc [Tue, 19 Oct 2010 18:47:51 +0000 (11:47 -0700)]
guest info: use common log domain.
Modify the log calls in the guest info plugin to use the glib functions,
and make sure G_LOG_DOMAIN is set appropriately everywhere by including
the shared header file where it's defined.
The duplicate guestInfoInt.h header was renamed to getlibInt.h, and a
couple of things in it were cleaned up in the process.
VMware, Inc [Tue, 19 Oct 2010 18:42:09 +0000 (11:42 -0700)]
Fix forwards compatibility with HGFS server
HGFS server pack reply for operations fail to set reserved fields
to zero. This means that if these reply fields need to be used
in the future HGFS clients would not be able to trust the values.
The reserved fields must be returned with zero until used.
VMware, Inc [Tue, 19 Oct 2010 18:41:52 +0000 (11:41 -0700)]
Check for XDR limits when populating guest info structs.
We defined some arbitrary limits for the wire protocol, but our code was
not checking for them, relying instead on the serialization code to fail
if that happened.
The bad side is if that happened, no information was sent to the host, or
an older version of the information.
This change takes the inverse approach: instead of failing the whole
operation, just ignore any entries that would cause an overflow of the
defined limits. Then at least we provide some data to the host.
VMware, Inc [Tue, 19 Oct 2010 18:41:10 +0000 (11:41 -0700)]
Incorrect error code while sending dgram in nonblock mode to host.
Actually this error was occuring on both ends. We were incorrectly
mapping VMCI_ERROR_INVALID_RESOURCE to EINVAL, which is wrong.
It really means we cannot find the destination endpoint. Fixed
the mapping.
Also discovered a bug in the Linux driver, where we would hit an
ASSERT when the length of the buffer passed to recv() was zero.
This is a valid case on Linux, recv on a zero-length should pass,
so fixed that too.
VMware, Inc [Tue, 19 Oct 2010 18:39:36 +0000 (11:39 -0700)]
guest info: ignore interfaces with invalid MAC address.
When the OS is messing with interfaces (such as bringing them up or down),
the guest info plugin may see an interface with an invalid MAC address, at
least on Solaris. Trying to write that iface's data to the nic info
structure causes the plugin to crash (probably because addr_ntoa doesn't
understand the address and is returning garbage, that we then try to read
when writing it as a string).
So just skip those. When the gather loop runs again, we'll pick up any
changed interfaces.
VMware, Inc [Tue, 19 Oct 2010 18:39:07 +0000 (11:39 -0700)]
Extend VMCI kernel interface on Windows to full API.
We also add API versioning. There is now vmciKernelAPI1.h
and vmciKernelAPI2.h, specifying version 1 and 2 of the API,
respectively. vmciKernelAPI includes both of them and thus
exports the latest API. Clients can include that file or
a specific version. We define VMCI_KERNEL_API_VERSION in
each header as appropriate.
VMware, Inc [Tue, 19 Oct 2010 18:35:43 +0000 (11:35 -0700)]
Relocate the TCLO RPC handlers for Unity & GHI into the plugin layer.
This change relocates the TCLO/RPCChannel code from within the Unity &
GHIntegration libraries to the Tools Core Services plugin. This gives the Unit &
GHI libraries a 'transport neutral' interface so that they can be called from
any effectve transport between host and guest.
VMware, Inc [Tue, 19 Oct 2010 18:29:27 +0000 (11:29 -0700)]
Retire VMCIQPair_Init
Queue pairs allocated with VMCIQPair_Alloc are initialized by
either the hypervisor or the VMCI driver (for local queue
pairs) and has been doing so since the initial release of VMCI
with queue pairs (ws65), so VMCIQPair_Init isn't necessary
(and may not do what you think, since it only initializes half
a queue pair). So retire it.
This change improves the VMCI Windows guest drivers handling
of hibernation. Before this change, any device state that is
partly or fully mirrored in the device driver as well, would
become out of sync when coming out of hibernation, e.g., queue
pairs would no longer be allocated on the hypervisor side but
the guest driver would still believe that they were active.
This change deals with such state in two ways: 1) For queue
pairs, all non-local queue pairs are converted to local ones
when going into hibernation. This part utilizes the exisiting
support on the Windows host side for converting queue pairs to
local memory (on the Windows host side it is used when the VMX
goes away). 2) For doorbells, we simply reregister any
doorbells when leaving hibernation.
BKL is being removed from the kernel and we should not be using it
either. Unstead of trying to use lock_kernel()/unlock_kernel()
acquire vmci_dev.lock mutex when entering IOCTL code and make sure
that we fully initialize device state before registering the
character device.
Also rename old locked IOCTL handler into vmci_legacy_ioctl()
and vmci_unlocked_iocctl() into vmci_ioctl() and add some
__init/__exit/__devinit/__devexit markings.
Allow providers to set an error message in the backup state object, which
is then used to construct the full error message.
The "errorMsg" field could probably have been done in a cleaner way, but
right now that would require too much churn in the plugin's internal API
(which needs some more thorough cleanup at some point).