- Timestamp:
- Nov 6, 2009 1:16:47 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/VBoxHDD.cpp
r23973 r24439 2244 2244 uImageFlags |= VD_IMAGE_FLAGS_FIXED; 2245 2245 2246 /* Fix broken PCHS geometry. Can happen for two reasons: either 2247 * the backend mixes up PCHS and LCHS, or the application used 2248 * to create the source image has put garbage in it. */ 2249 /** @todo double-check if the VHD backend correctly handles 2250 * PCHS and LCHS geometry. also reconsider our current paranoia 2251 * level when it comes to geometry settings here and in the 2252 * backends. */ 2253 if (PCHSGeometryFrom.cHeads > 16 || PCHSGeometryFrom.cSectors > 63) 2254 { 2255 Assert(RT_MIN(cbSize / 512 / 16 / 63, 16383) - (uint32_t)RT_MIN(cbSize / 512 / 16 / 63, 16383)); 2256 PCHSGeometryFrom.cCylinders = (uint32_t)RT_MIN(cbSize / 512 / 16 / 63, 16383); 2257 PCHSGeometryFrom.cHeads = 16; 2258 PCHSGeometryFrom.cSectors = 63; 2259 } 2260 2246 2261 rc = VDCreateBase(pDiskTo, pszBackend, pszFilename, cbSize, 2247 2262 uImageFlags, szComment, … … 2327 2342 if (RT_SUCCESS(rc)) 2328 2343 { 2329 pImageTo->Backend->pfnSetModificationUuid(pImageTo->pvBackendData, &ImageModificationUuid); 2344 /* Only set modification UUID if it is non-null, since the source 2345 * backend might not provide a valid modification UUID. */ 2346 if (!RTUuidIsNull(&ImageModificationUuid)) 2347 pImageTo->Backend->pfnSetModificationUuid(pImageTo->pvBackendData, &ImageModificationUuid); 2330 2348 /** @todo double-check this - it makes little sense to copy over the parent modification uuid, 2331 2349 * as the destination image can have a totally different parent. */
Note:
See TracChangeset
for help on using the changeset viewer.