From: VMware, Inc <> Date: Fri, 12 Apr 2013 19:52:08 +0000 (-0700) Subject: Make SSD-based backing stores visible to guests X-Git-Tag: 2013.04.16-1098359~27 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cfe67b229f5117f123b3daabe4818eeb0c53e5df;p=thirdparty%2Fopen-vm-tools.git Make SSD-based backing stores visible to guests This change determines if the VM's virtual disk is on SSD and make this information available to guest. This is already implemented on ESX and Mac OS. This change implements it on Windows and Linux. On Linux rotational property of the disk and block device corresponding to logical volume can be read from /sys/block/dev-name/queue/rotational Signed-off-by: Dmitry Torokhov --- diff --git a/open-vm-tools/lib/file/filePosix.c b/open-vm-tools/lib/file/filePosix.c index ffb67d1f2..a5be78031 100644 --- a/open-vm-tools/lib/file/filePosix.c +++ b/open-vm-tools/lib/file/filePosix.c @@ -1196,6 +1196,28 @@ FilePosixGetParent(Unicode *canPath) // IN/OUT: Canonical file path } +/* + *----------------------------------------------------------------------------- + * + * File_GetParent -- + * + * The canPath is a canonical file path. Change it in place to the + * canonical file path of its parent directory. See FilePosixGetParent + * for more detail. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Bool +File_GetParent(Unicode *canPath) // IN/OUT: Canonical file path +{ + return FilePosixGetParent(canPath); +} + + /* *---------------------------------------------------------------------- * diff --git a/open-vm-tools/lib/include/file.h b/open-vm-tools/lib/include/file.h index 148d63df7..4aba415d0 100644 --- a/open-vm-tools/lib/include/file.h +++ b/open-vm-tools/lib/include/file.h @@ -202,6 +202,8 @@ Bool File_IsSymLink(ConstUnicode pathName); Bool File_IsCharDevice(ConstUnicode pathName); +Bool File_GetParent(Unicode *canPath); + Bool File_IsRemote(ConstUnicode pathName); Bool File_IsEmptyDirectory(ConstUnicode pathName); @@ -233,6 +235,10 @@ char *File_GetModTimeString(ConstUnicode pathName); char *File_GetUniqueFileSystemID(const char *pathName); +#ifdef _WIN32 +Unicode File_GetVolumeGUID(ConstUnicode pathName); +#endif + Bool File_GetTimes(ConstUnicode pathName, VmTimeType *createTime, VmTimeType *accessTime, diff --git a/open-vm-tools/lib/include/util.h b/open-vm-tools/lib/include/util.h index a9539c276..276ddd55f 100644 --- a/open-vm-tools/lib/include/util.h +++ b/open-vm-tools/lib/include/util.h @@ -105,6 +105,10 @@ void Util_SingleUseRelease(UtilSingleUseResource *res); Bool Util_GetProcessName(pid_t pid, char *bufOut, size_t bufOutSize); #endif +#if defined __linux__ && !defined VMX86_SERVER +Bool Util_IsPhysicalSSD(const char* device); +#endif + // backtrace functions and utilities #define UTIL_BACKTRACE_LINE_LEN (511)