Changeset 35481 in vbox for trunk/src/VBox/Main/src-client
- Timestamp:
- Jan 11, 2011 12:40:24 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 69356
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r35460 r35481 241 241 { 242 242 VMPowerDownTask(Console *aConsole, 243 const ComPtr<IProgress> &aServerProgress, 244 MachineState_T aLastMachineState) 243 const ComPtr<IProgress> &aServerProgress) 244 : VMTask(aConsole, NULL /* aProgress */, aServerProgress, 245 true /* aUsesVMPtr */) 246 {} 247 }; 248 249 struct VMSaveTask : public VMTask 250 { 251 VMSaveTask(Console *aConsole, 252 const ComPtr<IProgress> &aServerProgress, 253 const Utf8Str &aSavedStateFile) 245 254 : VMTask(aConsole, NULL /* aProgress */, aServerProgress, 246 255 true /* aUsesVMPtr */), 247 m LastMachineState(aLastMachineState)256 mSavedStateFile(aSavedStateFile) 248 257 {} 249 258 250 MachineState_T mLastMachineState;251 };252 253 struct VMSaveTask : public VMTask254 {255 VMSaveTask(Console *aConsole,256 const ComPtr<IProgress> &aServerProgress,257 const Utf8Str &aSavedStateFile,258 MachineState_T aLastMachineState)259 : VMTask(aConsole, NULL /* aProgress */, aServerProgress,260 true /* aUsesVMPtr */),261 mSavedStateFile(aSavedStateFile),262 mLastMachineState(aLastMachineState)263 {}264 265 259 Utf8Str mSavedStateFile; 266 MachineState_T mLastMachineState;267 260 }; 268 261 … … 1821 1814 1822 1815 /* setup task object and thread to carry out the operation asynchronously */ 1823 std::auto_ptr<VMPowerDownTask> task(new VMPowerDownTask(this, pProgress, 1824 lastMachineState)); 1816 std::auto_ptr<VMPowerDownTask> task(new VMPowerDownTask(this, pProgress)); 1825 1817 AssertBreakStmt(task->isOk(), rc = E_FAIL); 1826 1818 … … 2468 2460 /* create a task object early to ensure mpVM protection is successful */ 2469 2461 std::auto_ptr<VMSaveTask> task(new VMSaveTask(this, pProgress, 2470 stateFilePath, 2471 lastMachineState)); 2462 stateFilePath)); 2472 2463 rc = task->rc(); 2473 2464 /* … … 6446 6437 that->mVMPoweredOff = true; 6447 6438 6448 /* we are stopping now */ 6449 that->setMachineState(MachineState_Stopping); 6439 /* 6440 * request a progress object from the server 6441 * (this will set the machine state to Stopping on the server 6442 * to block others from accessing this machine) 6443 */ 6444 ComPtr<IProgress> pProgress; 6445 HRESULT rc = that->mControl->BeginPoweringDown(pProgress.asOutParam()); 6446 AssertComRC(rc); 6447 6448 /* sync the state with the server */ 6449 that->setMachineStateLocally(MachineState_Stopping); 6450 6450 6451 6451 /* Setup task object and thread to carry out the operation … … 6455 6455 */ 6456 6456 std::auto_ptr<VMPowerDownTask> task(new VMPowerDownTask(that, 6457 NULL /* aServerProgress */, 6458 MachineState_Null)); 6457 pProgress)); 6459 6458 6460 6459 /* If creating a task failed, this can currently mean one of
Note:
See TracChangeset
for help on using the changeset viewer.