VMware, Inc [Thu, 22 Dec 2011 00:12:36 +0000 (16:12 -0800)]
Destory the sessions if they are inactive for a long amount of time.
This changeset is an extension to my earlier changeset #1592340. In
the changeset #1592340, I have implemented the 'InvalidateInactiveSessions'
function in the HGFS server. When this new function is called, it
checks for the inactivity of each session and invalidates the session
if it is inactive for a long amount of time. Also, we should ideally
implement another feature that destroys the session if the session is
inactive for a very long amount of time. Modified the code to destroy
the sessions besides just invalidating the sessions.
Also, implemented the code to limit the number of sessions that can be
created in one transport. HGFS server returns an error if the maximum
number of sessions are already created.
VMware, Inc [Thu, 22 Dec 2011 00:03:22 +0000 (16:03 -0800)]
Implement 'InvalidateInactiveSessions' in hgfsServer.
This is the third part of the fix to make the HGFS server more robust.
Please check the wiki: https://wiki.eng.vmware.com/PGI/RobustVIXFileCopy for
more details.
Implmented a new function i.e. HgfsServerSessionInvalidateInactiveSessions
in HgfsServer. When this function is called, it checks all the available
HGFS server sessions and invalidate the inactive sessions. Everytime a
request is processed, session is tagged with timestamp when the request
is processed. If no request has been processed in the last 2 minutes, then
the session will be tagged as inactive and will be invalidated.
Callers can make use of this function invalidate the inactive session.
Implemented a watchdog in vixTools module which periodically sends this
request to the HGFS server.
Note: In this changeset, I have implemented the watchdog only in the
vixTools plugin. Not sure, if we require the same watchdog in another
modules.
VMware, Inc [Mon, 21 Nov 2011 23:55:30 +0000 (15:55 -0800)]
OVT: Build lib/xdg with GLib flags.
Didn't realize this library, as built for OVT, wasn't implicitly built
w/ GLib headers in the include path, so adding a call to g_debug broke
things. Whoops.
VMware, Inc [Mon, 21 Nov 2011 23:53:56 +0000 (15:53 -0800)]
Unity/X11: Tweaks to support Ubuntu 11.10.
• Refresh the logic in xdg-detect-de based on xdg-utils Git commit 5010c394.
We now grok LXDE and Unity.
• xdg-find-menus now uses (vmware-)xdg-detect-de instead of duplicating its
own desktop environment detection.
• Changed Xdg_GetDesktopEnv semantics slightly. It now returns a case-
insensitive alphanumeric string on success and "" (as opposed to NULL) on
failure.
VMware, Inc [Mon, 21 Nov 2011 23:51:38 +0000 (15:51 -0800)]
Reduce heap allocations when listing processes in the guest.
Friday clean-up. We can just put the integer key in the data
structure that stores the state of the operation, and then pass the
address of that field to the hash table.
This does mean we need to use g_hash_table_replace() instead of
insert(), since we must update the key if we update the value.
Also, when passing the key along to timeout/clean-up function, just
stuff it into the pointer, since pointers are always large enough to
hold an int. This means more casts, but one fewer call to malloc().
VMware, Inc [Mon, 21 Nov 2011 23:51:00 +0000 (15:51 -0800)]
lib/lock: things go back
The entire new lib/lock structure is back in... except that
there is an ifdef for working the new way. By default it will
run compatible with the old way.
I've discovered that there are as many as 5 copies of lib/lock in
some of our products (i.e. Linux UI). Things would be fine if the
copies were used in a self contained fashion. When lib/lock runs
in the new way, random syndrome bits per library caused crashes
and hangs proving we're leaking locks across a boundary (something
unexpected).
Two copies of lib/lock passing around locks could be fatal if the
two copies are different versions of lib/lock.
Unfortunately logs and core dumps haven't been easy to find. I'm going
to begin a detailed search for the root cause via the ifdef; others
should not be affected.
VMware, Inc [Mon, 21 Nov 2011 23:37:41 +0000 (15:37 -0800)]
lib/lock: finally put back the fix
This heavily reviewed change goes back in with one exception -
the part of the change that altered the size of structures isn't
included. The altering of structure sizes is causing hangs and
crashes. Hopefully the run-time checking, already in, will catch
the problems and we can clean those up. Once cleaned up we will
be free to alter structure sizes.
VMware, Inc [Mon, 21 Nov 2011 23:36:24 +0000 (15:36 -0800)]
lib/lock: if you can't beat'em, join'em
Every time I change lib/lock to help find a bug it causes
problem if and only if I alter the size of a structure. This
indicates that there are multiple copies of lib/lock floating
around (known; as many as 5 copies have been observed), some that
may be incompatible with each other.
This change adds a real time signature and identification analysis
to lib/lock. It does this without changing any structure sizes. It
will help us catch the culprits and come up with a build plan to
handle this.
The run-time checking is done by having lib/lock always use a
unique signature, regardless of what type of build it is in. Any
lock that comes from a different copy of lib/lock will have a
different signature.
Previously, the signatures were static and also provided debugging
help to the type of lock.
VMware, Inc [Mon, 21 Nov 2011 23:26:59 +0000 (15:26 -0800)]
DnD: fix vmblock-fuse detection on newer Linuxes
Newer Linuxes, such as Fedora 15 and Ubuntu 11.10, have
/var/run symlinked to /run so when we read existing mount
points in search of fuse.vmware-vmblock our matching on
/var/run/vmblock-fuse does not work anymore.
Try to resolve supplied mount point before comparing with
mount data.
VMware, Inc [Mon, 21 Nov 2011 23:24:07 +0000 (15:24 -0800)]
lib/lock: begin putting back changes
An earlier change, once again, blew up various products and so
was backed out. Put back in what we can, things that don't cause
the problem to occur. This will minimize later changes.
VMware, Inc [Mon, 21 Nov 2011 23:19:26 +0000 (15:19 -0800)]
glib logger: don't try to log to an invalid fd.
See nasty details in the comment for FileLoggerIsValid(). Long story short,
glib will cause log recursion and because it abort(3)s the process when
that happens instead of letting us handle the recursion, things don't work.
VMware, Inc [Mon, 21 Nov 2011 23:04:36 +0000 (15:04 -0800)]
glib logger: use a GIOChannel instead of a FILE pointer
That code can be linked to a different version of the
MS CRT than the glib library we're using, and when that happens it's not
safe to use the FILE pointer returned by glib with CRT functions.
VMware, Inc [Mon, 21 Nov 2011 23:01:43 +0000 (15:01 -0800)]
Call vmwarectrl to set host GUI topology even if we use RandR12
The new vmwgfx driver needs to be separately informed about the host GUI topology since with screen objects we differentiate between that and Guest FB layout, which is set using RandR12.
We could in theory set the host gui layout using direct kernel calls to the modesetting system of the kernel, but we won't do that until we've sorted out the security implications.
To be paranoid, we grab the X server around the host GUI information update and the guest FB layout update, taking care to really flush the
XUngrabServer call.
VMware, Inc [Mon, 21 Nov 2011 23:01:21 +0000 (15:01 -0800)]
Adapt to new output names of the vmwgfx driver
The kernel- and Xorg vmwgfx drivers are about to change the output
/ connector names from LVDSx to Virtualx reflecting that we're not
setting up LVDS monitors but virtual monitors.
VMware, Inc [Mon, 21 Nov 2011 22:58:49 +0000 (14:58 -0800)]
lib/lock: Remove racey run time check
In the lock release code the count was being checked for
validity. This is a mistake as another thread may immediately
after the lock drops and affect the count.
Properly use the reference counting and destroy the lock on its
last access/release.
VMware, Inc [Mon, 21 Nov 2011 22:58:02 +0000 (14:58 -0800)]
lib/lock: MXUser Recursive Try test failure issue
The MXUser Lock Facility has the ability to arbitrarily fail a
try lock for testing purposes. The lock reference count needs to
decremented if a force fail is a called for.
VMware, Inc [Mon, 21 Nov 2011 22:57:41 +0000 (14:57 -0800)]
Implement separate HgfsSessions for Transport layer and Sessions layer.
To make the hgFileCopy more robust, we have decided to implement
separate sessions in the transport layer and the session layer. I
implemented a list of sessions in the transport layer. Moved the necessary
attributes from HgfsTransportSessionInfo to HgfsSessionInfo. Modified
all the necessary server connect|disconnect|receive|... functions to handle
the packets properly.
VMware, Inc [Mon, 21 Nov 2011 22:55:15 +0000 (14:55 -0800)]
lib/lock: centralize MXUser object header signature control
The setting and checking of MXUser object header signatures
is centralized. Eventually, we can make a change in one place
and have a way to detect old libraries; perhaps even multiple
libraries.
VMware, Inc [Mon, 21 Nov 2011 22:53:26 +0000 (14:53 -0800)]
lib/lock: put things back together
My previous change, which had several parts, caused problems
with 64-bit systems. I backed out the change. Now I'm putting
things back, one piece at a time. This piece is the trivial,
cosmetic piece.