Changeset 44152 in vbox
- Timestamp:
- Dec 18, 2012 3:47:08 PM (12 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r44124 r44152 6349 6349 tr("The virtual machine is already running or busy (machine state: %s)"), 6350 6350 Global::stringifyMachineState(mMachineState)); 6351 6352 /* Set up release logging as early as possible after the check if 6353 * there is already a running VM which we shouldn't disturb. */ 6354 rc = consoleInitReleaseLog(mMachine); 6355 if (FAILED(rc)) 6356 throw rc; 6351 6357 6352 6358 /* test and clear the TeleporterEnabled property */ … … 6629 6635 LogFlowThisFunc(("Machine has a current snapshot which is online, skipping immutable images reset\n")); 6630 6636 6631 rc = consoleInitReleaseLog(mMachine);6632 if (FAILED(rc))6633 throw rc;6634 6637 #ifdef VBOX_WITH_EXTPACK 6635 6638 mptrExtPackManager->dumpAllToReleaseLog(); … … 9346 9349 fBeganTakingSnapshot = true; 9347 9350 9348 /* 9349 * state file is non-null only when the VM is paused9350 * (i.e. creating a snapshot online)9351 * /9352 bool f = (!pTask->bstrSavedStateFile.isEmpty() && pTask->fTakingSnapshotOnline)9353 || ( pTask->bstrSavedStateFile.isEmpty() && !pTask->fTakingSnapshotOnline);9354 if (!f)9351 /* Check sanity: for offline snapshots there must not be a saved state 9352 * file name. All other combinations are valid (even though online 9353 * snapshots without saved state file seems inconsistent - there are 9354 * some exotic use cases, which need to be explicitly enabled, see the 9355 * code of SessionMachine::BeginTakingSnapshot. */ 9356 if ( !pTask->fTakingSnapshotOnline 9357 && !pTask->bstrSavedStateFile.isEmpty()) 9355 9358 throw setErrorStatic(E_FAIL, "Invalid state of saved state file"); 9356 9359 … … 9364 9367 if (pTask->fTakingSnapshotOnline) 9365 9368 { 9366 Utf8Str strSavedStateFile(pTask->bstrSavedStateFile); 9367 9369 int vrc; 9368 9370 SafeVMPtr ptrVM(that); 9369 9371 if (!ptrVM.isOk()) … … 9372 9374 pTask->mProgress->SetNextOperation(Bstr(tr("Saving the machine state")).raw(), 9373 9375 pTask->ulMemSize); // operation weight, same as computed when setting up progress object 9374 pTask->mProgress->setCancelCallback(takesnapshotProgressCancelCallback, ptrVM.rawUVM()); 9375 9376 alock.release(); 9377 LogFlowFunc(("VMR3Save...\n")); 9378 int vrc = VMR3Save(ptrVM, 9376 if (!pTask->bstrSavedStateFile.isEmpty()) 9377 { 9378 Utf8Str strSavedStateFile(pTask->bstrSavedStateFile); 9379 9380 pTask->mProgress->setCancelCallback(takesnapshotProgressCancelCallback, ptrVM.rawUVM()); 9381 9382 alock.release(); 9383 LogFlowFunc(("VMR3Save...\n")); 9384 vrc = VMR3Save(ptrVM, 9379 9385 strSavedStateFile.c_str(), 9380 9386 true /*fContinueAfterwards*/, … … 9382 9388 static_cast<IProgress *>(pTask->mProgress), 9383 9389 &fSuspenededBySave); 9384 alock.acquire(); 9385 if (RT_FAILURE(vrc)) 9386 throw setErrorStatic(E_FAIL, 9387 tr("Failed to save the machine state to '%s' (%Rrc)"), 9388 strSavedStateFile.c_str(), vrc); 9389 9390 pTask->mProgress->setCancelCallback(NULL, NULL); 9390 alock.acquire(); 9391 if (RT_FAILURE(vrc)) 9392 throw setErrorStatic(E_FAIL, 9393 tr("Failed to save the machine state to '%s' (%Rrc)"), 9394 strSavedStateFile.c_str(), vrc); 9395 9396 pTask->mProgress->setCancelCallback(NULL, NULL); 9397 } 9398 else 9399 LogRel(("Console: skipped saving state as part of online snapshot\n")); 9400 9391 9401 if (!pTask->mProgress->notifyPointOfNoReturn()) 9392 9402 throw setErrorStatic(E_FAIL, tr("Canceled")); -
trunk/src/VBox/Main/src-server/SnapshotImpl.cpp
r44041 r44152 1440 1440 /* stateFilePath is null when the machine is not online nor saved */ 1441 1441 if (fTakingSnapshotOnline) 1442 // creating a new online snapshot: then we need a fresh saved state file 1443 composeSavedStateFilename(strStateFilePath); 1442 { 1443 Bstr value; 1444 HRESULT rc = GetExtraData(Bstr("VBoxInternal2/ForceTakeSnapshotWithoutState").raw(), 1445 value.asOutParam()); 1446 if (FAILED(rc) || value != "1") 1447 { 1448 // creating a new online snapshot: we need a fresh saved state file 1449 composeSavedStateFilename(strStateFilePath); 1450 } 1451 } 1444 1452 else if (mData->mMachineState == MachineState_Saved) 1445 1453 // taking an online snapshot from machine in "saved" state: then use existing state file
Note:
See TracChangeset
for help on using the changeset viewer.