]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Make SSD-based backing stores visible to guests
authorVMware, Inc <>
Fri, 12 Apr 2013 19:52:08 +0000 (12:52 -0700)
committerDmitry Torokhov <dtor@vmware.com>
Wed, 17 Apr 2013 19:16:55 +0000 (12:16 -0700)
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 <dtor@vmware.com>
open-vm-tools/lib/file/filePosix.c
open-vm-tools/lib/include/file.h
open-vm-tools/lib/include/util.h

index ffb67d1f2458e7df3fec95346393521edd024d15..a5be7803104e11a43c8204a29161fee7da6e3d42 100644 (file)
@@ -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);
+}
+
+
 /*
  *----------------------------------------------------------------------
  *
index 148d63df71b8fa3fa9c32cb75155f1d81c0c3f90..4aba415d0ef02ad03eb7acc64eed74bb5eb10e32 100644 (file)
@@ -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,
index a9539c2766898ef6f42966ff228d09848220061e..276ddd55f391a49468ecdb3ba74ef0a79d454b34 100644 (file)
@@ -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)