Changeset 26201 in vbox
- Timestamp:
- Feb 3, 2010 3:18:26 PM (15 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/MediumImpl.cpp
r26186 r26201 3170 3170 /** 3171 3171 * Checks that this hard disk may be discarded and performs necessary state 3172 * changes. 3172 * changes. Must not be called for writethrough disks because there is nothing 3173 * to discard then. 3173 3174 * 3174 3175 * This method is to be called prior to calling the #discard() to perform … … 3196 3197 Assert(m->pVirtualBox->getMediaTreeLockHandle().isWriteLockOnCurrentThread()); 3197 3198 3198 AssertReturn(m->type == MediumType_Normal, E_FAIL); 3199 // Medium must not be writethrough at this point 3200 AssertReturn( m->type == MediumType_Normal 3201 || m->type == MediumType_Immutable, E_FAIL); 3199 3202 3200 3203 if (getChildren().size() == 0) -
trunk/src/VBox/Main/SnapshotImpl.cpp
r26186 r26201 2014 2014 Assert(pHD); 2015 2015 AutoReadLock mlock(pHD COMMA_LOCKVAL_SRC_POS); 2016 if (pHD->getType() == MediumType_Normal) 2016 2017 MediumType_T type = pHD->getType(); 2018 if (type != MediumType_Writethrough) // writethrough images are unaffected by snapshots, so do nothing for them 2017 2019 { 2020 // normal or immutable: then this will need to be discarded 2018 2021 ++ulOpCount; 2019 2022 ulTotalWeight += (ULONG)(pHD->getSize() / _1M); … … 2179 2182 Assert(pAttach->getMedium()); 2180 2183 ComObjPtr<Medium> pHD = pAttach->getMedium(); 2181 // do not lock, prepareDiscared() has a write lock which will hang otherwise 2184 2185 { 2186 // writethrough images are unaffected by snapshots, so do nothing for them 2187 AutoReadLock medlock(pHD COMMA_LOCKVAL_SRC_POS); 2188 MediumType_T type = pHD->getType(); 2189 if (type == MediumType_Writethrough) 2190 continue; 2191 } 2192 2193 // image is normal or immutable: then this will need to be discarded 2194 2195 // do not lock medium now, prepareDiscard() has a write lock which will hang otherwise 2182 2196 2183 2197 #ifdef DEBUG
Note:
See TracChangeset
for help on using the changeset viewer.