VirtualBox

Changeset 24882 in vbox for trunk


Ignore:
Timestamp:
Nov 23, 2009 5:40:18 PM (15 years ago)
Author:
vboxsync
Message:

ConsoleImpl.cpp: Made IConsole::Pause() while teleporting work.

File:
1 edited

Legend:

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

    r24786 r24882  
    17251725        case MachineState_Paused:
    17261726        case MachineState_TeleportingPausedVM:
     1727        case MachineState_Saving:
    17271728            return setError(VBOX_E_INVALID_VM_STATE, tr("Already paused"));
    17281729
     
    57715772        case VMSTATE_SUSPENDED:
    57725773        {
    5773             if (aOldState == VMSTATE_SUSPENDING)
     5774            AutoWriteLock alock(that);
     5775
     5776            if (that->mVMStateChangeCallbackDisabled)
     5777                break;
     5778
     5779            switch (that->mMachineState)
    57745780            {
    5775                 AutoWriteLock alock(that);
    5776 
    5777                 if (that->mVMStateChangeCallbackDisabled)
     5781                case MachineState_Teleporting:
     5782                    that->setMachineState(MachineState_TeleportingPausedVM);
    57785783                    break;
    57795784
    5780                 /* Change the machine state from Running to Paused. */
    5781 /** @todo Live Migration: Deal with Pause happening before VMR3Teleport! */
    5782                 AssertBreak(that->mMachineState == MachineState_Running);
    5783                 that->setMachineState(MachineState_Paused);
     5785                case MachineState_LiveSnapshotting:
     5786                    that->setMachineState(MachineState_Saving);
     5787                    break;
     5788
     5789                case MachineState_TeleportingPausedVM:
     5790                case MachineState_Saving:
     5791                case MachineState_Restoring:
     5792                    /* The worker threads handles the transition. */
     5793                    break;
     5794
     5795                default:
     5796                    AssertMsgFailed(("%s\n", Global::stringifyMachineState(that->mMachineState)));
     5797                case MachineState_Running:
     5798                    that->setMachineState(MachineState_Paused);
     5799                    break;
    57845800            }
    57855801            break;
     
    57925808            if (that->mVMStateChangeCallbackDisabled)
    57935809                break;
    5794             if (that->mMachineState == MachineState_Teleporting)
    5795                 that->setMachineState(MachineState_TeleportingPausedVM);
    5796             else if (that->mMachineState == MachineState_LiveSnapshotting)
    5797                 that->setMachineState(MachineState_Saving);
    5798             else
    5799                 AssertMsgFailed(("%s/%s -> %s\n", Global::stringifyMachineState(that->mMachineState), VMR3GetStateName(aOldState),  VMR3GetStateName(aState) ));
     5810            switch (that->mMachineState)
     5811            {
     5812                case MachineState_Teleporting:
     5813                    that->setMachineState(MachineState_TeleportingPausedVM);
     5814                    break;
     5815
     5816                case MachineState_LiveSnapshotting:
     5817                    that->setMachineState(MachineState_Saving);
     5818                    break;
     5819
     5820                case MachineState_TeleportingPausedVM:
     5821                case MachineState_Saving:
     5822                    /* ignore */
     5823                    break;
     5824
     5825                default:
     5826                    AssertMsgFailed(("%s/%s -> %s\n", Global::stringifyMachineState(that->mMachineState), VMR3GetStateName(aOldState),  VMR3GetStateName(aState) ));
     5827                    that->setMachineState(MachineState_Paused);
     5828                    break;
     5829            }
    58005830            break;
    58015831        }
Note: See TracChangeset for help on using the changeset viewer.

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