Changeset 72574 in vbox
- Timestamp:
- Jun 15, 2018 9:22:20 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Storage/VHD.cpp
r69500 r72574 40 40 #define VHD_SECTOR_SIZE 512 41 41 #define VHD_BLOCK_SIZE (2 * _1M) 42 43 /** The maximum VHD size is 2TB due to the 32bit sector numbers in the BAT. 44 * Note that this is the maximum file size including all footers and headers 45 * and not the maximum virtual disk size presented to the guest. 46 */ 47 #define VHD_MAX_SIZE (2 * _1T) 48 /** Maximum number of 512 byte sectors for a VHD image. */ 49 #define VHD_MAX_SECTORS ((uint32_t)(VHD_MAX_SIZE / VHD_SECTOR_SIZE)) 42 50 43 51 /* This is common to all VHD disk types and is located at the end of the image */ … … 748 756 AssertMsg(!(pImage->cbDataBlock % VHD_SECTOR_SIZE), ("%s: Data block size is not a multiple of %!\n", __FUNCTION__, VHD_SECTOR_SIZE)); 749 757 758 /* Bail out if the number of BAT entries exceeds the number of sectors for a maximum image. */ 759 if (pImage->cBlockAllocationTableEntries > VHD_MAX_SECTORS) 760 return VERR_VD_VHD_INVALID_HEADER; 761 750 762 pImage->cSectorsPerDataBlock = pImage->cbDataBlock / VHD_SECTOR_SIZE; 751 763 LogFlowFunc(("SectorsPerDataBlock=%u\n", pImage->cSectorsPerDataBlock)); … … 780 792 uBlockAllocationTableOffset, pBlockAllocationTable, 781 793 pImage->cBlockAllocationTableEntries * sizeof(uint32_t)); 794 if (RT_FAILURE(rc)) 795 return rc; 782 796 783 797 /*
Note:
See TracChangeset
for help on using the changeset viewer.