From: VMware, Inc <> Date: Thu, 2 Aug 2012 06:57:41 +0000 (-0700) Subject: Internal branch sync. Included in this change: X-Git-Tag: 2012.10.14-874563~52 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ea510441e278f6c86ece2425d744799883e0116f;p=thirdparty%2Fopen-vm-tools.git Internal branch sync. Included in this change: . 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 --- diff --git a/open-vm-tools/lib/file/file.c b/open-vm-tools/lib/file/file.c index 1c5d8ec04..65fa72569 100644 --- a/open-vm-tools/lib/file/file.c +++ b/open-vm-tools/lib/file/file.c @@ -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; diff --git a/open-vm-tools/lib/include/vm_device_version.h b/open-vm-tools/lib/include/vm_device_version.h index dafa34af0..b62d6ff06 100644 --- a/open-vm-tools/lib/include/vm_device_version.h +++ b/open-vm-tools/lib/include/vm_device_version.h @@ -181,8 +181,13 @@ #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)) diff --git a/open-vm-tools/lib/include/vm_product.h b/open-vm-tools/lib/include/vm_product.h index 03da1fd2c..defc5b30e 100644 --- a/open-vm-tools/lib/include/vm_product.h +++ b/open-vm-tools/lib/include/vm_product.h @@ -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") @@ -393,7 +394,7 @@ # 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 @@ -502,7 +503,7 @@ */ # 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 diff --git a/open-vm-tools/lib/stubs/stub-user-msg.c b/open-vm-tools/lib/stubs/stub-user-msg.c index 78f4de7b9..6f4a1ed5d 100644 --- a/open-vm-tools/lib/stubs/stub-user-msg.c +++ b/open-vm-tools/lib/stubs/stub-user-msg.c @@ -89,3 +89,10 @@ Msg_Reset(Bool log) NOT_IMPLEMENTED(); } +char * +Msg_FormatSizeInBytes(uint64 size) +{ + return NULL; +} + +