From: VMware, Inc <> Date: Mon, 22 Mar 2010 22:16:09 +0000 (-0700) Subject: Add initial host side support for request/confirm/ack unity operation. X-Git-Tag: 2010.03.20-243334~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bbfb543abc1ec825a0a19f688d28210f9a3c75e0;p=thirdparty%2Fopen-vm-tools.git Add initial host side support for request/confirm/ack unity operation. Add RPC names and XDR definitions for requesting, confirming and acknowledging unity operations via the host. A limited number if operation types are defined, we currently only care about 'minimize'. Signed-off-by: Marcelo Vanzin --- diff --git a/open-vm-tools/lib/guestRpc/unity.x b/open-vm-tools/lib/guestRpc/unity.x index 5d35e6302..0e11c8c0a 100644 --- a/open-vm-tools/lib/guestRpc/unity.x +++ b/open-vm-tools/lib/guestRpc/unity.x @@ -66,6 +66,76 @@ case UNITY_OPTIONS_V1: }; +/* + * Unity Request, Confirm and Acknowledge XDR structures. + * + * The guest will request (from the host) that it be allowed to perform certain types + * of window operations - for example minimize, the host will later confirm that the + * guest can (or cannot) go ahead with the operation. Once the guest has performed + * the requested operation it will acknowledge its completion back to the host. + * In many ways this is analagous to the three way handshaking used by TCP. + */ + +/* + * Enumerates the different versions of the messages. Note that all three types of + * messages (request, confirm, acknowledge) share the same version value. They must + * be managed together when updating versions. + */ +enum UnityOperationVersion { + UNITY_OP_V1 = 1 +}; + +enum UnityOperations { + MINIMIZE = 1 +}; + +/* + * The structure used to distinguish the operations of the message. + */ +union UnityOperationDetails switch (UnityOperations op) { +case MINIMIZE: + int dummy; /* Dummy value to avoid empty union */ +}; + +struct UnityRequestOperationV1 { + /* + * sequence should be used to associate a request with a later confirmation so that + * state can be maintained within the guest as to oustanding requests (or to set + * an error for requests that must maintain order and do not reflect the order + * back correctly.). + */ + int sequence; + int windowId; + UnityOperationDetails details; +}; + +struct UnityConfirmOperationV1 { + int sequence; + int windowId; + UnityOperationDetails details; + bool allow; +}; + +/* + * This defines the protocol for a 'unityRequestOperation' message. + * + * The union allows us to introduce new versions of the protocol later by + * creating new values in the enumeration, without having to change much of + * the code calling the (de)serialization functions. + * + * Since the union doesn't have a default case, de-serialization will fail if + * an unknown version is provided on the wire. + */ +union UnityRequestOperation switch (UnityOperationVersion ver) { +case UNITY_OP_V1: + struct UnityRequestOperationV1 *unityRequestOpV1; +}; + +union UnityConfirmOperation switch (UnityOperationVersion ver) { +case UNITY_OP_V1: + struct UnityConfirmOperationV1 *unityConfirmOpV1; +}; + /* * Protocol to send the scraped/grabbed contents of a window to the host. */ diff --git a/open-vm-tools/lib/include/unityCommon.h b/open-vm-tools/lib/include/unityCommon.h index a30848550..a3d4253ff 100644 --- a/open-vm-tools/lib/include/unityCommon.h +++ b/open-vm-tools/lib/include/unityCommon.h @@ -233,6 +233,7 @@ #define UNITY_RPC_SET_OPTIONS "unity.set.options" #define UNITY_RPC_WINDOW_STICK "unity.window.stick" #define UNITY_RPC_WINDOW_UNSTICK "unity.window.unstick" +#define UNITY_RPC_CONFIRM_OPERATION "unity.operation.confirm" #define UNITY_RPC_WINDOW_CONTENTS_REQUEST "unity.window.contents.request" #define GHI_RPC_GUEST_SHELL_ACTION "ghi.guest.shell.action" @@ -270,6 +271,8 @@ #define GHI_RPC_TRASH_FOLDER_STATE "ghi.guest.trashFolder.state" #define GHI_RPC_TRAY_ICON_UPDATE "ghi.guest.trayIcon.update" #define GHI_RPC_HOST_SHELL_ACTION "ghi.host.shell.action" +#define UNITY_RPC_REQUEST_OPERATION "unity.operation.request" +#define UNITY_RPC_ACK_OPERATION "unity.operation.ack" #define UNITY_RPC_WINDOW_CONTENTS_START "unity.window.contents.start" #define UNITY_RPC_WINDOW_CONTENTS_CHUNK "unity.window.contents.chunk" #define UNITY_RPC_WINDOW_CONTENTS_END "unity.window.contents.end" @@ -780,6 +783,13 @@ desktop where the upper right {1,2} is the currently active desktop. @endcode @param[in] UnityWindowId UnityWindowId of window to unstick. + @def UNITY_RPC_CONFIRM_OPERATION + @brief Confirm (or deny) that a previously requested operation should now be performed. + @code + UNITY_RPC_CONFIRM_OPERATION XDR_REP + @endcode + @param[in] XDR_REP XDR Encoded (see unity.x) representation of arguments. + @} */ @@ -848,6 +858,20 @@ desktop where the upper right {1,2} is the currently active desktop. @endcode @param[in] flag If 1, Unity is active. If 0, Unity is not active + @def UNITY_RPC_REQUEST_OPERATION + @brief Request that the host should allow the guest to perform an operation. + @code + UNITY_RPC_REQUEST_OPERATION XDR_REP + @endcode + @param[in] XDR_REP XDR Encoded (see unity.x) representation of arguments. + + @def UNITY_RPC_ACK_OPERATION + @brief Acknowledge that a previously confirmed operations has been performed. + @code + UNITY_RPC_ACK_OPERATION XDR_REP + @endcode + @param[in] XDR_REP XDR Encoded (see unity.x) representation of arguments. + @} */ diff --git a/open-vm-tools/lib/include/vm_version.h b/open-vm-tools/lib/include/vm_version.h index d378d64ac..6e688278b 100644 --- a/open-vm-tools/lib/include/vm_version.h +++ b/open-vm-tools/lib/include/vm_version.h @@ -206,7 +206,7 @@ #define PLAYER_VERSION "e.x.p" #define V2V_VERSION "e.x.p" #define V2V_FILE_VERSION 1,0,0,0 -#define FUSION_VERSION "3.0.2" +#define FUSION_VERSION "e.x.p" // These must match VIE_FILEVERSION above #define SYSIMAGE_VERSION "4.0.0"