]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Changes in shared code that don't affect open-vm-tools functionality.
authorVMware, Inc <>
Mon, 22 Aug 2011 21:18:04 +0000 (14:18 -0700)
committerMarcelo Vanzin <mvanzin@vmware.com>
Mon, 22 Aug 2011 21:18:04 +0000 (14:18 -0700)
Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/modules/linux/vmci/common/vmciContext.c
open-vm-tools/modules/linux/vmci/common/vmciContext.h

index 3f3242b3b63bddeb9d97ddfa429fa9b000291976..cb390f040fdab9571eda7726d4db1c69ae611d74 100644 (file)
@@ -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);
+}
+
+
 /*
  *----------------------------------------------------------------------
  *
index ef4da72694793bb089fb409b8ef26bce30b89cbb..1258e055b43ca310753d5ea6ff3156647b8f31b6 100644 (file)
@@ -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