Changeset 77606 in vbox for trunk/src/VBox/Storage
- Timestamp:
- Mar 8, 2019 2:55:07 AM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 129234
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Storage/VDI.cpp
r76553 r77606 39 39 #define SET_ENDIAN_U32(conv, u32) (conv == VDIECONV_H2F ? RT_H2LE_U32(u32) : RT_LE2H_U32(u32)) 40 40 #define SET_ENDIAN_U64(conv, u64) (conv == VDIECONV_H2F ? RT_H2LE_U64(u64) : RT_LE2H_U64(u64)) 41 42 static const char *vdiAllocationBlockSize = "1048576"; 43 44 static const VDCONFIGINFO vdiConfigInfo[] = { 45 { "AllocationBlockSize", vdiAllocationBlockSize, VDCFGVALUETYPE_INTEGER, 0 } 46 }; 41 47 42 48 … … 178 184 } 179 185 186 180 187 /** 181 188 * Internal: Set the appropriate endianess on all the Blocks pointed. … … 549 556 */ 550 557 static int vdiSetupImageState(PVDIIMAGEDESC pImage, unsigned uImageFlags, const char *pszComment, 551 uint64_t cbSize, uint32_t cb DataAlign, PCVDGEOMETRY pPCHSGeometry,558 uint64_t cbSize, uint32_t cbAllocationBlock, uint32_t cbDataAlign, PCVDGEOMETRY pPCHSGeometry, 552 559 PCVDGEOMETRY pLCHSGeometry) 553 560 { … … 555 562 556 563 vdiInitPreHeader(&pImage->PreHeader); 557 vdiInitHeader(&pImage->Header, uImageFlags, pszComment, cbSize, VDI_IMAGE_DEFAULT_BLOCK_SIZE, 0,564 vdiInitHeader(&pImage->Header, uImageFlags, pszComment, cbSize, cbAllocationBlock, 0, 558 565 cbDataAlign); 559 566 /* Save PCHS geometry. Not much work, and makes the flow of information … … 696 703 int rc = VINF_SUCCESS; 697 704 uint32_t cbDataAlign = VDI_DATA_ALIGN; 698 705 uint32_t cbAllocationBlock = VDI_IMAGE_DEFAULT_BLOCK_SIZE; 699 706 AssertPtr(pPCHSGeometry); 700 707 AssertPtr(pLCHSGeometry); … … 710 717 N_("VDI: comment is too long for '%s'"), pImage->pszFilename); 711 718 719 PVDINTERFACECONFIG pImgCfg = VDIfConfigGet(pImage->pVDIfsImage); 720 if (pImgCfg) { 721 rc = VDCFGQueryU32Def(pImgCfg, "AllocationBlockSize", &cbAllocationBlock, VDI_IMAGE_DEFAULT_BLOCK_SIZE); 722 if (RT_FAILURE(rc)) 723 rc = vdIfError(pImage->pIfError, rc, RT_SRC_POS, 724 N_("VDI: Getting AllocationBlockSize for '%s' failed (%Rrc)"), pImage->pszFilename, rc); 725 } 726 712 727 if (pIfCfg) 713 728 { … … 720 735 if (RT_SUCCESS(rc)) 721 736 { 722 rc = vdiSetupImageState(pImage, uImageFlags, pszComment, cbSize, cbDataAlign, 723 pPCHSGeometry, pLCHSGeometry); 737 738 rc = vdiSetupImageState(pImage, uImageFlags, pszComment, cbSize, 739 cbAllocationBlock, cbDataAlign, pPCHSGeometry, pLCHSGeometry); 724 740 if (RT_SUCCESS(rc)) 725 741 { … … 1484 1500 PVDINTERFACEPROGRESS pIfProgress = VDIfProgressGet(pVDIfsOperation); 1485 1501 PVDINTERFACECONFIG pIfCfg = VDIfConfigGet(pVDIfsOperation); 1486 1487 1502 pImage->pszFilename = pszFilename; 1488 1503 pImage->pStorage = NULL; … … 3132 3147 s_aVdiFileExtensions, 3133 3148 /* paConfigInfo */ 3134 NULL,3149 vdiConfigInfo, 3135 3150 /* pfnProbe */ 3136 3151 vdiProbe,
Note:
See TracChangeset
for help on using the changeset viewer.