Changeset 31706 in vbox for trunk/src/VBox/Main
- Timestamp:
- Aug 16, 2010 3:27:24 PM (14 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ConsoleImpl.cpp
r31698 r31706 215 215 mConfigConstructor(NULL), 216 216 mStartPaused(false), 217 mTeleporterEnabled(FALSE) 217 mTeleporterEnabled(FALSE), 218 mFaultToleranceSyncEnabled(FALSE) 218 219 {} 219 220 … … 223 224 bool mStartPaused; 224 225 BOOL mTeleporterEnabled; 226 BOOL mFaultToleranceSyncEnabled; 225 227 226 228 /* array of progress objects for hard disk reset operations */ … … 1662 1664 } 1663 1665 return setError(VBOX_E_INVALID_VM_STATE, tr("Cannot power down at this point in a live snapshot")); 1666 1667 /* Try cancel the FT sync. */ 1668 case MachineState_FaultTolerantSyncing: 1669 if (!mptrCancelableProgress.isNull()) 1670 { 1671 HRESULT hrc = mptrCancelableProgress->Cancel(); 1672 if (SUCCEEDED(hrc)) 1673 break; 1674 } 1675 return setError(VBOX_E_INVALID_VM_STATE, tr("Cannot power down at this point in a fault tolerant sync")); 1664 1676 1665 1677 /* extra nice error message for a common case */ … … 5200 5212 #endif 5201 5213 5214 /* test the FaultToleranceState property */ 5215 FaultToleranceState_T enmFaultToleranceState; 5216 rc = mMachine->COMGETTER(FaultToleranceState)(&enmFaultToleranceState); 5217 if (FAILED(rc)) return rc; 5218 BOOL fFaultToleranceSyncEnabled = (enmFaultToleranceState == FaultToleranceState_Target); 5219 5202 5220 /* create a progress object to track progress of this operation */ 5203 5221 ComObjPtr<Progress> powerupProgress; … … 5208 5226 else if (fTeleporterEnabled) 5209 5227 progressDesc = tr("Teleporting virtual machine"); 5228 else if (fFaultToleranceSyncEnabled) 5229 progressDesc = tr("Fault Tolerance syncing of remote virtual machine"); 5210 5230 else 5211 5231 progressDesc = tr("Starting virtual machine"); 5212 if (mMachineState == MachineState_Saved || !fTeleporterEnabled) 5232 if ( mMachineState == MachineState_Saved 5233 || !fTeleporterEnabled) 5213 5234 rc = powerupProgress->init(static_cast<IConsole *>(this), 5214 5235 progressDesc, 5215 5236 FALSE /* aCancelable */); 5216 5237 else 5238 if (fTeleporterEnabled) 5217 5239 rc = powerupProgress->init(static_cast<IConsole *>(this), 5218 5240 progressDesc, … … 5223 5245 1 /* ulFirstOperationWeight */, 5224 5246 NULL); 5247 else 5248 if (fFaultToleranceSyncEnabled) 5249 rc = powerupProgress->init(static_cast<IConsole *>(this), 5250 progressDesc, 5251 TRUE /* aCancelable */, 5252 3 /* cOperations */, 5253 10 /* ulTotalOperationsWeight */, 5254 Bstr(tr("Fault Tolerance syncing of remote virtual machine")), 5255 1 /* ulFirstOperationWeight */, 5256 NULL); 5257 5225 5258 if (FAILED(rc)) 5226 5259 return rc; … … 5260 5293 task->mSavedStateFile = savedStateFile; 5261 5294 task->mTeleporterEnabled = fTeleporterEnabled; 5295 task->mFaultToleranceSyncEnabled = fFaultToleranceSyncEnabled; 5262 5296 5263 5297 /* Reset differencing hard disks for which autoReset is true, … … 5364 5398 else if (fTeleporterEnabled) 5365 5399 setMachineState(MachineState_TeleportingIn); 5400 else if (enmFaultToleranceState == FaultToleranceState_Target) 5401 setMachineState(MachineState_FaultTolerantSyncing); 5366 5402 else 5367 5403 setMachineState(MachineState_Starting); … … 5431 5467 || mMachineState == MachineState_Restoring 5432 5468 || mMachineState == MachineState_TeleportingPausedVM 5469 || mMachineState == MachineState_FaultTolerantSyncing 5433 5470 || mMachineState == MachineState_TeleportingIn 5434 5471 , ("Invalid machine state: %s\n", Global::stringifyMachineState(mMachineState))); … … 5445 5482 && ( mMachineState == MachineState_Starting 5446 5483 || mMachineState == MachineState_Restoring 5484 || mMachineState == MachineState_FaultTolerantSyncing 5447 5485 || mMachineState == MachineState_TeleportingIn) 5448 5486 ) … … 5463 5501 && mMachineState != MachineState_TeleportingIn 5464 5502 && mMachineState != MachineState_TeleportingPausedVM 5503 && mMachineState != MachineState_FaultTolerantSyncing 5465 5504 ) 5466 5505 setMachineState(MachineState_Stopping); … … 6086 6125 && that->mMachineState != MachineState_Restoring 6087 6126 && that->mMachineState != MachineState_TeleportingIn 6127 && that->mMachineState != MachineState_FaultTolerantSyncing 6088 6128 && that->mMachineState != MachineState_TeleportingPausedVM 6089 6129 && !that->mVMIsAlreadyPoweringOff … … 6190 6230 that->setMachineState(MachineState_Teleported); 6191 6231 break; 6232 case MachineState_FaultTolerantSyncing: 6233 /* Fault tolerant sync failed or was canceled. Back to powered off. */ 6234 that->setMachineState(MachineState_PoweredOff); 6235 break; 6192 6236 } 6193 6237 break; … … 6216 6260 case MachineState_Stopping: 6217 6261 case MachineState_TeleportingIn: 6218 /* The worker thread shandles the transition. */6262 /* The worker thread handles the transition. */ 6219 6263 break; 6220 6264 … … 6260 6304 { 6261 6305 if ( aOldState == VMSTATE_POWERING_ON 6262 || aOldState == VMSTATE_RESUMING) 6306 || aOldState == VMSTATE_RESUMING 6307 || aOldState == VMSTATE_RUNNING_FT) 6263 6308 { 6264 6309 AutoWriteLock alock(that COMMA_LOCKVAL_SRC_POS); … … 6275 6320 || that->mMachineState == MachineState_Saving 6276 6321 ) 6277 && aOldState == VMSTATE_RESUMING)); 6322 && aOldState == VMSTATE_RESUMING) 6323 || ( that->mMachineState == MachineState_FaultTolerantSyncing 6324 && aOldState == VMSTATE_RUNNING_FT)); 6278 6325 6279 6326 that->setMachineState(MachineState_Running); … … 6286 6333 AssertMsg( that->mMachineState == MachineState_LiveSnapshotting 6287 6334 || that->mMachineState == MachineState_Teleporting, 6335 ("%s/%s -> %s\n", Global::stringifyMachineState(that->mMachineState), VMR3GetStateName(aOldState), VMR3GetStateName(aState) )); 6336 break; 6337 6338 case VMSTATE_RUNNING_FT: 6339 AssertMsg(that->mMachineState == MachineState_FaultTolerantSyncing, 6288 6340 ("%s/%s -> %s\n", Global::stringifyMachineState(that->mMachineState), VMR3GetStateName(aOldState), VMR3GetStateName(aState) )); 6289 6341 break; … … 7220 7272 * SessionMachine::setMachineState() when the VM is powered down. 7221 7273 */ 7222 if (!task->mTeleporterEnabled) 7274 if ( !task->mTeleporterEnabled 7275 && !task->mFaultToleranceSyncEnabled) 7223 7276 { 7224 7277 rc = console->mControl->LockMedia(); -
trunk/src/VBox/Main/ConsoleImpl2.cpp
r31701 r31706 2946 2946 * make DrvVD undo TempReadOnly. It gets interesting if we fail after 2947 2947 * that. Grumble. */ 2948 else if (aMachineState == MachineState_TeleportingIn) 2948 else if ( aMachineState == MachineState_TeleportingIn 2949 || aMachineState == MachineState_FaultTolerantSyncing) 2949 2950 { 2950 2951 InsertConfigInteger(pCfg, "TempReadOnly", 1); -
trunk/src/VBox/Main/MachineImpl.cpp
r31698 r31706 2592 2592 2593 2593 /* @todo deal with running state change. */ 2594 HRESULT rc = checkStateDependency(MutableStateDep); 2595 if (FAILED(rc)) return rc; 2594 2596 2595 2597 setModified(IsModified_MachineData);
Note:
See TracChangeset
for help on using the changeset viewer.