VirtualBox

Changeset 46029 in vbox for trunk/src/VBox/Storage


Ignore:
Timestamp:
May 13, 2013 4:07:36 PM (12 years ago)
Author:
vboxsync
Message:

Storage/VHDX: Disable a few consistency checks. I've seen images in the wild which violate the spec. Because VHDX is supported readonly only so far there is no risk of data corruption

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Storage/VHDX.cpp

    r45486 r46029  
    587587    {VHDX_METADATA_TBL_ENTRY_ITEM_PAGE83_DATA,    false,   true,     true,        VHDXMETADATAITEM_PAGE83_DATA},
    588588    {VHDX_METADATA_TBL_ENTRY_ITEM_LOG_SECT_SIZE,  false,   true,     true,        VHDXMETADATAITEM_LOGICAL_SECTOR_SIZE},
    589     {VHDX_METADATA_TBL_ENTRY_ITEM_PHYS_SECT_SIZE, false,   true,     false,       VHDXMETADATAITEM_PHYSICAL_SECTOR_SIZE},
     589    {VHDX_METADATA_TBL_ENTRY_ITEM_PHYS_SECT_SIZE, false,   true,     true,        VHDXMETADATAITEM_PHYSICAL_SECTOR_SIZE},
    590590    {VHDX_METADATA_TBL_ENTRY_ITEM_PARENT_LOCATOR, false,   false,    true,        VHDXMETADATAITEM_PARENT_LOCATOR}
    591591};
     
    11781178                        && (i % uChunkRatio) == 0)
    11791179                    {
     1180/**
     1181 * Disabled the verification because there are images out there with the sector bitmap
     1182 * marked as present. The entry is never accessed and the image is readonly anyway,
     1183 * so no harm done.
     1184 */
     1185#if 0
    11801186                        /* Sector bitmap block. */
    11811187                        if (   VHDX_BAT_ENTRY_GET_STATE(paBatEntries[i].u64BatEntry)
     
    11871193                            break;
    11881194                        }
     1195#endif
    11891196                    }
    11901197                    else
     
    14201427                                          s_aVhdxMetadataItemProps[idxProp].pszItemUuid))
    14211428                    {
     1429                        /*
     1430                         * Check for specification violations and bail out, except
     1431                         * for the required flag of the physical sector size metadata item.
     1432                         * Early images had the required flag not set opposed to the specification.
     1433                         * We don't want to brerak those images.
     1434                         */
    14221435                        if (   !!(MetadataTblEntry.u32Flags & VHDX_METADATA_TBL_ENTRY_FLAGS_IS_USER)
    14231436                            != s_aVhdxMetadataItemProps[idxProp].fIsUser)
     
    14301443                                           "VHDX: Virtual disk flag of metadata item does not meet expectations \'%s\'",
    14311444                                           pImage->pszFilename);
    1432                         else if (   !!(MetadataTblEntry.u32Flags & VHDX_METADATA_TBL_ENTRY_FLAGS_IS_REQUIRED)
    1433                                  != s_aVhdxMetadataItemProps[idxProp].fIsRequired)
     1445                        else if (      !!(MetadataTblEntry.u32Flags & VHDX_METADATA_TBL_ENTRY_FLAGS_IS_REQUIRED)
     1446                                    != s_aVhdxMetadataItemProps[idxProp].fIsRequired
     1447                                 && (s_aVhdxMetadataItemProps[idxProp].enmMetadataItem != VHDXMETADATAITEM_PHYSICAL_SECTOR_SIZE))
    14341448                            rc = vdIfError(pImage->pIfError, VERR_VD_GEN_INVALID_HEADER, RT_SRC_POS,
    14351449                                           "VHDX: Required flag of metadata item does not meet expectations \'%s\'",
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette