Changeset 37523 in vbox for trunk/src/VBox
- Timestamp:
- Jun 17, 2011 9:16:57 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/MachineImplCloneVM.cpp
r37522 r37523 237 237 try 238 238 { 239 /* Handle the special case that someone is requesting a _full_ clone 240 * with all snapshots (and the current state), but uses a snapshot 241 * machine (and not the current one) as source machine. In this case we 242 * just replace the source (snapshot) machine with the current machine. */ 243 if ( d->mode == CloneMode_AllStates 244 && d->pSrcMachine->isSnapshotMachine()) 245 { 246 Bstr bstrSrcMachineId; 247 rc = d->pSrcMachine->COMGETTER(Id)(bstrSrcMachineId.asOutParam()); 248 if (FAILED(rc)) throw rc; 249 ComPtr<IMachine> newSrcMachine; 250 rc = d->pSrcMachine->getVirtualBox()->FindMachine(bstrSrcMachineId.raw(), newSrcMachine.asOutParam()); 251 if (FAILED(rc)) throw rc; 252 d->pSrcMachine = (Machine*)(IMachine*)newSrcMachine; 253 } 254 239 255 /* Lock the target machine early (so nobody mess around with it in the meantime). */ 240 256 AutoWriteLock trgLock(d->pTrgMachine COMMA_LOCKVAL_SRC_POS); … … 248 264 249 265 /* Include current state? */ 250 if ( d->mode == CloneMode_MachineState )251 //|| d->mode == CloneMode_AllStates)266 if ( d->mode == CloneMode_MachineState 267 || d->mode == CloneMode_AllStates) 252 268 machineList.append(d->pSrcMachine); 253 269 /* Should be done a depth copy with all child snapshots? */ … … 269 285 rc = d->cloneCreateMachineList(pSnapshot, machineList); 270 286 if (FAILED(rc)) throw rc; 271 rc = pSnapshot->COMGETTER(Machine)(d->pOldMachineState.asOutParam()); 272 if (FAILED(rc)) throw rc; 287 if (d->mode == CloneMode_MachineAndChildStates) 288 { 289 rc = pSnapshot->COMGETTER(Machine)(d->pOldMachineState.asOutParam()); 290 if (FAILED(rc)) throw rc; 291 } 273 292 } 274 293 }
Note:
See TracChangeset
for help on using the changeset viewer.