Changeset 107672 in vbox for trunk/src/VBox/Storage/VMDK.cpp
- Timestamp:
- Jan 10, 2025 3:41:35 PM (6 weeks ago)
- svn:sync-xref-src-repo-rev:
- 166764
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Storage/VMDK.cpp
r107671 r107672 3198 3198 else 3199 3199 { 3200 uint64_t cSectorsPerGDE, cSectorsPerGD;3201 3200 pExtent->enmType = VMDKETYPE_HOSTED_SPARSE; 3202 3201 pExtent->cSectors = VMDK_BYTE2SECTOR(RT_ALIGN_64(cbSize, _64K)); 3203 3202 pExtent->cSectorsPerGrain = VMDK_BYTE2SECTOR(_64K); 3204 3203 pExtent->cGTEntries = 512; 3205 cSectorsPerGDE = pExtent->cGTEntries * pExtent->cSectorsPerGrain; 3204 3205 uint64_t const cSectorsPerGDE = pExtent->cGTEntries * pExtent->cSectorsPerGrain; 3206 3206 pExtent->cSectorsPerGDE = cSectorsPerGDE; 3207 3207 pExtent->cGDEntries = (pExtent->cSectors + cSectorsPerGDE - 1) / cSectorsPerGDE; 3208 cSectorsPerGD = (pExtent->cGDEntries + (512 / sizeof(uint32_t) - 1)) / (512 / sizeof(uint32_t));3209 3208 } 3210 3209 … … 5592 5591 if (!(uImageFlags & VD_IMAGE_FLAGS_FIXED)) 5593 5592 { 5594 uint64_t cSectorsPerGDE, cSectorsPerGD;5595 5593 pExtent->enmType = VMDKETYPE_HOSTED_SPARSE; 5596 5594 pExtent->cSectors = VMDK_BYTE2SECTOR(RT_ALIGN_64(cbExtent, _64K)); 5597 5595 pExtent->cSectorsPerGrain = VMDK_BYTE2SECTOR(_64K); 5598 5596 pExtent->cGTEntries = 512; 5599 cSectorsPerGDE = pExtent->cGTEntries * pExtent->cSectorsPerGrain; 5597 5598 uint64_t const cSectorsPerGDE = pExtent->cGTEntries * pExtent->cSectorsPerGrain; 5600 5599 pExtent->cSectorsPerGDE = cSectorsPerGDE; 5601 5600 pExtent->cGDEntries = (pExtent->cSectors + cSectorsPerGDE - 1) / cSectorsPerGDE; 5602 cSectorsPerGD = (pExtent->cGDEntries + (512 / sizeof(uint32_t) - 1)) / (512 / sizeof(uint32_t));5603 5601 if (pImage->uImageFlags & VD_VMDK_IMAGE_FLAGS_STREAM_OPTIMIZED) 5604 5602 { … … 5732 5730 pImage->pDescData = NULL; 5733 5731 5734 uint64_t cSectorsPerGDE, cSectorsPerGD;5735 5732 pExtent->enmType = VMDKETYPE_HOSTED_SPARSE; 5736 5733 pExtent->cSectors = VMDK_BYTE2SECTOR(RT_ALIGN_64(cbSize, _64K)); 5737 5734 pExtent->cSectorsPerGrain = VMDK_BYTE2SECTOR(_64K); 5738 5735 pExtent->cGTEntries = 512; 5739 cSectorsPerGDE = pExtent->cGTEntries * pExtent->cSectorsPerGrain; 5736 5737 uint64_t const cSectorsPerGDE = pExtent->cGTEntries * pExtent->cSectorsPerGrain; 5740 5738 pExtent->cSectorsPerGDE = cSectorsPerGDE; 5741 5739 pExtent->cGDEntries = (pExtent->cSectors + cSectorsPerGDE - 1) / cSectorsPerGDE; 5742 cSectorsPerGD = (pExtent->cGDEntries + (512 / sizeof(uint32_t) - 1)) / (512 / sizeof(uint32_t));5743 5740 5744 5741 /* The spec says version is 1 for all VMDKs, but the vast
Note:
See TracChangeset
for help on using the changeset viewer.