]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Internal branch sync. Included in this change:
authorVMware, Inc <>
Mon, 21 May 2012 22:23:08 +0000 (15:23 -0700)
committerDmitry Torokhov <dtor@vmware.com>
Tue, 22 May 2012 18:57:07 +0000 (11:57 -0700)
. return a new error if the 'mount' command fails.

. changes in shared code that don't affect open-vm-tools functionality

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
open-vm-tools/lib/include/vixOpenSource.h
open-vm-tools/modules/shared/vmxnet/vmnet_def.h
open-vm-tools/services/plugins/vix/foundryToolsDaemon.c

index 1ff6b44f3f0ada6d9b5491c62943c6fc7dd44a03..7c9ba7815ec47fdf7e9be1c54e9d726ea554e946 100644 (file)
@@ -196,6 +196,9 @@ enum {
    VIX_E_REG_VALUE_NOT_FOUND                       = 20010,
    VIX_E_REG_KEY_ALREADY_EXISTS                    = 20011,
 
+   /* Generic Guest Errors */
+   VIX_E_HGFS_MOUNT_FAIL                           = 20050,
+
    /* Reg Errors*/
    VIX_E_REG_INCORRECT_VALUE_TYPE                  = 25000
    /* WARNING. Do not exceed 2**16 */
index 63ad5029c1eeacb76dc8690ac48ea9582732743b..a18eabb3b77635faea8119c78697b7a45c12c77f 100644 (file)
@@ -89,4 +89,7 @@
 #define VMNET_CAP_TSO6_EXT_HDRS 0x20000000 /* support TSO for ip6 ext hdrs */
 #define VMNET_CAP_SCHED       0x40000000 /* compliant with network scheduling */
 #define VMNET_CAP_SRIOV       0x80000000 /* Supports SR-IOV */
+#ifdef VMKTCPIP_RSS
+#define VMNET_CAP_RSS         0x100000000 /* support RSS FIXME get a 32 flag */
+#endif
 #endif // _VMNET_DEF_H_
index 0b700c279c5b857d83c1e20c15c9659dbcd88dd9..1e4406f518a46feee9ef36a55357bb00540db966 100644 (file)
@@ -734,10 +734,10 @@ ToolsDaemonTcloMountHGFS(RpcInData *data) // IN
     */
    FILE *mtab;
    struct mntent *mnt;
-   Bool vmhgfsMntFound = FALSE;
    if ((mtab = setmntent(_PATH_MOUNTED, "r")) == NULL) {
       err = VIX_E_FAIL;
    } else {
+      Bool vmhgfsMntFound = FALSE;
       while ((mnt = getmntent(mtab)) != NULL) {
          if ((strcmp(mnt->mnt_fsname, ".host:/") == 0) &&
              (strcmp(mnt->mnt_type, HGFS_NAME) == 0) &&
@@ -747,19 +747,19 @@ ToolsDaemonTcloMountHGFS(RpcInData *data) // IN
          }
       }
       endmntent(mtab);
-   }
 
-   if (!vmhgfsMntFound) {
-   /*
-    * We need to call the mount program, not the mount system call. The
-    * mount program does several additional things, like compute the mount
-    * options from the contents of /etc/fstab, and invoke custom mount
-    * programs like the one needed for HGFS.
-    */
-      int ret = system("mount -t vmhgfs .host:/ /mnt/hgfs");
-      if (ret == -1 || WIFSIGNALED(ret) ||
-          (WIFEXITED(ret) && WEXITSTATUS(ret) != 0)) {
-         err = VIX_E_FAIL;
+      if (!vmhgfsMntFound) {
+         /*
+          * We need to call the mount program, not the mount system call. The
+          * mount program does several additional things, like compute the mount
+          * options from the contents of /etc/fstab, and invoke custom mount
+          * programs like the one needed for HGFS.
+          */
+         int ret = system("mount -t vmhgfs .host:/ /mnt/hgfs");
+         if (ret == -1 || WIFSIGNALED(ret) ||
+             (WIFEXITED(ret) && WEXITSTATUS(ret) != 0)) {
+            err = VIX_E_HGFS_MOUNT_FAIL;
+         }
       }
    }
 #endif
@@ -1050,7 +1050,7 @@ gboolean
 ToolsDaemonTcloReceiveVixCommand(RpcInData *data) // IN
 {
    VixError err = VIX_OK;
-   uint32 additionalError;
+   uint32 additionalError = 0;
    char *requestName = NULL;
    VixCommandRequestHeader *requestMsg = NULL;
    size_t maxResultBufferSize;
@@ -1100,6 +1100,18 @@ ToolsDaemonTcloReceiveVixCommand(RpcInData *data) // IN
                                     &resultValueLength,
                                     &deleteResultValue);
 
+   /*
+    * NOTE: We have always been returning an additional 32 bit error (errno,
+    * or GetLastError() for Windows) along with the 64 bit VixError. The VMX
+    * side has been dropping the higher order 32 bits of VixError (by copying
+    * it onto a 32 bit error). They do save the additional error but as far
+    * as we can tell, it was not getting used by foundry. So at this place,
+    * for certain guest commands that have extra error information tucked into
+    * the higher order 32 bits of the VixError, we use that extra error as the
+    * additional error to be sent back to VMX.
+    */
+   additionalError = VixTools_GetAdditionalError(requestMsg->opCode, err);
+   Debug("%s: additionalError = %u\n", __FUNCTION__, additionalError);
 
 abort:
    tcloBufferLen = resultValueLength + vixPrefixDataSize;
@@ -1118,17 +1130,7 @@ abort:
    /*
     * All Foundry tools commands return results that start with a foundry error
     * and a guest-OS-specific error.
-    *
-    * NOTE: We have always been returning an additional 32 bit error (errno,
-    * or GetLastError() for Windows) along with the 64 bit VixError. The VMX
-    * side has been dropping the higher order 32 bits of VixError (by copying
-    * it onto a 32 bit error). They do save the additional error but as far
-    * as we can tell, it was not getting used by foundry. So at this place,
-    * for certain guest commands that have extra error information tucked into
-    * the higher order 32 bits of the VixError, we use that extra error as the
-    * additional error to be sent back to VMX.
     */
-   additionalError = VixTools_GetAdditionalError(requestMsg->opCode, err);
    Str_Sprintf(tcloBuffer,
                sizeof tcloBuffer,
                "%"FMT64"d %d ",