From: VMware, Inc <> Date: Wed, 24 Feb 2010 21:16:58 +0000 (-0800) Subject: Internal branch sync. Included in this change: X-Git-Tag: 2010.02.23-236320~51 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9654fdaccb3afc195137f97a11f2cc56cb8a2f95;p=thirdparty%2Fopen-vm-tools.git Internal branch sync. Included in this change: . 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 --- diff --git a/open-vm-tools/lib/foundryMsg/foundryThreads.c b/open-vm-tools/lib/foundryMsg/foundryThreads.c index 729a4c8fe..43848c5ce 100644 --- a/open-vm-tools/lib/foundryMsg/foundryThreads.c +++ b/open-vm-tools/lib/foundryMsg/foundryThreads.c @@ -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); +} /* diff --git a/open-vm-tools/lib/include/foundryThreads.h b/open-vm-tools/lib/include/foundryThreads.h index 9456e2e9f..0c2150bb9 100644 --- a/open-vm-tools/lib/include/foundryThreads.h +++ b/open-vm-tools/lib/include/foundryThreads.h @@ -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); diff --git a/open-vm-tools/lib/include/log.h b/open-vm-tools/lib/include/log.h index 000dd7b08..40229417a 100644 --- a/open-vm-tools/lib/include/log.h +++ b/open-vm-tools/lib/include/log.h @@ -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); diff --git a/open-vm-tools/lib/include/unityCommon.h b/open-vm-tools/lib/include/unityCommon.h index aa0c844b3..8743a2a53 100644 --- a/open-vm-tools/lib/include/unityCommon.h +++ b/open-vm-tools/lib/include/unityCommon.h @@ -245,6 +245,10 @@ #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 index 000000000..13ae79fd1 --- /dev/null +++ b/open-vm-tools/lib/include/vixExternalThread.h @@ -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 diff --git a/open-vm-tools/lib/include/vm_basic_defs.h b/open-vm-tools/lib/include/vm_basic_defs.h index 89771fed7..15cd12385 100644 --- a/open-vm-tools/lib/include/vm_basic_defs.h +++ b/open-vm-tools/lib/include/vm_basic_defs.h @@ -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_ diff --git a/open-vm-tools/lib/include/vm_product.h b/open-vm-tools/lib/include/vm_product.h index 015bc8bad..3f288b03c 100644 --- a/open-vm-tools/lib/include/vm_product.h +++ b/open-vm-tools/lib/include/vm_product.h @@ -200,6 +200,8 @@ * 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" diff --git a/open-vm-tools/lib/include/vmware/guestrpc/capabilities.h b/open-vm-tools/lib/include/vmware/guestrpc/capabilities.h index 26308556e..bf4b63ef2 100644 --- a/open-vm-tools/lib/include/vmware/guestrpc/capabilities.h +++ b/open-vm-tools/lib/include/vmware/guestrpc/capabilities.h @@ -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