- Timestamp:
- Aug 2, 2010 3:17:45 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 64339
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/MachineImpl.cpp
r31308 r31312 3216 3216 medium->getLocationFull().raw()); 3217 3217 3218 bool fI mplicit = false;3218 bool fIndirect = false; 3219 3219 if (!medium.isNull()) 3220 fI mplicit = medium->isReadOnly();3220 fIndirect = medium->isReadOnly(); 3221 3221 bool associate = true; 3222 3222 3223 3223 do 3224 3224 { 3225 if (aType == DeviceType_HardDisk && mMediaData.isBackedUp()) 3225 if ( aType == DeviceType_HardDisk 3226 && mMediaData.isBackedUp()) 3226 3227 { 3227 3228 const MediaData::AttachmentList &oldAtts = mMediaData.backedUpData()->mAttachments; … … 3232 3233 if ((pAttachTemp = findAttachment(oldAtts, medium))) 3233 3234 { 3234 AssertReturn(!fI mplicit, E_FAIL);3235 AssertReturn(!fIndirect, E_FAIL); 3235 3236 3236 3237 /* see if it's the same bus/channel/device */ … … 3251 3252 3252 3253 /* go further only if the attachment is to be indirect */ 3253 if (!fI mplicit)3254 if (!fIndirect) 3254 3255 break; 3255 3256 … … 3319 3320 mediumLock.attach(medium); 3320 3321 /* not implicit, doesn't require association with this VM */ 3321 fI mplicit = false;3322 fIndirect = false; 3322 3323 associate = false; 3323 3324 /* go right to the MediumAttachment creation */ … … 3342 3343 const MediaData::AttachmentList &snapAtts = snap->getSnapshotMachine()->mMediaData->mAttachments; 3343 3344 3344 Medi aData::AttachmentList::const_iterator foundIt = snapAtts.end();3345 MediumAttachment *pAttachFound = NULL; 3345 3346 uint32_t foundLevel = 0; 3346 3347 … … 3363 3364 * descendant of medium will be used 3364 3365 */ 3365 if ( (*it)->getDevice() == aDevice3366 && (*it)->getPort() == aControllerPort3367 && (*it)->getControllerName() == aControllerName3366 if ( pAttach->getDevice() == aDevice 3367 && pAttach->getPort() == aControllerPort 3368 && pAttach->getControllerName() == aControllerName 3368 3369 ) 3369 3370 { 3370 foundIt = it;3371 pAttachFound = pAttach; 3371 3372 break; 3372 3373 } 3373 else if ( foundIt == snapAtts.end()3374 else if ( !pAttachFound 3374 3375 || level > foundLevel /* prefer younger */ 3375 3376 ) 3376 3377 { 3377 foundIt = it;3378 pAttachFound = pAttach; 3378 3379 foundLevel = level; 3379 3380 } … … 3381 3382 } 3382 3383 3383 if ( foundIt != snapAtts.end())3384 if (pAttachFound) 3384 3385 { 3385 base = (*foundIt)->getMedium();3386 base = pAttachFound->getMedium(); 3386 3387 break; 3387 3388 } … … 3469 3470 aDevice, 3470 3471 aType, 3471 fI mplicit,3472 fIndirect, 3472 3473 0 /* No bandwidth limit */); 3473 3474 if (FAILED(rc)) return rc;
Note:
See TracChangeset
for help on using the changeset viewer.