Changeset 85884 in vbox
- Timestamp:
- Aug 25, 2020 7:59:36 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 140060
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vd.h
r85221 r85884 130 130 /** @} */ 131 131 132 /** @name V Box raw disk or partition flags132 /** @name VDISKRAW_XXX - VBox raw disk or partition flags 133 133 * @{ 134 134 */ … … 144 144 145 145 /** 146 * Auxiliary type for describing partitions on raw disks. The entries must be 147 * in ascending order (as far as uStart is concerned), and must not overlap. 148 * Note that this does not correspond 1:1 to partitions, it is describing the 149 * general meaning of contiguous areas on the disk. 146 * Auxiliary type for describing partitions on raw disks. 147 * 148 * The entries must be in ascending order (as far as uStart is concerned), and 149 * must not overlap. Note that this does not correspond 1:1 to partitions, it is 150 * describing the general meaning of contiguous areas on the disk. 150 151 */ 151 152 typedef struct VDISKRAWPARTDESC … … 161 162 const void *pvPartitionData; 162 163 /** Offset where the data starts in this device. */ 163 uint64_t uStartOffset;164 uint64_t offStartInDevice; 164 165 /** Offset where the data starts in the disk. */ 165 uint64_t uStart;166 uint64_t offStartInVDisk; 166 167 /** Size of the data area. */ 167 168 uint64_t cbData; 168 /** Flags for special treatment, see VDISKRAW_ FLAGS_*. */169 /** Flags for special treatment, see VDISKRAW_XXX. */ 169 170 uint32_t uFlags; 170 171 } VDISKRAWPARTDESC, *PVDISKRAWPARTDESC; 171 172 172 173 /** 173 * Auxiliary data structure for difference between GPT and MBR 174 * disks. 174 * Auxiliary data structure for difference between GPT and MBR disks. 175 175 */ 176 176 typedef enum VDISKPARTTYPE … … 188 188 * to make logging of the comment string produce sensible results. */ 189 189 char szSignature[4]; 190 /** Flags for special treatment, see VDISKRAW_FLAGS_*. */ 191 /** Flag whether access to full disk should be given (ignoring the 192 * partition information below). */ 190 /** Flags for special treatment, see VDISKRAW_XXX. */ 193 191 uint32_t uFlags; 194 192 /** Filename for the raw disk. Ignored for partitioned raw disks. 195 193 * For Linux e.g. /dev/sda, and for Windows e.g. //./PhysicalDisk0. */ 196 const char *pszRawDisk; 194 char *pszRawDisk; 195 /** Partitioning type of the disk */ 196 VDISKPARTTYPE enmPartitioningType; 197 197 /** Number of entries in the partition descriptor array. */ 198 u nsignedcPartDescs;198 uint32_t cPartDescs; 199 199 /** Pointer to the partition descriptor array. */ 200 200 PVDISKRAWPARTDESC pPartDescs; 201 /** Partitioning type of the disk */202 VDISKPARTTYPE uPartitioningType;203 201 } VDISKRAW, *PVDISKRAW; 204 202 -
trunk/src/VBox/Frontends/VBoxManage/VBoxInternalManage.cpp
r85221 r85884 1516 1516 { 1517 1517 RawDescriptor.uFlags = VDISKRAW_DISK; 1518 RawDescriptor.pszRawDisk = rawdisk.c_str();1518 RawDescriptor.pszRawDisk = (char *)rawdisk.c_str(); 1519 1519 } 1520 1520 else … … 1564 1564 } 1565 1565 1566 RawDescriptor. uPartitioningType = partitions.uPartitioningType;1566 RawDescriptor.enmPartitioningType = partitions.uPartitioningType; 1567 1567 1568 1568 for (unsigned i = 0; i < partitions.cPartitions; i++) … … 1605 1605 * prevent overlapping data areas on the resulting image. */ 1606 1606 pPartDesc->cbData = RT_MIN(partitions.aPartitions[i].cPartDataSectors, 63) * 512; 1607 pPartDesc-> uStart= partitions.aPartitions[i].uPartDataStart * 512;1607 pPartDesc->offStartInVDisk = partitions.aPartitions[i].uPartDataStart * 512; 1608 1608 Assert(pPartDesc->cbData - (size_t)pPartDesc->cbData == 0); 1609 1609 void *pPartData = RTMemAlloc((size_t)pPartDesc->cbData); … … 1730 1730 1731 1731 pPartDesc->pszRawDevice = pszRawName; 1732 pPartDesc-> uStartOffset= uStartOffset;1732 pPartDesc->offStartInDevice = uStartOffset; 1733 1733 } 1734 1734 else 1735 1735 { 1736 1736 pPartDesc->pszRawDevice = NULL; 1737 pPartDesc-> uStartOffset= 0;1738 } 1739 1740 pPartDesc-> uStart= partitions.aPartitions[i].uStart * 512;1737 pPartDesc->offStartInDevice = 0; 1738 } 1739 1740 pPartDesc->offStartInVDisk = partitions.aPartitions[i].uStart * 512; 1741 1741 pPartDesc->cbData = partitions.aPartitions[i].uSize * 512; 1742 1742 } … … 1746 1746 { 1747 1747 unsigned uMinIdx = i; 1748 uint64_t uMinVal = RawDescriptor.pPartDescs[i]. uStart;1748 uint64_t uMinVal = RawDescriptor.pPartDescs[i].offStartInVDisk; 1749 1749 for (unsigned j = i + 1; j < RawDescriptor.cPartDescs; j++) 1750 1750 { 1751 if (RawDescriptor.pPartDescs[j]. uStart< uMinVal)1751 if (RawDescriptor.pPartDescs[j].offStartInVDisk < uMinVal) 1752 1752 { 1753 1753 uMinIdx = j; 1754 uMinVal = RawDescriptor.pPartDescs[j]. uStart;1754 uMinVal = RawDescriptor.pPartDescs[j].offStartInVDisk; 1755 1755 } 1756 1756 } … … 1772 1772 if (RawDescriptor.pPartDescs[i].pvPartitionData) 1773 1773 { 1774 RawDescriptor.pPartDescs[i].cbData = RT_MIN(RawDescriptor.pPartDescs[i+1].uStart - RawDescriptor.pPartDescs[i].uStart, RawDescriptor.pPartDescs[i].cbData); 1774 RawDescriptor.pPartDescs[i].cbData = RT_MIN( RawDescriptor.pPartDescs[i+1].offStartInVDisk 1775 - RawDescriptor.pPartDescs[i].offStartInVDisk, 1776 RawDescriptor.pPartDescs[i].cbData); 1775 1777 if (!RawDescriptor.pPartDescs[i].cbData) 1776 1778 { 1777 if (RawDescriptor. uPartitioningType == VDISKPARTTYPE_MBR)1779 if (RawDescriptor.enmPartitioningType == VDISKPARTTYPE_MBR) 1778 1780 { 1779 1781 RTMsgError("MBR/EPT overlaps with data area");
Note:
See TracChangeset
for help on using the changeset viewer.