/*********************************************************
- * Copyright (C) 2004-2018 VMware, Inc. All rights reserved.
+ * Copyright (C) 2004-2019 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
/* Type of the partition */
WiperPartition_Type type;
-
- /*
+
+ /* Filesystem name - testing */
+ const char *fsName;
+
+ /* Filesystem type (name) */
+ const char *fsType;
+
+ /*
* Clients should specifically set this flag to TRUE to enable free space
* reclamation using unmaps.
*/
/*********************************************************
- * Copyright (C) 2009-2016 VMware, Inc. All rights reserved.
+ * Copyright (C) 2009-2016, 2019 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
if (p != NULL) {
memset(p->mountPoint, 0, sizeof p->mountPoint);
p->type = PARTITION_UNSUPPORTED;
+ p->fsType = NULL;
+ p->fsName = NULL;
p->comment = NULL;
p->attemptUnmaps = TRUE;
DblLnkLst_Init(&p->link);
{
if (p) {
free((char *)p->comment); /* Casting away constness */
+ free((char *)p->fsType); /* Casting away constness */
+ free((char *)p->fsName); /* Casting away constness */
free(p);
}
}
/*********************************************************
- * Copyright (C) 2004-2018 VMware, Inc. All rights reserved.
+ * Copyright (C) 2004-2019 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
size_t i;
item->type = PARTITION_UNSUPPORTED;
+ item->fsType = Util_SafeStrdup(MNTINFO_FSTYPE(mnt));
+ item->fsName = Util_SafeStrdup(MNTINFO_NAME(mnt));
for (i = 0; i < ARRAYSIZE(gKnownPartitions); i++) {
info = &gKnownPartitions[i];
Str_Strcpy(partEntry->name, part->mountPoint, partNameSize);
partEntry->freeBytes = freeBytes;
partEntry->totalBytes = totalBytes;
+ Str_Strncpy(partEntry->fsType, sizeof (di->partitionList)[0].fsType,
+ part->fsType, strlen(part->fsType));
di->partitionList = newPartitionList;
- g_debug("%s added partition #%d %s type %d free %"FMT64"u total %"FMT64"u\n",
+ g_debug("%s added partition #%d %s type %d fstype %s (mount point %s) "
+ "free %"FMT64"u total %"FMT64"u\n",
__FUNCTION__, partCount, partEntry->name, part->type,
+ partEntry->fsType, part->fsName,
partEntry->freeBytes, partEntry->totalBytes);
} else {
g_debug("%s ignoring unsupported partition %s %s\n",
uint64 freeBytes;
uint64 totalBytes;
char name[PARTITION_NAME_SIZE];
+ char fsType[FSTYPE_SIZE];
#ifdef _WIN32
/* UUID of the disk, if known. Currently only Windows */
char uuid[PARTITION_NAME_SIZE];
- /* filesystem type. Currently only Windows */
- char fsType[FSTYPE_SIZE];
#endif
} PartitionEntryInt;
"\"" DISK_INFO_KEY_DISK_NAME "\":\"%s\","
"\"" DISK_INFO_KEY_DISK_FREE "\":\"%"FMT64"u\","
"\"" DISK_INFO_KEY_DISK_SIZE "\":\"%"FMT64"u\"";
+ static char jsonPerDiskFsTypeFmt[] = ",\"" DISK_INFO_KEY_DISK_FSTYPE "\":\"%s\"";
#ifdef _WIN32
static char jsonPerDiskUUIDFmt[] = ",\"" DISK_INFO_KEY_DISK_UUID "\":\"%s\"";
- static char jsonPerDiskFsTypeFmt[] = ",\"" DISK_INFO_KEY_DISK_FSTYPE "\":\"%s\"";
#endif
static char jsonPerDiskFmtFooter[] = "},\n";
static char jsonSuffix[] = "]}";
pdi->partitionList[i].totalBytes);
DynBuf_Append(&dynBuffer, tmpBuf, len);
g_free(b64name);
+
+ if (pdi->partitionList[i].fsType[0] != '\0') {
+ len = Str_Snprintf(tmpBuf, sizeof tmpBuf, jsonPerDiskFsTypeFmt,
+ pdi->partitionList[i].fsType);
+ DynBuf_Append(&dynBuffer, tmpBuf, len);
+ }
#ifdef _WIN32
if (reportUUID) {
if (pdi->partitionList[i].uuid[0] != '\0') {
DynBuf_Append(&dynBuffer, tmpBuf, len);
}
}
-
- if (pdi->partitionList[i].fsType[0] != '\0') {
- len = Str_Snprintf(tmpBuf, sizeof tmpBuf, jsonPerDiskFsTypeFmt,
- pdi->partitionList[i].fsType);
- DynBuf_Append(&dynBuffer, tmpBuf, len);
- }
#endif
DynBuf_Append(&dynBuffer, jsonPerDiskFmtFooter,
sizeof jsonPerDiskFmtFooter - 1);