Changeset 97260 in vbox for trunk/src/VBox/Storage
- Timestamp:
- Oct 20, 2022 11:02:43 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Storage/VMDK.cpp
r97255 r97260 5046 5046 if (RT_SUCCESS(rc)) 5047 5047 { 5048 pImage->cbSize = cbSize; 5048 5049 /* 5049 5050 * Create the raw-drive descriptor … … 5746 5747 rc = vmdkMakeRawDescriptor(pImage, &pRaw); 5747 5748 if (RT_FAILURE(rc)) 5748 return vdIfError(pImage->pIfError, rc, RT_SRC_POS, N_("VMDK: could get raw descriptor for '%s'"), pImage->pszFilename); 5749 return vdIfError(pImage->pIfError, rc, RT_SRC_POS, N_("VMDK: could not create raw descriptor for '%s'"), 5750 pImage->pszFilename); 5751 if (!cbSize) 5752 cbSize = pImage->cbSize; 5749 5753 5750 5754 rc = vmdkCreateRawImage(pImage, pRaw, cbSize); … … 5787 5791 vmdkDescExtRemoveDummy(pImage, &pImage->Descriptor); 5788 5792 5789 if ( RT_SUCCESS(rc) 5790 && pPCHSGeometry->cCylinders != 0 5791 && pPCHSGeometry->cHeads != 0 5792 && pPCHSGeometry->cSectors != 0) 5793 rc = vmdkDescSetPCHSGeometry(pImage, pPCHSGeometry); 5793 pImage->LCHSGeometry = *pLCHSGeometry; 5794 pImage->PCHSGeometry = *pPCHSGeometry; 5795 5796 if (RT_SUCCESS(rc)) 5797 { 5798 if ( pPCHSGeometry->cCylinders != 0 5799 && pPCHSGeometry->cHeads != 0 5800 && pPCHSGeometry->cSectors != 0) 5801 rc = vmdkDescSetPCHSGeometry(pImage, pPCHSGeometry); 5802 else if (uImageFlags & VD_VMDK_IMAGE_FLAGS_RAWDISK) 5803 { 5804 VDGEOMETRY RawDiskPCHSGeometry; 5805 RawDiskPCHSGeometry.cCylinders = (uint32_t)RT_MIN(pImage->cbSize / 512 / 16 / 63, 16383); 5806 RawDiskPCHSGeometry.cHeads = 16; 5807 RawDiskPCHSGeometry.cSectors = 63; 5808 rc = vmdkDescSetPCHSGeometry(pImage, &RawDiskPCHSGeometry); 5809 } 5810 } 5794 5811 5795 5812 if ( RT_SUCCESS(rc) … … 5798 5815 && pLCHSGeometry->cSectors != 0) 5799 5816 rc = vmdkDescSetLCHSGeometry(pImage, pLCHSGeometry); 5800 5801 pImage->LCHSGeometry = *pLCHSGeometry;5802 pImage->PCHSGeometry = *pPCHSGeometry;5803 5817 5804 5818 pImage->ImageUuid = *pUuid;
Note:
See TracChangeset
for help on using the changeset viewer.