From: VMware, Inc <> Date: Tue, 26 Apr 2011 20:21:59 +0000 (-0700) Subject: Internal branch sync. Included in this change: X-Git-Tag: 2011.04.25-402641~77 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=769e75e3ebbfd4e1dd13ac699c7dda7282715293;p=thirdparty%2Fopen-vm-tools.git Internal branch sync. Included in this change: . DnD: don't reset state of active file trasfers, so that DnD works even when snapshots are taken. . changes in shared code that don't affect open-vm-tools functionality. Signed-off-by: Marcelo Vanzin --- diff --git a/open-vm-tools/lib/include/vm_version.h b/open-vm-tools/lib/include/vm_version.h index ca02a3971..a2a89b917 100644 --- a/open-vm-tools/lib/include/vm_version.h +++ b/open-vm-tools/lib/include/vm_version.h @@ -481,6 +481,7 @@ #define PRODUCT_VERSION_SCALABLE_SERVER_30 PRODUCT_SCALABLE_SERVER_BRIEF_NAME " 3.0" #define PRODUCT_VERSION_SCALABLE_SERVER_31 PRODUCT_SCALABLE_SERVER_BRIEF_NAME " 3.5" #define PRODUCT_VERSION_SCALABLE_SERVER_40 PRODUCT_SCALABLE_SERVER_BRIEF_NAME " 4.x" +#define PRODUCT_VERSION_SCALABLE_SERVER_5 PRODUCT_SCALABLE_SERVER_BRIEF_NAME " 5.x" #define PRODUCT_VERSION_WGS_1 PRODUCT_WGS_BRIEF_NAME " 1.x" #define PRODUCT_VERSION_WGS_2 PRODUCT_WGS_BRIEF_NAME " 2.x" #define PRODUCT_VERSION_GSX_2 PRODUCT_GSX_BRIEF_NAME " 2.x" @@ -490,7 +491,7 @@ #define PRODUCT_VERSION_WORKSTATION_6 PRODUCT_WORKSTATION_BRIEF_NAME " 6.0" #define PRODUCT_VERSION_WORKSTATION_65 PRODUCT_WORKSTATION_BRIEF_NAME " 6.5" #define PRODUCT_VERSION_WORKSTATION_7 PRODUCT_WORKSTATION_BRIEF_NAME " 7.x" -#define PRODUCT_VERSION_WORKSTATION_80 PRODUCT_WORKSTATION_BRIEF_NAME " 8.0" +#define PRODUCT_VERSION_WORKSTATION_8 PRODUCT_WORKSTATION_BRIEF_NAME " 8.x" #define PRODUCT_VERSION_WORKSTATION_ENTERPRISE_1 "ACE 1.x" #define PRODUCT_VERSION_WORKSTATION_ENTERPRISE_2 "ACE 2.0" #define PRODUCT_VERSION_WORKSTATION_ENTERPRISE_25 "ACE 2.5" @@ -498,6 +499,7 @@ #define PRODUCT_VERSION_MAC_DESKTOP_1 PRODUCT_MAC_DESKTOP_BRIEF_NAME " 1.1" #define PRODUCT_VERSION_MAC_DESKTOP_2 PRODUCT_MAC_DESKTOP_BRIEF_NAME " 2.x" #define PRODUCT_VERSION_MAC_DESKTOP_3 PRODUCT_MAC_DESKTOP_BRIEF_NAME " 3.x" +#define PRODUCT_VERSION_MAC_DESKTOP_4 PRODUCT_MAC_DESKTOP_BRIEF_NAME " 4.x" /* diff --git a/open-vm-tools/services/plugins/dndcp/copyPasteDnDWrapper.cpp b/open-vm-tools/services/plugins/dndcp/copyPasteDnDWrapper.cpp index d2f81d23c..1cc539075 100644 --- a/open-vm-tools/services/plugins/dndcp/copyPasteDnDWrapper.cpp +++ b/open-vm-tools/services/plugins/dndcp/copyPasteDnDWrapper.cpp @@ -480,6 +480,23 @@ void CopyPasteDnDWrapper::OnResetInternal() { g_debug("%s: enter\n", __FUNCTION__); + + /* + * Reset DnD/Copy/Paste only if vmx said we can. The reason is that + * we may also get reset request from vmx when user is taking snapshot + * or recording. If there is an ongoing DnD/copy/paste, we should not + * reset here. For details please refer to bug 375928. + */ + char *reply = NULL; + size_t replyLen; + ToolsAppCtx *ctx = GetToolsAppCtx(); + if (RpcChannel_Send(ctx->rpc, "dnd.is.active", + strlen("dnd.is.active"), &reply, &replyLen) && + (1 == atoi(reply))) { + g_debug("%s: ignore reset while file transfer is busy.\n", __FUNCTION__); + return; + } + if (IsDnDRegistered()) { UnregisterDnD(); } @@ -490,21 +507,7 @@ CopyPasteDnDWrapper::OnResetInternal() RegisterCP(); } if (IsDnDEnabled() && !IsDnDRegistered()) { - /* - * Reset DnD/Copy/Paste only if vmx said we can. The reason is that - * we may also get reset request from vmx when user is taking snapshot - * or recording. If there is an ongoing DnD/copy/paste, we should not - * reset here. For details please refer to bug 375928. - */ - - char *reply = NULL; - size_t replyLen; - ToolsAppCtx *ctx = GetToolsAppCtx(); - if (!RpcChannel_Send(ctx->rpc, "dnd.is.active", - strlen("dnd.is.active"), &reply, &replyLen) || - (0 == atoi(reply))) { - RegisterDnD(); - } + RegisterDnD(); } if (!IsDnDRegistered() || !IsCPRegistered()) { g_debug("%s: unable to reset fully DnD %d CP %d!\n", diff --git a/open-vm-tools/services/plugins/dndcp/copyPasteUIX11.cpp b/open-vm-tools/services/plugins/dndcp/copyPasteUIX11.cpp index 2226b5519..9279da7e3 100644 --- a/open-vm-tools/services/plugins/dndcp/copyPasteUIX11.cpp +++ b/open-vm-tools/services/plugins/dndcp/copyPasteUIX11.cpp @@ -168,6 +168,14 @@ CopyPasteUIX11::~CopyPasteUIX11() { g_debug("%s: enter\n", __FUNCTION__); CPClipboard_Destroy(&mClipboard); + if (mBlockAdded) { + g_debug("%s: removing block for %s\n", __FUNCTION__, mHGStagingDir.c_str()); + /* We need to make sure block subsystem has not been shut off. */ + if (DnD_BlockIsReady(mBlockCtrl)) { + mBlockCtrl->RemoveBlock(mBlockCtrl->fd, mHGStagingDir.c_str()); + } + mBlockAdded = false; + } } diff --git a/open-vm-tools/services/plugins/dndcp/dndUIX11.cpp b/open-vm-tools/services/plugins/dndcp/dndUIX11.cpp index cfd985ec0..03ca3eaee 100644 --- a/open-vm-tools/services/plugins/dndcp/dndUIX11.cpp +++ b/open-vm-tools/services/plugins/dndcp/dndUIX11.cpp @@ -94,6 +94,7 @@ DnDUIX11::~DnDUIX11() delete m_detWnd; } CPClipboard_Destroy(&m_clipboard); + CommonResetCB(); }