]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Make VMCI doorbell notification return VMCI_ERROR_NOT_FOUND
authorVMware, Inc <>
Mon, 26 Sep 2011 19:52:38 +0000 (12:52 -0700)
committerMarcelo Vanzin <mvanzin@vmware.com>
Mon, 26 Sep 2011 19:52:38 +0000 (12:52 -0700)
If a doorbell handle isn't found, we currently return
VMCI_ERROR_INVALID_ARGS. A more informative error code would
be VMCI_ERROR_NOT_FOUND, so let us do that instead.

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

index 77c3afaf80547d3111ed589050202e07040dc3f2..3f0262bd834a31e61f0f4b1cfe9c96cbbbf803a4 100644 (file)
@@ -1940,7 +1940,7 @@ VMCIContext_NotifyDoorbell(VMCIId srcCID,                   // IN
    dstContext = VMCIContext_Get(handle.context);
    if (dstContext == NULL) {
       VMCI_DEBUG_LOG(4, (LGPFX"Invalid context (ID=0x%x).\n", handle.context));
-      return VMCI_ERROR_INVALID_ARGS;
+      return VMCI_ERROR_NOT_FOUND;
    }
 
    if (srcCID != handle.context) {
index 8641af561b1d4056ec5f9eed8a60b3be6cff5e6f..3fa639c380aeb2bda0829adb254555ee3edfa428 100644 (file)
@@ -227,7 +227,9 @@ VMCIDoorbellReleaseCB(void *clientData) // IN: doorbell entry
  *    handle. Hypervisor endpoints are not yet supported.
  *
  * Result:
- *    VMCI_SUCCESS on success, VMCI_ERROR_INVALID_ARGS if handle is invalid.
+ *    VMCI_SUCCESS on success,
+ *    VMCI_ERROR_NOT_FOUND if handle isn't found,
+ *    VMCI_ERROR_INVALID_ARGS if handle is invalid.
  *
  * Side effects:
  *    None.
@@ -249,7 +251,7 @@ VMCIDoorbellGetPrivFlags(VMCIHandle handle,             // IN
 
       resource = VMCIResource_Get(handle, VMCI_RESOURCE_TYPE_DOORBELL);
       if (resource == NULL) {
-         return VMCI_ERROR_INVALID_ARGS;
+         return VMCI_ERROR_NOT_FOUND;
       }
       entry = RESOURCE_CONTAINER(resource, VMCIDoorbellEntry, resource);
       *privFlags = entry->privFlags;
@@ -897,13 +899,20 @@ VMCIDoorbellHostContextNotify(VMCIId srcCID,     // IN
 
    ASSERT(VMCI_HostPersonalityActive());
 
-   resource = VMCIResource_Get(handle, VMCI_RESOURCE_TYPE_DOORBELL);
-   if (resource == NULL) {
+   if (VMCI_HANDLE_INVALID(handle)) {
       VMCI_DEBUG_LOG(4,
                      (LGPFX"Notifying an invalid doorbell (handle=0x%x:0x%x).\n",
                       handle.context, handle.resource));
       return VMCI_ERROR_INVALID_ARGS;
    }
+
+   resource = VMCIResource_Get(handle, VMCI_RESOURCE_TYPE_DOORBELL);
+   if (resource == NULL) {
+      VMCI_DEBUG_LOG(4,
+                     (LGPFX"Notifying an unknown doorbell (handle=0x%x:0x%x).\n",
+                      handle.context, handle.resource));
+      return VMCI_ERROR_NOT_FOUND;
+   }
    entry = RESOURCE_CONTAINER(resource, VMCIDoorbellEntry, resource);
 
    if (entry->runDelayed) {
index 0e38fd8de916e93ea42b4855e2cc8871db3fd8d4..8d848855fe3c128525cb703a15d11aeab5649b38 100644 (file)
@@ -25,8 +25,8 @@
 #ifndef _VMCI_VERSION_H_
 #define _VMCI_VERSION_H_
 
-#define VMCI_DRIVER_VERSION          9.3.11.0
-#define VMCI_DRIVER_VERSION_COMMAS   9,3,11,0
-#define VMCI_DRIVER_VERSION_STRING   "9.3.11.0"
+#define VMCI_DRIVER_VERSION          9.3.12.0
+#define VMCI_DRIVER_VERSION_COMMAS   9,3,12,0
+#define VMCI_DRIVER_VERSION_STRING   "9.3.12.0"
 
 #endif /* _VMCI_VERSION_H_ */