VirtualBox

Changeset 31312 in vbox for trunk


Ignore:
Timestamp:
Aug 2, 2010 3:17:45 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
64339
Message:

Main: undo rename, readability

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/MachineImpl.cpp

    r31308 r31312  
    32163216                        medium->getLocationFull().raw());
    32173217
    3218     bool fImplicit = false;
     3218    bool fIndirect = false;
    32193219    if (!medium.isNull())
    3220         fImplicit = medium->isReadOnly();
     3220        fIndirect = medium->isReadOnly();
    32213221    bool associate = true;
    32223222
    32233223    do
    32243224    {
    3225         if (aType == DeviceType_HardDisk && mMediaData.isBackedUp())
     3225        if (    aType == DeviceType_HardDisk
     3226             && mMediaData.isBackedUp())
    32263227        {
    32273228            const MediaData::AttachmentList &oldAtts = mMediaData.backedUpData()->mAttachments;
     
    32323233            if ((pAttachTemp = findAttachment(oldAtts, medium)))
    32333234            {
    3234                 AssertReturn(!fImplicit, E_FAIL);
     3235                AssertReturn(!fIndirect, E_FAIL);
    32353236
    32363237                /* see if it's the same bus/channel/device */
     
    32513252
    32523253        /* go further only if the attachment is to be indirect */
    3253         if (!fImplicit)
     3254        if (!fIndirect)
    32543255            break;
    32553256
     
    33193320                    mediumLock.attach(medium);
    33203321                    /* not implicit, doesn't require association with this VM */
    3321                     fImplicit = false;
     3322                    fIndirect = false;
    33223323                    associate = false;
    33233324                    /* go right to the MediumAttachment creation */
     
    33423343                const MediaData::AttachmentList &snapAtts = snap->getSnapshotMachine()->mMediaData->mAttachments;
    33433344
    3344                 MediaData::AttachmentList::const_iterator foundIt = snapAtts.end();
     3345                MediumAttachment *pAttachFound = NULL;
    33453346                uint32_t foundLevel = 0;
    33463347
     
    33633364                         * descendant of medium will be used
    33643365                         */
    3365                         if (    (*it)->getDevice() == aDevice
    3366                              && (*it)->getPort() == aControllerPort
    3367                              && (*it)->getControllerName() == aControllerName
     3366                        if (    pAttach->getDevice() == aDevice
     3367                             && pAttach->getPort() == aControllerPort
     3368                             && pAttach->getControllerName() == aControllerName
    33683369                           )
    33693370                        {
    3370                             foundIt = it;
     3371                            pAttachFound = pAttach;
    33713372                            break;
    33723373                        }
    3373                         else if (    foundIt == snapAtts.end()
     3374                        else if (    !pAttachFound
    33743375                                  || level > foundLevel /* prefer younger */
    33753376                                )
    33763377                        {
    3377                             foundIt = it;
     3378                            pAttachFound = pAttach;
    33783379                            foundLevel = level;
    33793380                        }
     
    33813382                }
    33823383
    3383                 if (foundIt != snapAtts.end())
     3384                if (pAttachFound)
    33843385                {
    3385                     base = (*foundIt)->getMedium();
     3386                    base = pAttachFound->getMedium();
    33863387                    break;
    33873388                }
     
    34693470                          aDevice,
    34703471                          aType,
    3471                           fImplicit,
     3472                          fIndirect,
    34723473                          0 /* No bandwidth limit */);
    34733474    if (FAILED(rc)) return rc;
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