- Timestamp:
- Oct 2, 2008 5:20:22 AM (16 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 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 { -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r12668 r12889 4237 4237 <interface 4238 4238 name="IConsole" extends="$unknown" 4239 uuid=" d5a1cbda-f5d7-4824-9afe-d640c94c7dcf"4239 uuid="3acbd337-925f-497d-a624-465c8a99ae5a" 4240 4240 wsmap="managed" 4241 4241 > … … 4386 4386 4387 4387 <see>#saveState</see> 4388 </desc> 4389 <param name="progress" type="IProgress" dir="return"> 4390 <desc>Progress object to track the operation completion.</desc> 4391 </param> 4392 </method> 4393 4394 <method name="powerUpPaused"> 4395 <desc> 4396 Identical to powerUp save that the VM will enter the 4397 <link to="MachineState::Paused"/> state, instead of 4398 <link to="MachineState::Running"/>. 4399 4400 <see>#powerUp</see> 4388 4401 </desc> 4389 4402 <param name="progress" type="IProgress" dir="return"> -
trunk/src/VBox/Main/include/ConsoleImpl.h
r12126 r12889 125 125 // IConsole methods 126 126 STDMETHOD(PowerUp) (IProgress **aProgress); 127 STDMETHOD(PowerUpPaused) (IProgress **aProgress); 127 128 STDMETHOD(PowerDown)(); 128 129 STDMETHOD(Reset)(); … … 398 399 HRESULT consoleInitReleaseLog (const ComPtr <IMachine> aMachine); 399 400 401 HRESULT powerUpCommon (IProgress **aProgress, bool aPaused); 400 402 HRESULT powerDown(); 401 403
Note:
See TracChangeset
for help on using the changeset viewer.