VirtualBox

Changeset 85885 in vbox


Ignore:
Timestamp:
Aug 25, 2020 8:02:51 PM (4 years ago)
Author:
vboxsync
Message:

VBoxInternalManager.cpp,vd.h,VMDK.cpp: Use self documenting structure names in VDISKRAWPARTDESC when it comes to the two offsets. bugref:9224

File:
1 edited

Legend:

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

    r85200 r85885  
    34733473        {
    34743474            PVDISKRAWPARTDESC pPart = &pRaw->pPartDescs[i];
    3475             if (uStart > pPart->uStart)
     3475            if (uStart > pPart->offStartInVDisk)
    34763476                return vdIfError(pImage->pIfError, VERR_INVALID_PARAMETER, RT_SRC_POS,
    34773477                                 N_("VMDK: incorrect partition data area ordering set up by the caller in '%s'"), pImage->pszFilename);
    34783478
    3479             if (uStart < pPart->uStart)
     3479            if (uStart < pPart->offStartInVDisk)
    34803480                cExtents++;
    3481             uStart = pPart->uStart + pPart->cbData;
     3481            uStart = pPart->offStartInVDisk + pPart->cbData;
    34823482            cExtents++;
    34833483        }
     
    35213521            pExtent = &pImage->pExtents[cExtents++];
    35223522
    3523             if (uStart < pPart->uStart)
     3523            if (uStart < pPart->offStartInVDisk)
    35243524            {
    35253525                pExtent->pszBasename = NULL;
    35263526                pExtent->pszFullname = NULL;
    35273527                pExtent->enmType = VMDKETYPE_ZERO;
    3528                 pExtent->cNominalSectors = VMDK_BYTE2SECTOR(pPart->uStart - uStart);
     3528                pExtent->cNominalSectors = VMDK_BYTE2SECTOR(pPart->offStartInVDisk - uStart);
    35293529                pExtent->uSectorOffset = 0;
    35303530                pExtent->enmAccess = VMDKACCESS_READWRITE;
     
    35333533                pExtent = &pImage->pExtents[cExtents++];
    35343534            }
    3535             uStart = pPart->uStart + pPart->cbData;
     3535            uStart = pPart->offStartInVDisk + pPart->cbData;
    35363536
    35373537            if (pPart->pvPartitionData)
     
    35923592                    pExtent->enmType = VMDKETYPE_FLAT;
    35933593                    pExtent->cNominalSectors = VMDK_BYTE2SECTOR(pPart->cbData);
    3594                     pExtent->uSectorOffset = VMDK_BYTE2SECTOR(pPart->uStartOffset);
     3594                    pExtent->uSectorOffset = VMDK_BYTE2SECTOR(pPart->offStartInDevice);
    35953595                    pExtent->enmAccess = (pPart->uFlags & VDISKRAW_READONLY) ? VMDKACCESS_READONLY : VMDKACCESS_READWRITE;
    35963596                    pExtent->fMetaDirty = false;
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