]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Internal branch sync. Included in this change:
authorVMware, Inc <>
Thu, 2 Aug 2012 06:57:41 +0000 (23:57 -0700)
committerDmitry Torokhov <dtor@vmware.com>
Thu, 2 Aug 2012 18:23:09 +0000 (11:23 -0700)
. lib/file: check for available free space before moving directory
  trees

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

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
open-vm-tools/lib/file/file.c
open-vm-tools/lib/include/vm_device_version.h
open-vm-tools/lib/include/vm_product.h
open-vm-tools/lib/stubs/stub-user-msg.c

index 1c5d8ec040d0d5e99d8c72348356de0fffba150d..65fa7256925aed4fd009cead9f5f78e5a5d564d1 100644 (file)
@@ -1446,6 +1446,33 @@ File_MoveTree(ConstUnicode srcName,   // IN:
          }
       }
 
+#if !defined(__FreeBSD__) && !defined(sun)
+      /*
+       * File_GetFreeSpace is not defined for FreeBSD
+       */
+      if (createdDir) {
+         /*
+          * Check for free space on destination filesystem.
+          * We only check for free space if the destination directory
+          * did not exist. In this case, we will not be overwriting any existing
+          * paths, so we need as much space as srcName.
+          */
+         int64 srcSize;
+         int64 freeSpace;
+         srcSize = File_GetSizeEx(srcName);
+         freeSpace = File_GetFreeSpace(dstName, TRUE);
+         if (freeSpace < srcSize) {
+            Unicode spaceStr = Msg_FormatSizeInBytes(srcSize);
+            Msg_Append(MSGID(File.MoveTree.dst.insufficientSpace)
+                  "There is not enough space in the file system to "
+                  "move the directory tree. Free %s and try again.",
+                  spaceStr);
+            free(spaceStr);
+            return FALSE;
+         }
+      }
+#endif
+
       if (File_CopyTree(srcName, dstName, overwriteExisting, FALSE)) {
          ret = TRUE;
 
index dafa34af0b8f3ab2ae6b4f5b4ababd4f6bbf59e9..b62d6ff0675c15f4e75d87c01c656ed0f8dd7485 100644 (file)
 #define SCSI_MAX_CONTROLLERS    4        // Need more than 1 for MSCS clustering
 #define        SCSI_MAX_DEVICES         16       // BT-958 emulates only 16
 #define PVSCSI_MAX_DEVICES       255      // 255 (including the controller)
+
+/************* SATA implementation limits ********************************/
+#define SATA_MAX_CONTROLLERS   4
+#define SATA_MAX_DEVICES       30
+
 /*
- * VSCSI_BV_INTS is the number of uint32's needed for a bit vector 
+ * VSCSI_BV_INTS is the number of uint32's needed for a bit vector
  * to cover all scsi devices per target.
  */
 #define VSCSI_BV_INTS            CEILING(PVSCSI_MAX_DEVICES, 8 * sizeof (uint32))
index 03da1fd2c3953256d44b6e08bdb2756262254e2f..defc5b30ef4dcc70597125bbea45b314b8df6794 100644 (file)
@@ -90,6 +90,7 @@
 #define PRODUCT_PLAYER_NAME_FOR_LICENSE PRODUCT_PLAYER_NAME
 #define PRODUCT_ACE_PLAYER_NAME MAKE_NAME(PRODUCT_ACE_PLAYER_BRIEF_NAME)
 #define PRODUCT_ACE_MANAGEMENT_SERVER_NAME MAKE_NAME(PRODUCT_ACE_MANAGEMENT_SERVER_BRIEF_NAME)
+#define PRODUCT_MAC_DESKTOP_NAME_FOR_LICENSE "VMware Fusion for Mac OS"
 
 #define PRODUCT_VMLS_SHORT_NAME "VMLS"
 #define PRODUCT_VMLS_NAME MAKE_NAME("License Server")
 #      define PRODUCT_SMP_NAME_FOR_LICENSE PRODUCT_ESX_SMP_NAME
 #   elif defined(VMX86_DESKTOP)
 #      if defined(__APPLE__)
-#         define PRODUCT_NAME_FOR_LICENSE "VMware Fusion for Mac OS"
+#         define PRODUCT_NAME_FOR_LICENSE PRODUCT_MAC_DESKTOP_NAME_FOR_LICENSE
 #      else
 #         define PRODUCT_NAME_FOR_LICENSE "VMware Workstation"
 #      endif
  */
 #   if defined(VMX86_DESKTOP)
 #      if defined(__APPLE__)
-#         define PRODUCT_NAME_FOR_LICENSE "VMware Fusion for Mac OS"
+#         define PRODUCT_NAME_FOR_LICENSE PRODUCT_MAC_DESKTOP_NAME_FOR_LICENSE
 #      else
 #         define PRODUCT_NAME_FOR_LICENSE "VMware Workstation"
 #      endif
index 78f4de7b997d4ea4003e1a90d867d71814ed8b34..6f4a1ed5da1f3d18b9e07b8be40fb227b9cf142c 100644 (file)
@@ -89,3 +89,10 @@ Msg_Reset(Bool log)
    NOT_IMPLEMENTED();
 }
 
+char *
+Msg_FormatSizeInBytes(uint64 size)
+{
+   return NULL;
+}
+
+