]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Internal branch sync. Included in this change:
authorVMware, Inc <>
Wed, 24 Feb 2010 21:16:58 +0000 (13:16 -0800)
committerMarcelo Vanzin <mvanzin@vmware.com>
Wed, 24 Feb 2010 21:16:58 +0000 (13:16 -0800)
. Changes in shared code that don't affect open-vm-tools functionality.

. Host/Guest shared structures, RPCs and capability definition for autologon.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/lib/foundryMsg/foundryThreads.c
open-vm-tools/lib/include/foundryThreads.h
open-vm-tools/lib/include/log.h
open-vm-tools/lib/include/unityCommon.h
open-vm-tools/lib/include/vixExternalThread.h [new file with mode: 0644]
open-vm-tools/lib/include/vm_basic_defs.h
open-vm-tools/lib/include/vm_product.h
open-vm-tools/lib/include/vmware/guestrpc/capabilities.h

index 729a4c8fe2365457bee26f6c6d30ed966a72e1e8..43848c5ce9e5ae40f296166e33f0ef34822c7847 100644 (file)
@@ -53,14 +53,19 @@ static void *FoundryThreadWrapperProc(void *lpParameter);
 #endif
 #endif
 
-typedef void (*VixThreadFuncType)(void *);
-typedef void (*VixScheduleWorkFuncType)(VixThreadFuncType, void *);
+#include "vixExternalThread.h"
 
-typedef struct IVixThread {
-   VixScheduleWorkFuncType ScheduleWorkFunc;
-} IVixThread;
+typedef enum VixThreadType {
+   VIX_THREAD_WORKER,
+   VIX_THREAD_IO,
+   VIX_THREAD_DEDICATED
+} VixThreadType;
 
-void Vix_SetExternalThreadInterface(IVixThread *threadInt);
+static struct FoundryWorkerThread *
+FoundryThreadsStartThreadInternal(FoundryThreadProc proc,
+                                  void *threadParam,
+                                  const char *threadName,
+                                  enum VixThreadType type);
 
 static void FoundryThreadWrapperWrapper(void *);
 
@@ -143,9 +148,9 @@ Vix_SetExternalThreadInterface(IVixThread *threadInt) // IN
 /*
  *-----------------------------------------------------------------------------
  *
- * FoundryThreads_StartThread --
+ * FoundryThreadsStartThreadInternal --
  *
- *      Start a worker thread.
+ *      Start a thread.
  *
  * Results:
  *      FoundryWorkerThread *
@@ -155,10 +160,11 @@ Vix_SetExternalThreadInterface(IVixThread *threadInt) // IN
  *-----------------------------------------------------------------------------
  */
 
-FoundryWorkerThread *
-FoundryThreads_StartThread(FoundryThreadProc proc,    // IN
-                           void *threadParam,         // IN
-                           const char *threadName)    // IN
+static FoundryWorkerThread *
+FoundryThreadsStartThreadInternal(FoundryThreadProc proc,    // IN
+                                  void *threadParam,         // IN
+                                  const char *threadName,    // IN
+                                  VixThreadType type)        // IN
 {
    VixError err = VIX_OK;
    FoundryWorkerThread *threadState = NULL;
@@ -176,8 +182,22 @@ FoundryThreads_StartThread(FoundryThreadProc proc,    // IN
    threadState->threadName = threadName;
 
    if (UseExternalThreadInterface()) {
-      (*GlobalVixThreadInterface->ScheduleWorkFunc)(
-         FoundryThreadWrapperWrapper, threadState);
+      switch (type) {
+      case VIX_THREAD_WORKER:
+         (*GlobalVixThreadInterface->ScheduleWorkFunc)(
+            FoundryThreadWrapperWrapper, threadState);
+         break;
+      case VIX_THREAD_IO:
+         (*GlobalVixThreadInterface->ScheduleIOFunc)(
+            FoundryThreadWrapperWrapper, threadState);
+         break;
+      case VIX_THREAD_DEDICATED:
+         (*GlobalVixThreadInterface->ScheduleDedicatedFunc)(
+            FoundryThreadWrapperWrapper, threadState);
+         break;
+      default:
+         NOT_IMPLEMENTED();
+      }
       goto abort;
    }
 
@@ -221,7 +241,93 @@ abort:
    }
 
    return threadState;
-} // FoundryThreads_StartThread
+} // FoundryThreadsStartThreadInternal
+
+
+/*
+ *-----------------------------------------------------------------------------
+ *
+ * FoundryThreads_StartThread --
+ *
+ *      Start a new thread or farm out the specified procedure to an
+ *      external worker thread pool.
+ *      A worker thread should not do blocking I/O.
+ *
+ * Results:
+ *      FoundryWorkerThread *
+ *
+ * Side effects:
+ *
+ *-----------------------------------------------------------------------------
+ */
+
+FoundryWorkerThread *
+FoundryThreads_StartThread(FoundryThreadProc proc,    // IN
+                           void *threadParam,         // IN
+                           const char *threadName)    // IN
+{
+   return FoundryThreadsStartThreadInternal(proc, threadParam, threadName,
+                                            VIX_THREAD_WORKER);
+}
+
+
+/*
+ *-----------------------------------------------------------------------------
+ *
+ * FoundryThreads_StartIOThread --
+ *
+ *      Start a new thread or farmed out the specified procedure to an
+ *      external IO thread pool.
+ *      An IO thread performs short IO operations.
+ *      In hostd (vmacore) IO threads should generally complete quickly and
+ *      should never wait on worker threads. Worker threads can wait on at
+ *      most one IO thread.
+ *
+ * Results:
+ *      FoundryWorkerThread *
+ *
+ * Side effects:
+ *
+ *-----------------------------------------------------------------------------
+ */
+
+FoundryWorkerThread *
+FoundryThreads_StartIOThread(FoundryThreadProc proc,    // IN
+                             void *threadParam,         // IN
+                             const char *threadName)    // IN
+{
+   return FoundryThreadsStartThreadInternal(proc, threadParam, threadName,
+                                            VIX_THREAD_IO);
+}
+
+
+/*
+ *-----------------------------------------------------------------------------
+ *
+ * FoundryThreads_StartDedicatedThread --
+ *
+ *      Start a new thread or farmed out the specified procedure to an
+ *      external dedicated thread pool.
+ *      A dedicated thread has a life time of the containing process.
+ *      Usually the thread alternates wait and work in a loop, such as a poll
+ *      loop.
+ *
+ * Results:
+ *      FoundryWorkerThread *
+ *
+ * Side effects:
+ *
+ *-----------------------------------------------------------------------------
+ */
+
+FoundryWorkerThread *
+FoundryThreads_StartDedicatedThread(FoundryThreadProc proc,    // IN
+                                    void *threadParam,         // IN
+                                    const char *threadName)    // IN
+{
+   return FoundryThreadsStartThreadInternal(proc, threadParam, threadName,
+                                            VIX_THREAD_DEDICATED);
+}
 
 
 /*
index 9456e2e9fb4e122a3287e888abfaedfe69a8c07f..0c2150bb931a0700d4fff8eba632d8ae40b16116 100644 (file)
@@ -41,9 +41,21 @@ struct FoundryWorkerThread;
 
 typedef void (*FoundryThreadProc)(struct FoundryWorkerThread *threadState);
 
-struct FoundryWorkerThread *FoundryThreads_StartThread(FoundryThreadProc proc,
-                                                       void *threadParam,
-                                                       const char *threadName);
+struct FoundryWorkerThread *
+FoundryThreads_StartThread(FoundryThreadProc proc,
+                           void *threadParam,
+                           const char *threadName);
+
+struct FoundryWorkerThread *
+FoundryThreads_StartIOThread(FoundryThreadProc proc,
+                             void *threadParam,
+                             const char *threadName);
+
+struct FoundryWorkerThread *
+FoundryThreads_StartDedicatedThread(FoundryThreadProc proc,
+                                    void *threadParam,
+                                    const char *threadName);
+
 void FoundryThreads_StopThread(struct FoundryWorkerThread *threadState);
 void FoundryThreads_Free(struct FoundryWorkerThread *threadState);
 Bool FoundryThreads_IsCurrentThread(struct FoundryWorkerThread *threadState);
index 000dd7b08d6c7491a21ac3f4478fd49637d3f065..40229417a610a7992c18731f75e18c90c2dc9405 100644 (file)
@@ -62,6 +62,7 @@ EXTERN Bool Log_Enabled(void);
 EXTERN const char *Log_GetFileName(void);
 
 EXTERN void Log_Flush(void);
+EXTERN void Log_UseLocking(Bool useLocking);
 EXTERN void Log_SetAlwaysKeep(Bool alwaysKeep);
 EXTERN Bool Log_RemoveFile(Bool alwaysRemove);
 EXTERN void Log_DisableThrottling(void);
@@ -77,6 +78,8 @@ EXTERN void Log_UpdateState(Bool enable, Bool append, unsigned keepOld,
 EXTERN Bool Log_SwitchFile(const char *fileName, const char *config, Bool copy);
 EXTERN Bool Log_CopyFile(const char *fileName);
 
+EXTERN size_t Log_MakeTimeString(Bool millisec, char *buf, size_t max);
+
 /* Logging that uses the custom guest throttling configuration. */
 EXTERN void GuestLog_Init(void);
 EXTERN void GuestLog_Log(const char *fmt, ...) PRINTF_DECL(1, 2);
index aa0c844b3e38a618da6b3b583201baffe411cfb7..8743a2a53b90a532ba51a7e303146c29e3903939 100644 (file)
 #define GHI_RPC_TRAY_ICON_SEND_EVENT                  "ghi.guest.trayIcon.sendEvent"
 #define GHI_RPC_SET_FOCUSED_WINDOW                    "ghi.guest.setFocusedWindow"
 #define GHI_RPC_GET_EXEC_INFO_HASH                    "ghi.guest.getExecInfoHash"
+#define GHI_RPC_AUTOLOGON_REQUIREMENTS                "ghi.guest.autologon.requirements"
+#define GHI_RPC_AUTOLOGON_SET                         "ghi.guest.autologon.set"
+#define GHI_RPC_AUTOLOGON_QUERY                       "ghi.guest.autologon.query"
+#define GHI_RPC_AUTOLOGON_CLEAR                       "ghi.guest.autologon.clear"
 /* @} */
 
 
diff --git a/open-vm-tools/lib/include/vixExternalThread.h b/open-vm-tools/lib/include/vixExternalThread.h
new file mode 100644 (file)
index 0000000..13ae79f
--- /dev/null
@@ -0,0 +1,39 @@
+/*********************************************************
+ * Copyright (C) 2010 VMware, Inc. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation version 2.1 and no later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the Lesser GNU General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA.
+ *
+ *********************************************************/
+
+/*
+ * This header defines shared thread interface that need to be included in both
+ * vixSemiPublic.h and foundryThread.c
+ * foundryThread.c cannot include vixSemiPublic.h due to dependency issue
+ */
+
+#ifndef _VIX_EXTERNAL_THREAD_H_
+#define _VIX_EXTERNAL_THREAD_H_
+
+typedef void (*VixThreadFuncType)(void *);
+typedef void (*VixScheduleWorkFuncType)(VixThreadFuncType, void *);
+
+typedef struct IVixThread {
+   VixScheduleWorkFuncType ScheduleWorkFunc;
+   VixScheduleWorkFuncType ScheduleIOFunc;
+   VixScheduleWorkFuncType ScheduleDedicatedFunc;
+} IVixThread;
+
+void Vix_SetExternalThreadInterface(IVixThread *threadInt);
+
+#endif
index 89771fed745a5c0feb8727bd21afc70a00fa7bdf..15cd12385e467efa744245e18b1dba5f40e76d6a 100644 (file)
@@ -666,4 +666,11 @@ typedef int pid_t;
 #define RANK_LEAF                0xFFFE
 #define RANK_INVALID             0xFFFF
 
+/*
+ * Use to initialize cbSize for this structure to preserve < Vista
+ * compatibility.
+ */
+#define NONCLIENTMETRICSINFO_V1_SIZE CCSIZEOF_STRUCT(NONCLIENTMETRICS, \
+                                                     lfMessageFont)
+
 #endif // ifndef _VM_BASIC_DEFS_H_
index 015bc8bad722697d22a5320b2e4e54c0fa4e1cd9..3f288b03c4586b13e5355404259dbff3eeb09296 100644 (file)
  *     the future.
  */
 #define PRODUCT_VMRC_PLUGIN_PREVIOUS_MIMETYPES \
+   "application/x-vmware-vmrc;version=2.5.0.174726" PRODUCT_VMRC_MIMETYPE_SEPARATOR \
+   "application/x-vmware-vmrc;version=2.5.0.158248" PRODUCT_VMRC_MIMETYPE_SEPARATOR \
    "application/x-vmware-vmrc;version=2.5.0.116460" PRODUCT_VMRC_MIMETYPE_SEPARATOR \
    "application/x-vmware-vmrc;version=2.5.0.0"
 
index 26308556e7d141442187ad3f39c9b86db15eaef8..bf4b63ef28541406cba830a4d9bd1325509bd139 100644 (file)
@@ -69,6 +69,7 @@ typedef enum {
    UNITY_CAP_STICKY_WINDOWS             = 22, // supports unity.window.{un,}stick
    CAP_CHANGE_HOST_3D_AVAILABILITY_HINT = 23, // supports sending 3D support hint to guest
    CAP_AUTOUPGRADE_AT_SHUTDOWN          = 24, // supports auto-upgrading tools at OS shutdown
+   GHI_CAP_AUTOLOGON                    = 25, // supports autologon
 } GuestCapabilities;
 
 typedef struct {
@@ -135,6 +136,7 @@ static GuestCapElem guestCapTable[] = {
    { UNITY_CAP_STICKY_WINDOWS,             UNITY_CAP_VMDB_PATH, "sticky"},
    { CAP_CHANGE_HOST_3D_AVAILABILITY_HINT, CAP_VMDB_PATH, "changeHost3DAvailabilityHint" },
    { CAP_AUTOUPGRADE_AT_SHUTDOWN,          CAP_VMDB_PATH,       "autoUpgradeAtShutdown"},
+   { GHI_CAP_AUTOLOGON,                    GHI_CAP_VMDB_PATH,   "autologon" },
 };
 
 #endif // VM_NEED_VMDB_GUEST_CAP_MAPPING