VirtualBox

Changeset 35481 in vbox for trunk/src/VBox/Main/src-client


Ignore:
Timestamp:
Jan 11, 2011 12:40:24 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
69356
Message:

Main/Console: fix poweroff regression introduced when moving the progress object to VBoxSVC

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/ConsoleImpl.cpp

    r35460 r35481  
    241241{
    242242    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
     249struct VMSaveTask : public VMTask
     250{
     251    VMSaveTask(Console *aConsole,
     252               const ComPtr<IProgress> &aServerProgress,
     253               const Utf8Str &aSavedStateFile)
    245254        : VMTask(aConsole, NULL /* aProgress */, aServerProgress,
    246255                 true /* aUsesVMPtr */),
    247           mLastMachineState(aLastMachineState)
     256          mSavedStateFile(aSavedStateFile)
    248257    {}
    249258
    250     MachineState_T mLastMachineState;
    251 };
    252 
    253 struct VMSaveTask : public VMTask
    254 {
    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 
    265259    Utf8Str mSavedStateFile;
    266     MachineState_T mLastMachineState;
    267260};
    268261
     
    18211814
    18221815        /* 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));
    18251817        AssertBreakStmt(task->isOk(), rc = E_FAIL);
    18261818
     
    24682460        /* create a task object early to ensure mpVM protection is successful */
    24692461        std::auto_ptr<VMSaveTask> task(new VMSaveTask(this, pProgress,
    2470                                                       stateFilePath,
    2471                                                       lastMachineState));
     2462                                                      stateFilePath));
    24722463        rc = task->rc();
    24732464        /*
     
    64466437                that->mVMPoweredOff = true;
    64476438
    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);
    64506450
    64516451                /* Setup task object and thread to carry out the operation
     
    64556455                 */
    64566456                std::auto_ptr<VMPowerDownTask> task(new VMPowerDownTask(that,
    6457                                                                         NULL /* aServerProgress */,
    6458                                                                         MachineState_Null));
     6457                                                                        pProgress));
    64596458
    64606459                 /* If creating a task failed, this can currently mean one of
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette