Changeset 12889 in vbox for trunk/src/VBox/Main/ConsoleImpl.cpp
- Timestamp:
- Oct 2, 2008 5:20:22 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ConsoleImpl.cpp
r12523 r12889 186 186 VMPowerUpTask (Console *aConsole, Progress *aProgress) 187 187 : VMProgressTask (aConsole, aProgress, false /* aUsesVMPtr */) 188 , mSetVMErrorCallback (NULL), mConfigConstructor (NULL) {}188 , mSetVMErrorCallback (NULL), mConfigConstructor (NULL), mStartPaused (false) {} 189 189 190 190 PFNVMATERROR mSetVMErrorCallback; … … 192 192 Utf8Str mSavedStateFile; 193 193 Console::SharedFolderDataMap mSharedFolders; 194 bool mStartPaused; 194 195 }; 195 196 … … 621 622 hrc = mVRDPServer->COMGETTER(AllowMultiConnection) (&allowMultiConnection); 622 623 AssertComRCReturn (hrc, VERR_ACCESS_DENIED); 623 624 624 625 BOOL reuseSingleConnection = FALSE; 625 626 hrc = mVRDPServer->COMGETTER(ReuseSingleConnection) (&reuseSingleConnection); … … 1191 1192 1192 1193 STDMETHODIMP Console::PowerUp (IProgress **aProgress) 1194 { 1195 return powerUpCommon (aProgress, false /* aPaused */); 1196 } 1197 1198 STDMETHODIMP Console::PowerUpPaused (IProgress **aProgress) 1199 { 1200 return powerUpCommon (aProgress, true /* aPaused */); 1201 } 1202 1203 /** 1204 * Common worker for PowerUp and PowerUpPaused. 1205 * 1206 * @returns COM status code. 1207 * 1208 * @param aProgress Where to return the progress object. 1209 * @param aPaused true if PowerUpPaused called. 1210 * 1211 * @todo move down to powerDown(); 1212 */ 1213 HRESULT Console::powerUpCommon (IProgress **aProgress, bool aPaused) 1193 1214 { 1194 1215 LogFlowThisFuncEnter(); … … 1397 1418 task->mConfigConstructor = configConstructor; 1398 1419 task->mSharedFolders = sharedFolders; 1420 task->mStartPaused = aPaused; 1399 1421 if (mMachineState == MachineState_Saved) 1400 1422 task->mSavedStateFile = savedStateFile; … … 1544 1566 alock.leave(); 1545 1567 1546 int vrc = VMR3Resume (mpVM); 1568 int vrc; 1569 if (VMR3GetState(mpVM) == VMSTATE_CREATED) 1570 vrc = VMR3PowerOn (mpVM); /* (PowerUpPaused) */ 1571 else 1572 vrc = VMR3Resume (mpVM); 1547 1573 1548 1574 HRESULT rc = VBOX_SUCCESS (vrc) ? S_OK : … … 5161 5187 * to Running 5162 5188 */ 5163 Assert ((that->mMachineState == MachineState_Starting && 5164 aOldState == VMSTATE_CREATED) || 5165 ((that->mMachineState == MachineState_Restoring || 5166 that->mMachineState == MachineState_Paused) && 5167 aOldState == VMSTATE_SUSPENDED)); 5189 Assert ( ( ( that->mMachineState == MachineState_Starting 5190 || that->mMachineState == MachineState_Paused) 5191 && aOldState == VMSTATE_CREATED) 5192 || ( ( that->mMachineState == MachineState_Restoring 5193 || that->mMachineState == MachineState_Paused) 5194 && aOldState == VMSTATE_SUSPENDED)); 5168 5195 5169 5196 that->setMachineState (MachineState_Running); … … 6373 6400 static_cast <VMProgressTask *> (task.get())); 6374 6401 6375 /* Start/Resume the VM execution */6376 6402 if (VBOX_SUCCESS (vrc)) 6377 6403 { 6378 vrc = VMR3Resume (pVM); 6379 AssertRC (vrc); 6404 if (task->mStartPaused) 6405 /* done */ 6406 console->setMachineState (MachineState_Paused); 6407 else 6408 { 6409 /* Start/Resume the VM execution */ 6410 vrc = VMR3Resume (pVM); 6411 AssertRC (vrc); 6412 } 6380 6413 } 6381 6414 … … 6387 6420 } 6388 6421 } 6422 else if (task->mStartPaused) 6423 /* done */ 6424 console->setMachineState (MachineState_Paused); 6389 6425 else 6390 6426 {
Note:
See TracChangeset
for help on using the changeset viewer.