VirtualBox

Changeset 41096 in vbox


Ignore:
Timestamp:
Apr 30, 2012 10:28:59 AM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
77685
Message:

VBoxManage: don't unpause a VM if 'controlvm savestate' failed and the VM was paused before

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageControlVM.cpp

    r40673 r41096  
    174174        {
    175175            /* first pause so we don't trigger a live save which needs more time/resources */
     176            bool fPaused = false;
    176177            rc = console->Pause();
    177178            if (FAILED(rc))
    178179            {
     180                bool fError = true;
    179181                if (rc == VBOX_E_INVALID_VM_STATE)
    180182                {
     
    184186                    /* the error code was lost by the previous instruction */
    185187                    rc = VBOX_E_INVALID_VM_STATE;
     188                    RTPrintf("machineState = %d (%d)\n", machineState, MachineState_Paused);
    186189                    if (machineState != MachineState_Paused)
    187190                    {
     
    189192                                   machineState, machineStateToName(machineState, false));
    190193                    }
    191                 }
    192                 break;
     194                    else
     195                    {
     196                        fError = false;
     197                        fPaused = true;
     198                    }
     199                }
     200                if (fError)
     201                    break;
    193202            }
    194203
     
    197206            if (FAILED(rc))
    198207            {
    199                 console->Resume();
     208                if (!fPaused)
     209                    console->Resume();
    200210                break;
    201211            }
     
    204214            CHECK_PROGRESS_ERROR(progress, ("Failed to save machine state"));
    205215            if (FAILED(rc))
    206                 console->Resume();
     216            {
     217                if (!fPaused)
     218                    console->Resume();
     219            }
    207220        }
    208221        else if (!strcmp(a->argv[1], "acpipowerbutton"))
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