VirtualBox

Changeset 23671 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Oct 10, 2009 3:19:04 AM (15 years ago)
Author:
vboxsync
Message:

Main: Some more live migration bits.

File:
1 edited

Legend:

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

    r23669 r23671  
    376376    if (RT_FAILURE(vrc))
    377377        return setError(E_FAIL, tr("Failed to read welcome message: %Rrc"), vrc);
    378     if (!strcmp(szLine, g_szWelcome))
     378    if (strcmp(szLine, g_szWelcome))
    379379        return setError(E_FAIL, tr("Unexpected welcome '%s'"), szLine);
    380380
     
    434434    pState->mptrProgress->notifyComplete(hrc);
    435435
    436     if (    FAILED(hrc)
    437         &&  pState->mptrConsole->mMachineState == MachineState_Saving)
     436    AutoWriteLock autoLock(pState->mptrConsole);
     437    if (pState->mptrConsole->mMachineState == MachineState_Saving)
    438438    {
    439439        VMSTATE enmVMState = VMR3GetState(pState->mpVM);
    440         switch (enmVMState)
    441         {
    442             case VMSTATE_RUNNING:
    443             case VMSTATE_RUNNING_LS:
    444             case VMSTATE_DEBUGGING:
    445             case VMSTATE_DEBUGGING_LS:
    446             case VMSTATE_POWERING_OFF:
    447             case VMSTATE_POWERING_OFF_LS:
    448             case VMSTATE_RESETTING:
    449             case VMSTATE_RESETTING_LS:
    450                 pState->mptrConsole->setMachineState(MachineState_Running);
    451                 break;
    452             case VMSTATE_GURU_MEDITATION:
    453             case VMSTATE_GURU_MEDITATION_LS:
    454                 pState->mptrConsole->setMachineState(MachineState_Stuck);
    455                 break;
    456             default:
    457                 AssertMsgFailed(("%s\n", VMR3GetStateName(enmVMState)));
    458             case VMSTATE_SUSPENDED:
    459             case VMSTATE_SUSPENDED_LS:
    460             case VMSTATE_SUSPENDING:
    461             case VMSTATE_SUSPENDING_LS:
    462             case VMSTATE_SUSPENDING_EXT_LS:
     440        if (SUCCEEDED(hrc))
     441        {
     442            if (enmVMState == VMSTATE_SUSPENDED)
    463443                pState->mptrConsole->setMachineState(MachineState_Paused);
    464                 break;
     444        }
     445        else
     446        {
     447            switch (enmVMState)
     448            {
     449                case VMSTATE_RUNNING:
     450                case VMSTATE_RUNNING_LS:
     451                case VMSTATE_DEBUGGING:
     452                case VMSTATE_DEBUGGING_LS:
     453                case VMSTATE_POWERING_OFF:
     454                case VMSTATE_POWERING_OFF_LS:
     455                case VMSTATE_RESETTING:
     456                case VMSTATE_RESETTING_LS:
     457                    pState->mptrConsole->setMachineState(MachineState_Running);
     458                    break;
     459                case VMSTATE_GURU_MEDITATION:
     460                case VMSTATE_GURU_MEDITATION_LS:
     461                    pState->mptrConsole->setMachineState(MachineState_Stuck);
     462                    break;
     463                default:
     464                    AssertMsgFailed(("%s\n", VMR3GetStateName(enmVMState)));
     465                case VMSTATE_SUSPENDED:
     466                case VMSTATE_SUSPENDED_LS:
     467                case VMSTATE_SUSPENDING:
     468                case VMSTATE_SUSPENDING_LS:
     469                case VMSTATE_SUSPENDING_EXT_LS:
     470                    pState->mptrConsole->setMachineState(MachineState_Paused);
     471                    break;
     472            }
    465473        }
    466474    }
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