Changeset 43861 in vbox
- Timestamp:
- Nov 13, 2012 10:35:55 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vd.h
r42859 r43861 152 152 153 153 /** 154 * Auxiliary data structure for difference between GPT and MBR 155 * disks. 156 */ 157 enum PARTITIONING_TYPE 154 * Auxiliary data structure for difference between GPT and MBR 155 * disks. 156 */ 157 enum PARTITIONING_TYPE 158 158 { 159 159 MBR, … … 179 179 /** Pointer to the partition descriptor array. */ 180 180 PVBOXHDDRAWPARTDESC pPartDescs; 181 /**partitioning type of the disk */ 181 /**partitioning type of the disk */ 182 182 PARTITIONING_TYPE uPartitioningType; 183 183 … … 231 231 */ 232 232 #define VD_OPEN_FLAGS_INFORM_ABOUT_ZERO_BLOCKS RT_BIT(9) 233 /** 234 * Don't do unnecessary consistency checks when opening the image. 235 * Only valid when the image is opened in readonly because inconsistencies 236 * can lead to corrupted images in read-write mode. 237 */ 238 #define VD_OPEN_FLAGS_SKIP_CONSISTENCY_CHECKS RT_BIT(10) 233 239 /** Mask of valid flags. */ 234 #define VD_OPEN_FLAGS_MASK (VD_OPEN_FLAGS_NORMAL | VD_OPEN_FLAGS_READONLY | VD_OPEN_FLAGS_HONOR_ZEROES | VD_OPEN_FLAGS_HONOR_SAME | VD_OPEN_FLAGS_INFO | VD_OPEN_FLAGS_ASYNC_IO | VD_OPEN_FLAGS_SHAREABLE | VD_OPEN_FLAGS_SEQUENTIAL | VD_OPEN_FLAGS_DISCARD | VD_OPEN_FLAGS_IGNORE_FLUSH | VD_OPEN_FLAGS_INFORM_ABOUT_ZERO_BLOCKS )240 #define VD_OPEN_FLAGS_MASK (VD_OPEN_FLAGS_NORMAL | VD_OPEN_FLAGS_READONLY | VD_OPEN_FLAGS_HONOR_ZEROES | VD_OPEN_FLAGS_HONOR_SAME | VD_OPEN_FLAGS_INFO | VD_OPEN_FLAGS_ASYNC_IO | VD_OPEN_FLAGS_SHAREABLE | VD_OPEN_FLAGS_SEQUENTIAL | VD_OPEN_FLAGS_DISCARD | VD_OPEN_FLAGS_IGNORE_FLUSH | VD_OPEN_FLAGS_INFORM_ABOUT_ZERO_BLOCKS | VD_OPEN_FLAGS_SKIP_CONSISTENCY_CHECKS) 235 241 /** @}*/ 236 242 -
trunk/src/VBox/Devices/Storage/DrvVD.cpp
r42073 r43861 2142 2142 bool fDiscard = false; 2143 2143 bool fInformAboutZeroBlocks = false; 2144 bool fSkipConsistencyChecks = false; 2144 2145 unsigned iLevel = 0; 2145 2146 PCFGMNODE pCurNode = pCfg; … … 2159 2160 "HostIPStack\0UseNewIo\0BootAcceleration\0BootAccelerationBuffer\0" 2160 2161 "SetupMerge\0MergeSource\0MergeTarget\0BwGroup\0Type\0BlockCache\0" 2161 "CachePath\0CacheFormat\0Discard\0InformAboutZeroBlocks\0"); 2162 "CachePath\0CacheFormat\0Discard\0InformAboutZeroBlocks\0" 2163 "SkipConsistencyChecks\0"); 2162 2164 } 2163 2165 else … … 2299 2301 rc = PDMDRV_SET_ERROR(pDrvIns, rc, 2300 2302 N_("DrvVD: Configuration error: Querying \"InformAboutZeroBlocks\" as boolean failed")); 2303 break; 2304 } 2305 rc = CFGMR3QueryBoolDef(pCurNode, "SkipConsistencyChecks", &fSkipConsistencyChecks, true); 2306 if (RT_FAILURE(rc)) 2307 { 2308 rc = PDMDRV_SET_ERROR(pDrvIns, rc, 2309 N_("DrvVD: Configuration error: Querying \"SKipConsistencyChecks\" as boolean failed")); 2301 2310 break; 2302 2311 } … … 2405 2414 if (pThis->pDrvMediaAsyncPort && fUseNewIo) 2406 2415 pThis->fAsyncIOSupported = true; 2416 2417 uint64_t tsStart = RTTimeNanoTS(); 2407 2418 2408 2419 unsigned iImageIdx = 0; … … 2603 2614 if (fInformAboutZeroBlocks) 2604 2615 uOpenFlags |= VD_OPEN_FLAGS_INFORM_ABOUT_ZERO_BLOCKS; 2616 if ( (uOpenFlags & VD_OPEN_FLAGS_READONLY) 2617 && fSkipConsistencyChecks) 2618 uOpenFlags |= VD_OPEN_FLAGS_SKIP_CONSISTENCY_CHECKS; 2605 2619 2606 2620 /* Try to open backend in async I/O mode first. */ … … 2662 2676 pCurNode = CFGMR3GetParent(pCurNode); 2663 2677 } 2678 2679 LogRel(("VD: Opening the disk took %lld ns\n", RTTimeNanoTS() - tsStart)); 2664 2680 2665 2681 /* Open the cache image if set. */ -
trunk/src/VBox/Storage/VD.cpp
r43787 r43861 5357 5357 rc = VERR_INVALID_PARAMETER); 5358 5358 AssertMsgBreakStmt((uOpenFlags & ~VD_OPEN_FLAGS_MASK) == 0, 5359 ("uOpenFlags=%#x\n", uOpenFlags), 5360 rc = VERR_INVALID_PARAMETER); 5361 AssertMsgBreakStmt( !(uOpenFlags & VD_OPEN_FLAGS_SKIP_CONSISTENCY_CHECKS) 5362 || (uOpenFlags & VD_OPEN_FLAGS_READONLY), 5359 5363 ("uOpenFlags=%#x\n", uOpenFlags), 5360 5364 rc = VERR_INVALID_PARAMETER); -
trunk/src/VBox/Storage/VMDK.cpp
r43818 r43861 1086 1086 *pGDTmp = RT_LE2H_U32(*pGDTmp); 1087 1087 1088 if (pExtent->uSectorRGD) 1088 if ( pExtent->uSectorRGD 1089 && !(pImage->uOpenFlags & VD_OPEN_FLAGS_SKIP_CONSISTENCY_CHECKS)) 1089 1090 { 1090 1091 /* The VMDK 1.1 spec seems to talk about compressed grain directories, … … 6548 6549 else 6549 6550 rc = VERR_INVALID_PARAMETER; 6550 goto out; 6551 } 6552 6553 /* Implement this operation via reopening the image. */ 6554 vmdkFreeImage(pImage, false); 6555 rc = vmdkOpenImage(pImage, uOpenFlags); 6551 } 6552 else 6553 { 6554 /* Implement this operation via reopening the image. */ 6555 vmdkFreeImage(pImage, false); 6556 rc = vmdkOpenImage(pImage, uOpenFlags); 6557 } 6556 6558 6557 6559 out:
Note:
See TracChangeset
for help on using the changeset viewer.