VirtualBox

Ignore:
Timestamp:
Aug 25, 2020 7:59:36 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
140060
Message:

VBoxInternalManager.cpp,vd.h: 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/Frontends/VBoxManage/VBoxInternalManage.cpp

    r85221 r85884  
    15161516    {
    15171517        RawDescriptor.uFlags = VDISKRAW_DISK;
    1518         RawDescriptor.pszRawDisk = rawdisk.c_str();
     1518        RawDescriptor.pszRawDisk = (char *)rawdisk.c_str();
    15191519    }
    15201520    else
     
    15641564        }
    15651565
    1566         RawDescriptor.uPartitioningType = partitions.uPartitioningType;
     1566        RawDescriptor.enmPartitioningType = partitions.uPartitioningType;
    15671567
    15681568        for (unsigned i = 0; i < partitions.cPartitions; i++)
     
    16051605                 * prevent overlapping data areas on the resulting image. */
    16061606                pPartDesc->cbData = RT_MIN(partitions.aPartitions[i].cPartDataSectors, 63) * 512;
    1607                 pPartDesc->uStart = partitions.aPartitions[i].uPartDataStart * 512;
     1607                pPartDesc->offStartInVDisk = partitions.aPartitions[i].uPartDataStart * 512;
    16081608                Assert(pPartDesc->cbData - (size_t)pPartDesc->cbData == 0);
    16091609                void *pPartData = RTMemAlloc((size_t)pPartDesc->cbData);
     
    17301730
    17311731                pPartDesc->pszRawDevice = pszRawName;
    1732                 pPartDesc->uStartOffset = uStartOffset;
     1732                pPartDesc->offStartInDevice = uStartOffset;
    17331733            }
    17341734            else
    17351735            {
    17361736                pPartDesc->pszRawDevice = NULL;
    1737                 pPartDesc->uStartOffset = 0;
    1738             }
    1739 
    1740             pPartDesc->uStart = partitions.aPartitions[i].uStart * 512;
     1737                pPartDesc->offStartInDevice = 0;
     1738            }
     1739
     1740            pPartDesc->offStartInVDisk = partitions.aPartitions[i].uStart * 512;
    17411741            pPartDesc->cbData = partitions.aPartitions[i].uSize * 512;
    17421742        }
     
    17461746        {
    17471747            unsigned uMinIdx = i;
    1748             uint64_t uMinVal = RawDescriptor.pPartDescs[i].uStart;
     1748            uint64_t uMinVal = RawDescriptor.pPartDescs[i].offStartInVDisk;
    17491749            for (unsigned j = i + 1; j < RawDescriptor.cPartDescs; j++)
    17501750            {
    1751                 if (RawDescriptor.pPartDescs[j].uStart < uMinVal)
     1751                if (RawDescriptor.pPartDescs[j].offStartInVDisk < uMinVal)
    17521752                {
    17531753                    uMinIdx = j;
    1754                     uMinVal = RawDescriptor.pPartDescs[j].uStart;
     1754                    uMinVal = RawDescriptor.pPartDescs[j].offStartInVDisk;
    17551755                }
    17561756            }
     
    17721772            if (RawDescriptor.pPartDescs[i].pvPartitionData)
    17731773            {
    1774                 RawDescriptor.pPartDescs[i].cbData = RT_MIN(RawDescriptor.pPartDescs[i+1].uStart - RawDescriptor.pPartDescs[i].uStart, RawDescriptor.pPartDescs[i].cbData);
     1774                RawDescriptor.pPartDescs[i].cbData = RT_MIN(  RawDescriptor.pPartDescs[i+1].offStartInVDisk
     1775                                                            - RawDescriptor.pPartDescs[i].offStartInVDisk,
     1776                                                            RawDescriptor.pPartDescs[i].cbData);
    17751777                if (!RawDescriptor.pPartDescs[i].cbData)
    17761778                {
    1777                     if (RawDescriptor.uPartitioningType == VDISKPARTTYPE_MBR)
     1779                    if (RawDescriptor.enmPartitioningType == VDISKPARTTYPE_MBR)
    17781780                    {
    17791781                        RTMsgError("MBR/EPT overlaps with data area");
Note: See TracChangeset for help on using the changeset viewer.

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