]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Fix QPair wakeup on suspend
authorVMware, Inc <>
Thu, 27 Oct 2011 18:19:45 +0000 (11:19 -0700)
committerMarcelo Vanzin <mvanzin@vmware.com>
Thu, 27 Oct 2011 18:19:45 +0000 (11:19 -0700)
On vmkernel, we do not unregister the guest memory, when a VM
is quiesced, so the queue pairs stay in a *_MEM state, if
already there. When detaching from a queue pair, we were only
waking up blocked kernel endpoints, if the queue pair was in
the *_NO_MEM state, since that would indicate that the QP is
quiesced. However, what we need to determine is whether the
queue pair headers are still mapped, since that is the common
operation for hosted and vmkernel on quiesce/unquiesce.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/modules/linux/vmci/common/vmciQueuePair.c
open-vm-tools/modules/linux/vmci/linux/vmci_version.h

index d1163653590ebbcd4e3e0be72fc21101db3195e8..340ccaaaf1c42c2b16d09bb51eee6b15d3bee38e 100644 (file)
@@ -1593,6 +1593,7 @@ VMCIQPBroker_Detach(VMCIHandle  handle,   // IN
 
    if (contextId != VMCI_HOST_CONTEXT_ID) {
       int result;
+      Bool headersMapped;
 
       ASSERT(!isLocal);
 
@@ -1602,8 +1603,9 @@ VMCIQPBroker_Detach(VMCIHandle  handle,   // IN
        * more recent VMX'en may detach from a queue pair in the quiesced state.
        */
 
+      VMCI_AcquireQueueMutex(entry->produceQ);
+      headersMapped = entry->produceQ->qHeader || entry->consumeQ->qHeader;
       if (QPBROKERSTATE_HAS_MEM(entry)) {
-         VMCI_AcquireQueueMutex(entry->produceQ);
          result = VMCIHost_UnmapQueueHeaders(INVALID_VMCI_GUEST_MEM_ID,
                                              entry->produceQ,
                                              entry->consumeQ);
@@ -1617,14 +1619,13 @@ VMCIQPBroker_Detach(VMCIHandle  handle,   // IN
          } else {
             VMCIHost_UnregisterUserMemory(entry->produceQ, entry->consumeQ);
          }
-         VMCI_ReleaseQueueMutex(entry->produceQ);
-      } else {
-         VMCI_AcquireQueueMutex(entry->produceQ);
+      }
+      if (!headersMapped) {
          QueuePairResetSavedHeaders(entry);
-         VMCI_ReleaseQueueMutex(entry->produceQ);
-         if (entry->wakeupCB) {
-            entry->wakeupCB(entry->clientData);
-         }
+      }
+      VMCI_ReleaseQueueMutex(entry->produceQ);
+      if (!headersMapped && entry->wakeupCB) {
+         entry->wakeupCB(entry->clientData);
       }
    } else {
       if (entry->wakeupCB) {
index 1be2010be70b76b7c616001c1da6062d30dfcf0a..d6a5568813a0b868bd73e1f19f1f352c4687f02c 100644 (file)
@@ -25,8 +25,8 @@
 #ifndef _VMCI_VERSION_H_
 #define _VMCI_VERSION_H_
 
-#define VMCI_DRIVER_VERSION          9.3.13.0
-#define VMCI_DRIVER_VERSION_COMMAS   9,3,13,0
-#define VMCI_DRIVER_VERSION_STRING   "9.3.13.0"
+#define VMCI_DRIVER_VERSION          9.3.14.0
+#define VMCI_DRIVER_VERSION_COMMAS   9,3,14,0
+#define VMCI_DRIVER_VERSION_STRING   "9.3.14.0"
 
 #endif /* _VMCI_VERSION_H_ */