]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Retire VMCI wellknown handles.
authorVMware, Inc <>
Mon, 26 Sep 2011 18:50:08 +0000 (11:50 -0700)
committerMarcelo Vanzin <mvanzin@vmware.com>
Mon, 26 Sep 2011 18:50:08 +0000 (11:50 -0700)
With VM to VM communication being retired, the wellknown
handles no longer serve any purpose. This change removes the
remaining support for them.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/lib/include/vmci_defs.h
open-vm-tools/modules/linux/shared/vmci_call_defs.h
open-vm-tools/modules/linux/shared/vmci_defs.h
open-vm-tools/modules/linux/vmci/common/vmciCommonInt.h
open-vm-tools/modules/linux/vmci/common/vmciContext.c
open-vm-tools/modules/linux/vmci/common/vmciContext.h
open-vm-tools/modules/linux/vmci/common/vmciDatagram.c
open-vm-tools/modules/linux/vmci/common/vmciDatagram.h
open-vm-tools/modules/linux/vmci/common/vmciRoute.c
open-vm-tools/modules/linux/vmci/linux/driver.c
open-vm-tools/modules/linux/vmci/linux/vmci_version.h

index 5a9c966b04d1624bfc88f107bc4c51c1c2f82caf..d400617326375c4ae85dbd10a065a4a5cd5364b1 100644 (file)
@@ -112,6 +112,10 @@ typedef uint32 VMCI_Resource;
 #define VMCI_DOORBELL_LINK        3
 #define VMCI_DOORBELL_UNLINK      4
 #define VMCI_DOORBELL_NOTIFY      5
+/*
+ * VMCI_DATAGRAM_REQUEST_MAP and VMCI_DATAGRAM_REMOVE_MAP are
+ * obsoleted by the removal of VM to VM communication.
+ */
 #define VMCI_DATAGRAM_REQUEST_MAP 6
 #define VMCI_DATAGRAM_REMOVE_MAP  7
 #define VMCI_EVENT_SUBSCRIBE      8
@@ -228,12 +232,14 @@ static const VMCIHandle VMCI_INVALID_HANDLE = {VMCI_INVALID_ID,
 #define VMCI_HYPERVISOR_CONTEXT_ID 0
 
 /*
- * Well-known context id, a logical context that contains
- * a set of well-known services.
+ * Well-known context id, a logical context that contains a set of
+ * well-known services. This context ID is now obsolete.
  */
 #define VMCI_WELL_KNOWN_CONTEXT_ID 1
 
-/* Todo: Change host context id to dynamic/random id. */
+/*
+ * Context ID used by host endpoints.
+ */
 #define VMCI_HOST_CONTEXT_ID  2
 
 /*
index b3d70a08b060aab9ad5b4ab7400a624d3d7e3347..5e5480777dae71046e57824307b04c1e7e43aaab 100644 (file)
@@ -98,9 +98,10 @@ typedef struct VMCIDatagram {
     1024 * (sizeof(VMCIDatagram) + sizeof(VMCIEventData_Max)))
 
 /*
- * Struct for sending VMCI_DATAGRAM_REQUEST_MAP and VMCI_DATAGRAM_REMOVE_MAP
- * datagrams. Struct size is 32 bytes. All fields in struct are aligned to
- * their natural alignment.
+ * Struct for sending VMCI_DATAGRAM_REQUEST_MAP and
+ * VMCI_DATAGRAM_REMOVE_MAP datagrams. Struct size is 32 bytes. All
+ * fields in struct are aligned to their natural alignment. These
+ * datagrams are obsoleted by the removal of VM to VM communication.
  */
 typedef struct VMCIDatagramWellKnownMapMsg {
    VMCIDatagram hdr;
index 68b2273a54ad2f7866c5accd68c01efb49bf0114..da31ed137ebe69dcc143aa4cf2a51ce84807dde7 100644 (file)
@@ -112,6 +112,10 @@ typedef uint32 VMCI_Resource;
 #define VMCI_DOORBELL_LINK        3
 #define VMCI_DOORBELL_UNLINK      4
 #define VMCI_DOORBELL_NOTIFY      5
+/*
+ * VMCI_DATAGRAM_REQUEST_MAP and VMCI_DATAGRAM_REMOVE_MAP are
+ * obsoleted by the removal of VM to VM communication.
+ */
 #define VMCI_DATAGRAM_REQUEST_MAP 6
 #define VMCI_DATAGRAM_REMOVE_MAP  7
 #define VMCI_EVENT_SUBSCRIBE      8
@@ -228,12 +232,14 @@ static const VMCIHandle VMCI_INVALID_HANDLE = {VMCI_INVALID_ID,
 #define VMCI_HYPERVISOR_CONTEXT_ID 0
 
 /*
- * Well-known context id, a logical context that contains
- * a set of well-known services.
+ * Well-known context id, a logical context that contains a set of
+ * well-known services. This context ID is now obsolete.
  */
 #define VMCI_WELL_KNOWN_CONTEXT_ID 1
 
-/* Todo: Change host context id to dynamic/random id. */
+/*
+ * Context ID used by host endpoints.
+ */
 #define VMCI_HOST_CONTEXT_ID  2
 
 /*
index b8cd0c8218b18046cfd415ed1039ee21630709da..2547569efa3c822a6cff9d6f209cbe1643e1f12a 100644 (file)
@@ -67,7 +67,6 @@ struct VMCIContext {
                                          * this context; e.g., VMX.
                                          */
    VMCILock           lock;             /* Locks callQueue and handleArrays. */
-   VMCIHandleArray    *wellKnownArray;  /* WellKnown mappings owned by context. */
    VMCIHandleArray    *queuePairArray;  /*
                                          * QueuePairs attached to.  The array of
                                          * handles for queue pairs is accessed
index c89e462bfee38c2bff5012e210bf4d9aa6f68d45..0113e373297e8c9951a61f0d6910db6d577869f2 100644 (file)
@@ -319,12 +319,6 @@ VMCIContext_InitContext(VMCIId cid,                   // IN
 
    context->userVersion = userVersion;
 
-   context->wellKnownArray = VMCIHandleArray_Create(0);
-   if (context->wellKnownArray == NULL) {
-      result = VMCI_ERROR_NO_MEM;
-      goto error;
-   }
-
    context->queuePairArray = VMCIHandleArray_Create(0);
    if (!context->queuePairArray) {
       result = VMCI_ERROR_NO_MEM;
@@ -413,9 +407,6 @@ error:
    if (context->notifierArray) {
       VMCIHandleArray_Destroy(context->notifierArray);
    }
-   if (context->wellKnownArray) {
-      VMCIHandleArray_Destroy(context->wellKnownArray);
-   }
    if (context->queuePairArray) {
       VMCIHandleArray_Destroy(context->queuePairArray);
    }
@@ -494,18 +485,6 @@ VMCIContextFreeContext(VMCIContext *context)  // IN
    VMCIContextFireNotification(context->cid, context->privFlags,
                                VMCIContextGetDomainName(context));
 
-   /*
-    * Cleanup all wellknown mappings owned by context. Ideally these would
-    * be removed already but we maintain this list to make sure no resources
-    * are leaked. It is updated by the VMCIDatagramAdd/RemoveWellKnownMap.
-    */
-   ASSERT(context->wellKnownArray);
-   tempHandle = VMCIHandleArray_RemoveTail(context->wellKnownArray);
-   while (!VMCI_HANDLE_EQUAL(tempHandle, VMCI_INVALID_HANDLE)) {
-      VMCIDatagramRemoveWellKnownMap(tempHandle.resource, context->cid);
-      tempHandle = VMCIHandleArray_RemoveTail(context->wellKnownArray);
-   }
-
    /*
     * Cleanup all queue pair resources attached to context.  If the VM dies
     * without cleaning up, this code will make sure that no resources are
@@ -541,7 +520,6 @@ VMCIContextFreeContext(VMCIContext *context)  // IN
    }
 
    VMCIHandleArray_Destroy(context->notifierArray);
-   VMCIHandleArray_Destroy(context->wellKnownArray);
    VMCIHandleArray_Destroy(context->queuePairArray);
    VMCIHandleArray_Destroy(context->doorbellArray);
    VMCIHandleArray_Destroy(context->pendingDoorbellArray);
@@ -1316,81 +1294,6 @@ VMCIContext_GetPrivFlags(VMCIId contextID)  // IN
 }
 
 
-/*
- *----------------------------------------------------------------------
- *
- * VMCIContext_AddWellKnown --
- *
- *      Wrapper to call VMCIHandleArray_AppendEntry().
- *
- * Results:
- *      VMCI_SUCCESS on success, error code otherwise.
- *
- * Side effects:
- *      As in VMCIHandleArray_AppendEntry().
- *
- *----------------------------------------------------------------------
- */
-
-int
-VMCIContext_AddWellKnown(VMCIId contextID,    // IN:
-                         VMCIId wellKnownID)  // IN:
-{
-   VMCILockFlags flags;
-   VMCIHandle wkHandle;
-   VMCIContext *context = VMCIContext_Get(contextID);
-   if (context == NULL) {
-      return VMCI_ERROR_NOT_FOUND;
-   }
-   wkHandle = VMCI_MAKE_HANDLE(VMCI_WELL_KNOWN_CONTEXT_ID, wellKnownID);
-   VMCI_GrabLock(&context->lock, &flags);
-   VMCIHandleArray_AppendEntry(&context->wellKnownArray, wkHandle);
-   VMCI_ReleaseLock(&context->lock, flags);
-   VMCIContext_Release(context);
-
-   return VMCI_SUCCESS;
-}
-
-
-/*
- *----------------------------------------------------------------------
- *
- * VMCIContext_RemoveWellKnown --
- *
- *      Wrapper to call VMCIHandleArray_RemoveEntry().
- *
- * Results:
- *      VMCI_SUCCESS if removed, error code otherwise.
- *
- * Side effects:
- *      As in VMCIHandleArray_RemoveEntry().
- *
- *----------------------------------------------------------------------
- */
-
-int
-VMCIContext_RemoveWellKnown(VMCIId contextID,    // IN:
-                            VMCIId wellKnownID)  // IN:
-{
-   VMCILockFlags flags;
-   VMCIHandle wkHandle, tmpHandle;
-   VMCIContext *context = VMCIContext_Get(contextID);
-   if (context == NULL) {
-      return VMCI_ERROR_NOT_FOUND;
-   }
-   wkHandle = VMCI_MAKE_HANDLE(VMCI_WELL_KNOWN_CONTEXT_ID, wellKnownID);
-   VMCI_GrabLock(&context->lock, &flags);
-   tmpHandle = VMCIHandleArray_RemoveEntry(context->wellKnownArray, wkHandle);
-   VMCI_ReleaseLock(&context->lock, flags);
-   VMCIContext_Release(context);
-
-   if (VMCI_HANDLE_EQUAL(tmpHandle, VMCI_INVALID_HANDLE)) {
-      return VMCI_ERROR_NOT_FOUND;
-   }
-   return VMCI_SUCCESS;
-}
-
-
 /*
  *----------------------------------------------------------------------
  *
@@ -1629,9 +1532,15 @@ VMCIContext_GetCheckpointState(VMCIId contextID,    // IN:
       array = context->notifierArray;
       getContextID = TRUE;
    } else if (cptType == VMCI_WELLKNOWN_CPT_STATE) {
-      ASSERT(context->wellKnownArray);
-      array = context->wellKnownArray;
-      getContextID = FALSE;
+      /*
+       * For compatibility with VMX'en with VM to VM communication, we
+       * always return zero wellknown handles.
+       */
+
+      *bufSize = 0;
+      *cptBufPtr = NULL;
+      result = VMCI_SUCCESS;
+      goto release;
    } else if (cptType == VMCI_DOORBELL_CPT_STATE) {
       ASSERT(context->doorbellArray);
       array = context->doorbellArray;
@@ -1715,19 +1624,27 @@ VMCIContext_SetCheckpointState(VMCIId contextID, // IN:
    uint32 numIDs = bufSize / sizeof(VMCIId);
    ASSERT(cptBuf);
 
-   if (cptType != VMCI_NOTIFICATION_CPT_STATE &&
-       cptType != VMCI_WELLKNOWN_CPT_STATE) {
+   if (cptType == VMCI_WELLKNOWN_CPT_STATE && numIDs > 0) {
+      /*
+       * We would end up here if VMX with VM to VM communication
+       * attempts to restore a checkpoint with wellknown handles.
+       */
+
+      VMCI_WARNING((LGPFX"Attempt to restore checkpoint with obsolete "
+                    "wellknown handles.\n"));
+      return VMCI_ERROR_OBSOLETE;
+   }
+
+   if (cptType != VMCI_NOTIFICATION_CPT_STATE) {
       VMCI_DEBUG_LOG(4, (LGPFX"Invalid cpt state (type=%d).\n", cptType));
       return VMCI_ERROR_INVALID_ARGS;
    }
 
    for (i = 0; i < numIDs && result == VMCI_SUCCESS; i++) {
       currentID = ((VMCIId *)cptBuf)[i];
-      if (cptType == VMCI_NOTIFICATION_CPT_STATE) {
-         result = VMCIContext_AddNotification(contextID, currentID);
-      } else if (cptType == VMCI_WELLKNOWN_CPT_STATE) {
-         result = VMCIDatagramRequestWellKnownMap(currentID, contextID,
-                                                  VMCIContext_GetPrivFlags(contextID));
+      result = VMCIContext_AddNotification(contextID, currentID);
+      if (result != VMCI_SUCCESS) {
+         break;
       }
    }
    if (result != VMCI_SUCCESS) {
index 6cc781092cf365640b89987cb6ccd5e093a4e60c..12a490b173fe2522614c1b2ad4fe0098a50a20ab 100644 (file)
@@ -83,8 +83,6 @@ int VMCIContext_AddGroupEntry(VMCIContext *context,
                               VMCIHandle entryHandle);
 VMCIHandle VMCIContext_RemoveGroupEntry(VMCIContext *context,
                                         VMCIHandle entryHandle);
-int VMCIContext_AddWellKnown(VMCIId contextID, VMCIId wellKnownID);
-int VMCIContext_RemoveWellKnown(VMCIId contextID, VMCIId wellKnownID);
 int VMCIContext_AddNotification(VMCIId contextID, VMCIId remoteCID);
 int VMCIContext_RemoveNotification(VMCIId contextID, VMCIId remoteCID);
 int VMCIContext_GetCheckpointState(VMCIId contextID, uint32 cptType,
index d788bd80492a494eac88f51e38b73a5420a50059..2a0e837e90494ddc55d07f1011c1eef50a5bbf88 100644 (file)
@@ -58,12 +58,6 @@ typedef struct DatagramEntry {
    VMCIPrivilegeFlags  privFlags;
 } DatagramEntry;
 
-/* Mapping between wellknown resource and context. */
-typedef struct DatagramWKMapping {
-   VMCIHashEntry entry;
-   VMCIId        contextID;
-} DatagramWKMapping;
-
 typedef struct VMCIDelayedDatagramInfo {
    Bool inDGHostQueue;
    DatagramEntry *entry;
@@ -71,9 +65,6 @@ typedef struct VMCIDelayedDatagramInfo {
 } VMCIDelayedDatagramInfo;
 
 
-/* Wellknown mapping hashtable. */
-static VMCIHashTable *wellKnownTable = NULL;
-
 static Atomic_uint32 delayedDGHostQueueSize;
 
 static int VMCIDatagramGetPrivFlagsInt(VMCIId contextID, VMCIHandle handle,
@@ -81,9 +72,6 @@ static int VMCIDatagramGetPrivFlagsInt(VMCIId contextID, VMCIHandle handle,
 static void DatagramFreeCB(void *resource);
 static int DatagramReleaseCB(void *clientData);
 
-static DatagramWKMapping *DatagramGetWellKnownMap(VMCIId wellKnownID);
-static void DatagramReleaseWellKnownMap(DatagramWKMapping *wkMap);
-
 
 /*------------------------------ Helper functions ----------------------------*/
 
@@ -254,12 +242,6 @@ DatagramCreateHnd(VMCIId resourceID,            // IN:
 int
 VMCIDatagram_Init(void)
 {
-   /* Create hash table for wellknown mappings. */
-   wellKnownTable = VMCIHashTable_Create(32);
-   if (wellKnownTable == NULL) {
-      return VMCI_ERROR_NO_RESOURCES;
-   }
-
    Atomic_Write(&delayedDGHostQueueSize, 0);
    return VMCI_SUCCESS;
 }
@@ -284,10 +266,6 @@ VMCIDatagram_Init(void)
 void
 VMCIDatagram_Exit(void)
 {
-   if (wellKnownTable != NULL) {
-      VMCIHashTable_Destroy(wellKnownTable);
-      wellKnownTable = NULL;
-   }
 }
 
 
@@ -416,10 +394,6 @@ VMCIDatagram_DestroyHnd(VMCIHandle handle)       // IN
     */
    VMCI_WaitOnEvent(&entry->destroyEvent, DatagramReleaseCB, entry);
 
-   if ((entry->flags & VMCI_FLAG_WELLKNOWN_DG_HND) != 0) {
-      VMCIDatagramRemoveWellKnownMap(handle.resource, VMCI_HOST_CONTEXT_ID);
-   }
-
    /*
     * We know that we are now the only reference to the above entry so
      * can safely free it.
@@ -570,7 +544,6 @@ VMCIDatagramDispatchAsHost(VMCIId contextID,  // IN:
 {
    int retval;
    size_t dgSize;
-   VMCIId dstContext;
    VMCIPrivilegeFlags srcPrivFlags;
    char srcDomain[VMCI_DOMAIN_NAME_MAXLEN]; /* Not used on hosted. */
    char dstDomain[VMCI_DOMAIN_NAME_MAXLEN]; /* Not used on hosted. */
@@ -597,45 +570,10 @@ VMCIDatagramDispatchAsHost(VMCIId contextID,  // IN:
     * Check that source handle matches sending context.
     */
    if (dg->src.context != contextID) {
-      if (dg->src.context == VMCI_WELL_KNOWN_CONTEXT_ID) {
-         /* Determine mapping. */
-         DatagramWKMapping *wkMap = DatagramGetWellKnownMap(dg->src.resource);
-         if (wkMap == NULL) {
-            VMCI_DEBUG_LOG(4, (LGPFX"Sending from invalid well-known resource "
-                               "(handle=0x%x:0x%x).\n",
-                               dg->src.context, dg->src.resource));
-            return VMCI_ERROR_INVALID_RESOURCE;
-         }
-         if (wkMap->contextID != contextID) {
-            VMCI_DEBUG_LOG(4, (LGPFX"Sender context (ID=0x%x) is not owner of "
-                               "well-known src datagram entry "
-                               "(handle=0x%x:0x%x).\n",
-                               contextID, dg->src.context, dg->src.resource));
-            DatagramReleaseWellKnownMap(wkMap);
-            return VMCI_ERROR_NO_ACCESS;
-         }
-         DatagramReleaseWellKnownMap(wkMap);
-      } else {
-         VMCI_DEBUG_LOG(4, (LGPFX"Sender context (ID=0x%x) is not owner of src "
-                            "datagram entry (handle=0x%x:0x%x).\n",
-                            contextID, dg->src.context, dg->src.resource));
-         return VMCI_ERROR_NO_ACCESS;
-      }
-   }
-
-   if (dg->dst.context == VMCI_WELL_KNOWN_CONTEXT_ID) {
-      /* Determine mapping. */
-      DatagramWKMapping *wkMap = DatagramGetWellKnownMap(dg->dst.resource);
-      if (wkMap == NULL) {
-         VMCI_DEBUG_LOG(4, (LGPFX"Sending to invalid wellknown destination "
-                            "(handle=0x%x:0x%x).\n",
-                            dg->dst.context, dg->dst.resource));
-         return VMCI_ERROR_DST_UNREACHABLE;
-      }
-      dstContext = wkMap->contextID;
-      DatagramReleaseWellKnownMap(wkMap);
-   } else {
-      dstContext = dg->dst.context;
+      VMCI_DEBUG_LOG(4, (LGPFX"Sender context (ID=0x%x) is not owner of src "
+                         "datagram entry (handle=0x%x:0x%x).\n",
+                         contextID, dg->src.context, dg->src.resource));
+      return VMCI_ERROR_NO_ACCESS;
    }
 
    /*
@@ -668,7 +606,7 @@ VMCIDatagramDispatchAsHost(VMCIId contextID,  // IN:
 #endif
 
    /* Determine if we should route to host or guest destination. */
-   if (dstContext == VMCI_HOST_CONTEXT_ID) {
+   if (dg->dst.context == VMCI_HOST_CONTEXT_ID) {
       /* Route to host datagram entry. */
       DatagramEntry *dstEntry;
       VMCIResource *resource;
@@ -755,16 +693,17 @@ VMCIDatagramDispatchAsHost(VMCIId contextID,  // IN:
       VMCIDatagram *newDG;
 
 #ifdef VMKERNEL
-      retval = VMCIContext_GetDomainName(dstContext, dstDomain,
+      retval = VMCIContext_GetDomainName(dg->dst.context, dstDomain,
                                          sizeof dstDomain);
       if (retval < VMCI_SUCCESS) {
          VMCI_DEBUG_LOG(4, (LGPFX"Failed to get domain name for context "
-                            "(ID=0x%x).\n", dstContext));
+                            "(ID=0x%x).\n", dg->dst.context));
          return retval;
       }
 #endif
-      if (contextID != dstContext &&
-         VMCIDenyInteraction(srcPrivFlags, VMCIContext_GetPrivFlags(dstContext),
+      if (contextID != dg->dst.context &&
+         VMCIDenyInteraction(srcPrivFlags,
+                             VMCIContext_GetPrivFlags(dg->dst.context),
                              srcDomain, dstDomain)) {
          return VMCI_ERROR_NO_ACCESS;
       }
@@ -775,7 +714,7 @@ VMCIDatagramDispatchAsHost(VMCIId contextID,  // IN:
          return VMCI_ERROR_NO_MEM;
       }
       memcpy(newDG, dg, dgSize);
-      retval = VMCIContext_EnqueueDatagram(dstContext, newDG);
+      retval = VMCIContext_EnqueueDatagram(dg->dst.context, newDG);
       if (retval < VMCI_SUCCESS) {
          VMCI_FreeKernelMem(newDG, dgSize);
          return retval;
@@ -995,158 +934,6 @@ VMCIDatagram_Send(VMCIDatagram *msg) // IN
 }
 
 
-/*
- *------------------------------------------------------------------------------
- *
- * DatagramGetWellKnownMap --
- *
- *      Gets a mapping between handle and wellknown resource.
- *
- * Results:
- *      DatagramWKMapping * if found, NULL if not.
- *
- * Side effects:
- *      None.
- *
- *------------------------------------------------------------------------------
- */
-
-static DatagramWKMapping *
-DatagramGetWellKnownMap(VMCIId wellKnownID)  // IN:
-{
-   VMCIHashEntry *entry;
-   DatagramWKMapping *wkMap = NULL;
-   VMCIHandle wkHandle = VMCI_MAKE_HANDLE(VMCI_WELL_KNOWN_CONTEXT_ID,
-                                          wellKnownID);
-   entry = VMCIHashTable_GetEntry(wellKnownTable, wkHandle);
-   if (entry != NULL) {
-      wkMap = RESOURCE_CONTAINER(entry, DatagramWKMapping, entry);
-   }
-   return wkMap;
-}
-
-
-/*
- *------------------------------------------------------------------------------
- *
- * DatagramReleaseWellKnownMap --
- *
- *      Releases a wellknown mapping.
- *
- * Results:
- *      None.
- *
- * Side effects:
- *      None.
- *
- *------------------------------------------------------------------------------
- */
-
-static void
-DatagramReleaseWellKnownMap(DatagramWKMapping *wkMap)  // IN:
-{
-   if (VMCIHashTable_ReleaseEntry(wellKnownTable, &wkMap->entry) ==
-       VMCI_SUCCESS_ENTRY_DEAD) {
-      VMCI_FreeKernelMem(wkMap, sizeof *wkMap);
-   }
-}
-
-
-/*
- *------------------------------------------------------------------------------
- *
- * VMCIDatagramRequestWellKnownMap --
- *
- *      Creates a mapping between handle and wellknown resource. If resource
- *      is already used we fail the request.
- *
- * Results:
- *      VMCI_SUCCESS if created, negative errno value otherwise.
- *
- * Side effects:
- *      None.
- *
- *------------------------------------------------------------------------------
- */
-
-int
-VMCIDatagramRequestWellKnownMap(VMCIId wellKnownID,           // IN:
-                                VMCIId contextID,             // IN:
-                                VMCIPrivilegeFlags privFlags) // IN:
-{
-   int result;
-   DatagramWKMapping *wkMap;
-   VMCIHandle wkHandle = VMCI_MAKE_HANDLE(VMCI_WELL_KNOWN_CONTEXT_ID,
-                                          wellKnownID);
-
-   if (privFlags & VMCI_PRIVILEGE_FLAG_RESTRICTED ||
-       !VMCIWellKnownID_AllowMap(wellKnownID, privFlags)) {
-      return VMCI_ERROR_NO_ACCESS;
-   }
-
-   wkMap = VMCI_AllocKernelMem(sizeof *wkMap, VMCI_MEMORY_NONPAGED);
-   if (wkMap == NULL) {
-      return VMCI_ERROR_NO_MEM;
-   }
-
-   VMCIHashTable_InitEntry(&wkMap->entry, wkHandle);
-   wkMap->contextID = contextID;
-
-   /* Fails if wkHandle (wellKnownID) already exists. */
-   result = VMCIHashTable_AddEntry(wellKnownTable, &wkMap->entry);
-   if (result != VMCI_SUCCESS) {
-      VMCI_FreeKernelMem(wkMap, sizeof *wkMap);
-      return result;
-   }
-   result = VMCIContext_AddWellKnown(contextID, wellKnownID);
-   if (UNLIKELY(result < VMCI_SUCCESS)) {
-      VMCIHashTable_RemoveEntry(wellKnownTable, &wkMap->entry);
-      VMCI_FreeKernelMem(wkMap, sizeof *wkMap);
-   }
-   return result;
-}
-
-
-/*
- *------------------------------------------------------------------------------
- *
- * VMCIDatagramRemoveWellKnownMap --
- *
- *      Removes a mapping between handle and wellknown resource. Checks if
- *      mapping belongs to calling context.
- *
- * Results:
- *      VMCI_SUCCESS if removed, negative errno value otherwise.
- *
- * Side effects:
- *      None.
- *
- *------------------------------------------------------------------------------
- */
-
-int
-VMCIDatagramRemoveWellKnownMap(VMCIId wellKnownID,  // IN:
-                               VMCIId contextID)    // IN:
-{
-   int result = VMCI_ERROR_NO_ACCESS;
-   DatagramWKMapping *wkMap = DatagramGetWellKnownMap(wellKnownID);
-   if (wkMap == NULL) {
-      VMCI_DEBUG_LOG(4, (LGPFX"Failed to remove well-known mapping between "
-                         "resource (ID=0x%x) and context (ID=0x%x).\n",
-                         wellKnownID, contextID));
-      return VMCI_ERROR_NOT_FOUND;
-   }
-
-   if (contextID == wkMap->contextID) {
-      VMCIHashTable_RemoveEntry(wellKnownTable, &wkMap->entry);
-      VMCIContext_RemoveWellKnown(contextID, wellKnownID);
-      result = VMCI_SUCCESS;
-   }
-   DatagramReleaseWellKnownMap(wkMap);
-   return result;
-}
-
-
 /*
  *-----------------------------------------------------------------------------
  *
index 48436145e9085981d4ea547dd6e37905084521b8..ad7ff457f22987e4f2b52e27a093a436c3c538ef 100644 (file)
@@ -52,11 +52,6 @@ int VMCIDatagram_GetPrivFlags(VMCIHandle handle, VMCIPrivilegeFlags *privFlags);
 void VMCIDatagram_Sync(void);
 Bool VMCIDatagram_CheckHostCapabilities(void);
 
-/* Non public datagram API. */
-int VMCIDatagramRequestWellKnownMap(VMCIId wellKnownID, VMCIId contextID,
-                                    VMCIPrivilegeFlags privFlags);
-int VMCIDatagramRemoveWellKnownMap(VMCIId wellKnownID, VMCIId contextID);
-
 #endif // _VMCI_DATAGRAM_H_
 
 
index 7a9da8e2c5b330e31321399a7c431205f89b4be1..d718a1cbc9261d62f653049cb6a0f7c6bf0e5cb4 100644 (file)
@@ -93,19 +93,6 @@ VMCI_Route(VMCIHandle *src,       // IN/OUT
       return VMCI_ERROR_INVALID_ARGS;
    }
 
-   /*
-    * If we are acting as a host and the datagram is from or for a well-known
-    * context (which also means it must have been passed down from a guest),
-    * then we can assume it is intended for a guest on this host.
-    */
-
-   if (fromGuest && hasHostDevice &&
-       (VMCI_WELL_KNOWN_CONTEXT_ID == src->context ||
-        VMCI_WELL_KNOWN_CONTEXT_ID == dst->context)) {
-      *route = VMCI_ROUTE_AS_HOST;
-      return VMCI_SUCCESS;
-   }
-
    /* Anywhere to hypervisor. */
    if (VMCI_HYPERVISOR_CONTEXT_ID == dst->context) {
       /*
index 9be8233339504d01c306d160e80e8c1b54853341..cc49bf134375a63c808f281880b647969a6bd788 100644 (file)
@@ -1104,63 +1104,6 @@ LinuxDriver_Ioctl(struct inode *inode,
       break;
    }
 
-   case IOCTL_VMCI_DATAGRAM_REQUEST_MAP: {
-      VMCIDatagramMapInfo mapInfo;
-      VMCIDatagramMapInfo *info = (VMCIDatagramMapInfo *)ioarg;
-      int32 result;
-      VMCIId cid;
-
-      if (vmciLinux->ctType != VMCIOBJ_CONTEXT) {
-         Log(LGPFX"IOCTL_VMCI_REQUEST_MAP only valid for contexts.\n");
-         retval = -EINVAL;
-         break;
-      }
-
-      retval = copy_from_user(&mapInfo, (void *)ioarg, sizeof mapInfo);
-      if (retval) {
-         retval = -EFAULT;
-         break;
-      }
-
-      cid = VMCIContext_GetId(vmciLinux->context);
-      result = VMCIDatagramRequestWellKnownMap(mapInfo.wellKnownID, cid,
-                                               VMCIContext_GetPrivFlags(cid));
-      retval = copy_to_user(&info->result, &result, sizeof result);
-      if (retval) {
-         retval = -EFAULT;
-         break;
-      }
-      break;
-   }
-
-   case IOCTL_VMCI_DATAGRAM_REMOVE_MAP: {
-      VMCIDatagramMapInfo mapInfo;
-      VMCIDatagramMapInfo *info = (VMCIDatagramMapInfo *)ioarg;
-      int32 result;
-      VMCIId cid;
-
-      if (vmciLinux->ctType != VMCIOBJ_CONTEXT) {
-         Log(LGPFX"IOCTL_VMCI_REMOVE_MAP only valid for contexts.\n");
-         retval = -EINVAL;
-         break;
-      }
-
-      retval = copy_from_user(&mapInfo, (void *)ioarg, sizeof mapInfo);
-      if (retval) {
-         retval = -EFAULT;
-         break;
-      }
-
-      cid = VMCIContext_GetId(vmciLinux->context);
-      result = VMCIDatagramRemoveWellKnownMap(mapInfo.wellKnownID, cid);
-      retval = copy_to_user(&info->result, &result, sizeof result);
-      if (retval) {
-         retval = -EFAULT;
-         break;
-      }
-      break;
-   }
-
    case IOCTL_VMCI_CTX_ADD_NOTIFICATION: {
       VMCINotifyAddRemoveInfo arInfo;
       VMCINotifyAddRemoveInfo *info = (VMCINotifyAddRemoveInfo *)ioarg;
index bda4ae566c94b630c703d5764f34172b867fe68f..af138355ba1dd7437d6de6e2aad018ec11eaf3e8 100644 (file)
@@ -25,8 +25,8 @@
 #ifndef _VMCI_VERSION_H_
 #define _VMCI_VERSION_H_
 
-#define VMCI_DRIVER_VERSION          9.3.5.0
-#define VMCI_DRIVER_VERSION_COMMAS   9,3,5,0
-#define VMCI_DRIVER_VERSION_STRING   "9.3.5.0"
+#define VMCI_DRIVER_VERSION          9.3.6.0
+#define VMCI_DRIVER_VERSION_COMMAS   9,3,6,0
+#define VMCI_DRIVER_VERSION_STRING   "9.3.6.0"
 
 #endif /* _VMCI_VERSION_H_ */