Changeset 38264 in vbox for trunk/src/VBox/Main/src-server
- Timestamp:
- Aug 1, 2011 2:23:57 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/MachineImplCloneVM.cpp
r38153 r38264 954 954 /* Current state is under root snapshot. */ 955 955 trgMCF.uuidCurrentSnapshot = sn.uuid; 956 /* There will be created a new differencing image based on this 957 * snapshot. So reset the modified state. */ 958 trgMCF.fCurrentStateModified = false; 956 959 } 957 960 /* The snapshot will be the root one. */ … … 972 975 trgMCF.machineUserData.strSnapshotFolder = "Snapshots"; 973 976 trgMCF.strStateFile = ""; 974 /* Force writing of setting file. */975 trgMCF.fCurrentStateModified = true;976 977 /* Set the new name. */ 977 978 const Utf8Str strOldVMName = trgMCF.machineUserData.strName; … … 1289 1290 &d->pTrgMachine->mData->mUuid); 1290 1291 if (FAILED(rc)) throw rc; 1291 } 1292 1293 /* Now save the new configuration to disk. */ 1294 rc = d->pTrgMachine->SaveSettings(); 1295 if (FAILED(rc)) throw rc; 1296 trgLock.release(); 1292 /* save all VM data */ 1293 bool fNeedsGlobalSaveSettings = false; 1294 rc = d->pTrgMachine->saveSettings(&fNeedsGlobalSaveSettings, Machine::SaveS_Force); 1295 if (FAILED(rc)) throw rc; 1296 /* Release all locks */ 1297 trgLock.release(); 1298 srcLock.release(); 1299 if (fNeedsGlobalSaveSettings) 1300 { 1301 /* save the global settings; for that we should hold only the 1302 * VirtualBox lock */ 1303 AutoWriteLock vlock(p->mParent COMMA_LOCKVAL_SRC_POS); 1304 rc = p->mParent->saveSettings(); 1305 if (FAILED(rc)) throw rc; 1306 } 1307 } 1308 1309 /* Any additional machines need saving? */ 1297 1310 if (!llRegistriesThatNeedSaving.empty()) 1298 1311 { 1299 srcLock.release();1300 1312 rc = p->mParent->saveRegistries(llRegistriesThatNeedSaving); 1301 1313 if (FAILED(rc)) throw rc;
Note:
See TracChangeset
for help on using the changeset viewer.