Changeset 38718 in vbox for trunk/src/VBox/Main/src-server
- Timestamp:
- Sep 12, 2011 3:56:52 PM (13 years ago)
- Location:
- trunk/src/VBox/Main/src-server
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/MediumAttachmentImpl.cpp
r37824 r38718 65 65 struct MediumAttachment::Data 66 66 { 67 Data( )68 : pMachine( NULL),67 Data(Machine * const aMachine = NULL) 68 : pMachine(aMachine), 69 69 fIsEjected(false) 70 70 { } … … 166 166 167 167 /** 168 * Initializes the medium attachment object given another guest object 169 * (a kind of copy constructor). This object makes a private copy of data 170 * of the original object passed as an argument. 171 */ 172 HRESULT MediumAttachment::initCopy(Machine *aParent, MediumAttachment *aThat) 173 { 174 LogFlowThisFunc(("aParent=%p, aThat=%p\n", aParent, aThat)); 175 176 ComAssertRet(aParent && aThat, E_INVALIDARG); 177 178 /* Enclose the state transition NotReady->InInit->Ready */ 179 AutoInitSpan autoInitSpan(this); 180 AssertReturn(autoInitSpan.isOk(), E_FAIL); 181 182 m = new Data(aParent); 183 /* m->pPeer is left null */ 184 185 AutoCaller thatCaller(aThat); 186 AssertComRCReturnRC(thatCaller.rc()); 187 188 AutoReadLock thatlock(aThat COMMA_LOCKVAL_SRC_POS); 189 m->bd.attachCopy(aThat->m->bd); 190 191 /* Confirm a successful initialization */ 192 autoInitSpan.setSucceeded(); 193 194 return S_OK; 195 } 196 197 /** 168 198 * Uninitializes the instance. 169 199 * Called from FinalRelease(). -
trunk/src/VBox/Main/src-server/SnapshotImpl.cpp
r37985 r38718 1820 1820 setModified(IsModified_Storage); 1821 1821 mMediaData.backup(); 1822 mMediaData->mAttachments = pSnapshotMachine->mMediaData->mAttachments; 1822 mMediaData->mAttachments.clear(); 1823 for (MediaData::AttachmentList::const_iterator it = pSnapshotMachine->mMediaData->mAttachments.begin(); 1824 it != pSnapshotMachine->mMediaData->mAttachments.end(); 1825 ++it) 1826 { 1827 ComObjPtr<MediumAttachment> pAttach; 1828 pAttach.createObject(); 1829 pAttach->initCopy(this, *it); 1830 mMediaData->mAttachments.push_back(pAttach); 1831 } 1823 1832 1824 1833 /* leave the locks before the potentially lengthy operation */
Note:
See TracChangeset
for help on using the changeset viewer.