From: VMware, Inc <> Date: Mon, 22 Aug 2011 21:18:04 +0000 (-0700) Subject: Changes in shared code that don't affect open-vm-tools functionality. X-Git-Tag: 2011.08.21-471295~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2b3d76ba776f55d06fb5b62499b189ebd6bc1c75;p=thirdparty%2Fopen-vm-tools.git Changes in shared code that don't affect open-vm-tools functionality. Signed-off-by: Marcelo Vanzin --- diff --git a/open-vm-tools/modules/linux/vmci/common/vmciContext.c b/open-vm-tools/modules/linux/vmci/common/vmciContext.c index 3f3242b3b..cb390f040 100644 --- a/open-vm-tools/modules/linux/vmci/common/vmciContext.c +++ b/open-vm-tools/modules/linux/vmci/common/vmciContext.c @@ -2148,6 +2148,50 @@ VMCIContext_SignalPendingDoorbells(VMCIId contextID) } +/* + *---------------------------------------------------------------------- + * + * VMCIContext_SignalPendingDatagrams -- + * + * Signals the guest if any datagrams are pending. This is used + * after the VMCI device is unquiesced to ensure that no pending + * datagrams go unnoticed, since signals may not be fully + * processed while the device is quiesced. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +void +VMCIContext_SignalPendingDatagrams(VMCIId contextID) +{ + Bool pending; + VMCIContext *context; + VMCILockFlags flags; + + context = VMCIContext_Get(contextID); + if (!context) { + ASSERT(FALSE); + return; + } + + VMCI_GrabLock(&context->lock, &flags); + pending = context->pendingDatagrams; + VMCI_ReleaseLock(&context->lock, flags); + + if (pending) { + VMCIHost_SignalCall(&context->hostContext); + } + + VMCIContext_Release(context); +} + + /* *---------------------------------------------------------------------- * diff --git a/open-vm-tools/modules/linux/vmci/common/vmciContext.h b/open-vm-tools/modules/linux/vmci/common/vmciContext.h index ef4da7269..1258e055b 100644 --- a/open-vm-tools/modules/linux/vmci/common/vmciContext.h +++ b/open-vm-tools/modules/linux/vmci/common/vmciContext.h @@ -114,6 +114,7 @@ void VMCIContext_ReceiveNotificationsRelease(VMCIId contextID, Bool success); #if defined(VMKERNEL) void VMCIContext_SignalPendingDoorbells(VMCIId contextID); +void VMCIContext_SignalPendingDatagrams(VMCIId contextID); int VMCIContextID2HostVmID(VMCIId contextID, void *hostVmID, size_t hostVmIDLen); #endif