VirtualBox

Changeset 91363 in vbox


Ignore:
Timestamp:
Sep 24, 2021 1:08:32 PM (3 years ago)
Author:
vboxsync
Message:

FE/VBoxSDL+VirtualBox,Main/Console+Machine+VirtualBox.xidl: VMs which
crash while restoring from the 'Saved' state shouldn't lose their saved
state file. bugref:1484

A new machine state named 'AbortedSaved' has been added which a VM will
enter if it crashes when restoring from the 'Saved' state before the
'Running' state has been reached. A VM in the 'AbortedSaved' machine
state will have its saved state file preserved so that the VM can still be
restored once the cause of the failure to powerUp() and reach the
'Running' state has been resolved.

Location:
trunk/src/VBox
Files:
28 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxAutostart/VBoxAutostartUtils.cpp

    r83797 r91363  
    4848        case MachineState_Aborted:
    4949            return "aborted";
     50        case MachineState_AbortedSaved:
     51            return "aborted-saved";
    5052        case MachineState_Running:
    5153            return "running";
  • trunk/src/VBox/Frontends/VBoxBalloonCtrl/VBoxModAPIMonitor.cpp

    r83798 r91363  
    137137        case MachineState_Saved:
    138138            return "saved";
     139        case MachineState_Teleported:
     140            return "teleported";
    139141        case MachineState_Aborted:
    140142            return "aborted";
    141         case MachineState_Teleported:
    142             return "teleported";
     143        case MachineState_AbortedSaved:
     144            return "aborted-saved";
    143145        case MachineState_Running:
    144146            return "running";
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp

    r91326 r91363  
    157157        case MachineState_Aborted:
    158158            return "aborted";
     159        case MachineState_AbortedSaved:
     160            return "aborted-saved";
    159161        case MachineState_Running:
    160162            return "running";
  • trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp

    r86650 r91363  
    480480                if (     machineState == MachineState_Aborted
    481481                         ||   machineState == MachineState_Teleported
    482                          ||  (machineState == MachineState_Saved      && !m_fIgnorePowerOffEvents)
    483                          ||  (machineState == MachineState_PoweredOff && !m_fIgnorePowerOffEvents)
     482                         ||  (machineState == MachineState_Saved        && !m_fIgnorePowerOffEvents)
     483                         ||  (machineState == MachineState_AbortedSaved && !m_fIgnorePowerOffEvents)
     484                         ||  (machineState == MachineState_PoweredOff   && !m_fIgnorePowerOffEvents)
    484485                         )
    485486                {
     
    615616            case MachineState_Teleported:           return "Teleported";
    616617            case MachineState_Aborted:              return "Aborted";
     618            case MachineState_AbortedSaved:         return "Aborted-Saved";
    617619            case MachineState_Running:              return "Running";
    618620            case MachineState_Teleporting:          return "Teleporting";
     
    18921894        MachineState_T machineState;
    18931895        gpMachine->COMGETTER(State)(&machineState);
    1894         if (machineState == MachineState_Saved)
     1896        if (machineState == MachineState_Saved || machineState == MachineState_AbortedSaved)
    18951897        {
    18961898            CHECK_ERROR(gpMachine, DiscardSavedState(true /* fDeleteFile */));
     
    30793081     */
    30803082    if (   gpMachine
    3081         && machineState != MachineState_Saved)
     3083        && machineState != MachineState_Saved
     3084        && machineState != MachineState_AbortedSaved)
    30823085    {
    30833086        rc = gpMachine->DiscardSettings();
  • trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendCOM.cpp

    r89549 r91363  
    9999        case KMachineState_PoweredOff:             return QColor(Qt::gray);
    100100        case KMachineState_Saved:                  return QColor(Qt::yellow);
     101        case KMachineState_Teleported:             return QColor(Qt::red);
    101102        case KMachineState_Aborted:                return QColor(Qt::darkRed);
    102         case KMachineState_Teleported:             return QColor(Qt::red);
     103        case KMachineState_AbortedSaved:           return QColor(Qt::yellow);
    103104        case KMachineState_Running:                return QColor(Qt::green);
    104105        case KMachineState_Paused:                 return QColor(Qt::darkGreen);
     
    135136        case KMachineState_PoweredOff:             return UIIconPool::iconSet(":/state_powered_off_16px.png");
    136137        case KMachineState_Saved:                  return UIIconPool::iconSet(":/state_saved_16px.png");
     138        case KMachineState_Teleported:             return UIIconPool::iconSet(":/state_saved_16px.png");
    137139        case KMachineState_Aborted:                return UIIconPool::iconSet(":/state_aborted_16px.png");
    138         case KMachineState_Teleported:             return UIIconPool::iconSet(":/state_saved_16px.png");
     140        case KMachineState_AbortedSaved:           return UIIconPool::iconSet(":/state_saved_16px.png");
    139141        case KMachineState_Running:                return UIIconPool::iconSet(":/state_running_16px.png");
    140142        case KMachineState_Paused:                 return UIIconPool::iconSet(":/state_paused_16px.png");
     
    171173        case KMachineState_PoweredOff:             return QApplication::translate("UICommon", "Powered Off", "MachineState");
    172174        case KMachineState_Saved:                  return QApplication::translate("UICommon", "Saved", "MachineState");
     175        case KMachineState_Teleported:             return QApplication::translate("UICommon", "Teleported", "MachineState");
    173176        case KMachineState_Aborted:                return QApplication::translate("UICommon", "Aborted", "MachineState");
    174         case KMachineState_Teleported:             return QApplication::translate("UICommon", "Teleported", "MachineState");
     177        case KMachineState_AbortedSaved:           return QApplication::translate("UICommon", "Aborted-Saved", "MachineState");
    175178        case KMachineState_Running:                return QApplication::translate("UICommon", "Running", "MachineState");
    176179        case KMachineState_Paused:                 return QApplication::translate("UICommon", "Paused", "MachineState");
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.cpp

    r91341 r91363  
    13011301                  || enmState == KMachineState_Teleported
    13021302                  || enmState == KMachineState_Aborted
     1303                  || enmState == KMachineState_AbortedSaved
    13031304                  , ("Machine must be PoweredOff/Saved/Teleported/Aborted (%d)", enmState));
    13041305    }
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp

    r91104 r91363  
    24982498                  || enmState == KMachineState_Teleported
    24992499                  || enmState == KMachineState_Aborted
     2500                  || enmState == KMachineState_AbortedSaved
    25002501                  , ("Machine must be PoweredOff/Saved/Teleported/Aborted (%d)", enmState));
    25012502    }
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualMachineItemLocal.cpp

    r91125 r91363  
    9797            || m_enmMachineState == KMachineState_Teleported
    9898            || m_enmMachineState == KMachineState_Aborted
     99            || m_enmMachineState == KMachineState_AbortedSaved
    99100           )
    100101        {
     
    184185{
    185186    return    accessible()
    186            && machineState() == KMachineState_Saved;
     187           && (   machineState() == KMachineState_Saved
     188               || machineState() == KMachineState_AbortedSaved);
    187189}
    188190
     
    193195               || machineState() == KMachineState_Saved
    194196               || machineState() == KMachineState_Teleported
    195                || machineState() == KMachineState_Aborted);
     197               || machineState() == KMachineState_Aborted
     198               || machineState() == KMachineState_AbortedSaved);
    196199}
    197200
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemMachine.cpp

    r89253 r91363  
    100100           && enmState != KMachineState_Saved
    101101           && enmState != KMachineState_Teleported
    102            && enmState != KMachineState_Aborted;
     102           && enmState != KMachineState_Aborted
     103           && enmState != KMachineState_AbortedSaved;
    103104}
    104105
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIMachinePreview.cpp

    r82968 r91363  
    246246                /* If machine is in SAVED/RESTORING state: */
    247247                case KMachineState_Saved:
     248                case KMachineState_AbortedSaved:
    248249                case KMachineState_Restoring:
    249250                {
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumItem.cpp

    r91221 r91363  
    146146            continue;
    147147        if (comMachine.GetState() != KMachineState_PoweredOff &&
    148             comMachine.GetState() != KMachineState_Aborted)
     148            comMachine.GetState() != KMachineState_Aborted &&
     149            comMachine.GetState() != KMachineState_AbortedSaved)
    149150            return false;
    150151    }
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.cpp

    r91132 r91363  
    445445        return;
    446446    bool fMediumIsModifiable = true;
    447     if (state != KMachineState_Aborted && state != KMachineState_PoweredOff)
     447    if (state != KMachineState_Aborted && state != KMachineState_PoweredOff && state != KMachineState_AbortedSaved)
    448448        fMediumIsModifiable = false;
    449449    m_pDetailsWidget->enableDisableMediumModificationWidgets(fMediumIsModifiable);
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r91179 r91363  
    517517        case KMachineState_Teleported:
    518518        case KMachineState_Aborted:
     519        case KMachineState_AbortedSaved:
    519520        {
    520521            /* If not in 'manual-override' mode: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp

    r91169 r91363  
    927927        /* Processing pseudo resize-event to synchronize frame-buffer with stored framebuffer size.
    928928         * On X11 this will be additional done when the machine state was 'saved'. */
    929         if (machine().GetState() == KMachineState_Saved)
     929        if (machine().GetState() == KMachineState_Saved || machine().GetState() == KMachineState_AbortedSaved)
    930930            size = guestScreenSizeHint();
    931931#endif /* VBOX_WS_X11 */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r91169 r91363  
    175175        && !((   m_machineState == KMachineState_PoweredOff
    176176              || m_machineState == KMachineState_Aborted
     177              || m_machineState == KMachineState_AbortedSaved
    177178              || m_machineState == KMachineState_Teleported)
    178179             && machine().GetTeleporterEnabled()))
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h

    r90925 r91363  
    162162    UIVisualStateType requestedVisualState() const;
    163163
    164     bool isSaved() const { return machineState() == KMachineState_Saved; }
     164    bool isSaved() const { return machineState() == KMachineState_Saved ||
     165                                  machineState() == KMachineState_AbortedSaved; }
    165166    bool isTurnedOff() const { return machineState() == KMachineState_PoweredOff ||
    166167                                      machineState() == KMachineState_Saved ||
    167168                                      machineState() == KMachineState_Teleported ||
    168                                       machineState() == KMachineState_Aborted; }
     169                                      machineState() == KMachineState_Aborted ||
     170                                      machineState() == KMachineState_AbortedSaved; }
    169171    bool isPaused() const { return machineState() == KMachineState_Paused ||
    170172                                   machineState() == KMachineState_TeleportingPausedVM; }
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp

    r91109 r91363  
    396396
    397397            /* If previous machine-state was NOT SAVED => normalize window to the optimal-size: */
    398             if (machine().GetState() != KMachineState_Saved)
     398            if (machine().GetState() != KMachineState_Saved && machine().GetState() != KMachineState_AbortedSaved)
    399399                normalizeGeometry(false /* adjust position */, shouldResizeToGuestDisplay());
    400400
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDefs.cpp

    r82968 r91363  
    3333                                              ConfigurationAccessLevel_Full :
    3434                                              ConfigurationAccessLevel_Partial_PoweredOff;
     35        case KMachineState_AbortedSaved:
    3536        case KMachineState_Saved:      return ConfigurationAccessLevel_Partial_Saved;
    3637        case KMachineState_Running:
  • trunk/src/VBox/Frontends/VirtualBox/src/snapshots/UISnapshotPane.cpp

    r91128 r91363  
    14701470                                        || enmState == KMachineState_Saved
    14711471                                        || enmState == KMachineState_Aborted
     1472                                        || enmState == KMachineState_AbortedSaved
    14721473                                        || enmState == KMachineState_Running
    14731474                                        || enmState == KMachineState_Paused;
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic1.cpp

    r91260 r91363  
    9595            uUuid = machine.GetId();
    9696            fEnabled = machine.GetSessionState() == KSessionState_Unlocked;
    97             fInSaveState = machine.GetState() == KMachineState_Saved;
     97            fInSaveState = machine.GetState() == KMachineState_Saved || machine.GetState() == KMachineState_AbortedSaved;
    9898        }
    9999        else
  • trunk/src/VBox/Main/cbinding/tstCAPIGlue.c

    r83828 r91363  
    7474        case MachineState_Teleported:          return "Teleported";
    7575        case MachineState_Aborted:             return "Aborted";
     76        case MachineState_AbortedSaved:        return "Aborted-Saved";
    7677        case MachineState_Running:             return "Running";
    7778        case MachineState_Paused:              return "Paused";
     
    181182                || state == MachineState_Teleported
    182183                || state == MachineState_Aborted
     184                || state == MachineState_AbortedSaved
    183185               )
    184186                g_fStop = 1;
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r91326 r91363  
    653653    +-> PoweredOff --+-->[powerUp()]--> Starting --+      | +-----[resume()]-----+
    654654    |                |                             |      | V                    |
    655     |   Aborted -----+                             +--> Running --[pause()]--> Paused
     655    |   Aborted <----+                             +--> Running --[pause()]--> Paused
    656656    |                                              |      ^ |                   ^ |
    657     |   Saved -----------[powerUp()]--> Restoring -+      | |                   | |
     657    |  AbortedSaved <-----------[failure]-----<----+      | |                   | |
     658    |       |                                      |      | |                   | |
     659    |       +-------------+                        |      | |                   | |
     660    |                     V                        |      | |                   | |
     661    |   Saved --------[powerUp()]-----> Restoring -+      | |                   | |
    658662    |     ^                                               | |                   | |
    659663    |     |     +-----------------------------------------+-|-------------------+ +
     
    666670      </pre>
    667671
    668       Note that states to the right from PoweredOff, Aborted and Saved in the
    669       above diagram are called <i>online VM states</i>. These states
    670       represent the virtual machine which is being executed in a dedicated
    671       process (usually with a GUI window attached to it where you can see the
    672       activity of the virtual machine and interact with it). There are two
    673       special pseudo-states, FirstOnline and LastOnline, that can be used in
    674       relational expressions to detect if the given machine state is online or
    675       not:
     672      Note that states to the right of PoweredOff, Aborted, AbortedSaved, and
     673      Saved in the above diagram are called <i>online VM states</i>. These
     674      states represent the virtual machine which is being executed in a
     675      dedicated process (usually with a GUI window attached to it where you can
     676      see the activity of the virtual machine and interact with it). There are
     677      two special pseudo-states, FirstOnline and LastOnline, that can be used
     678      in relational expressions to detect if the given machine state is online
     679      or not:
    676680
    677681      <pre>
     
    708712      virtual machine execution and therefore are shown separately. The states
    709713      shown on these diagrams are called <i>offline VM states</i> (this includes
    710       PoweredOff, Aborted and Saved too).
     714      PoweredOff, Aborted, AbortedSaved and Saved too).
    711715
    712716      The first diagram shows what happens when a lengthy setup operation is
     
    785789      </desc>
    786790    </const>
    787     <const name="Running"                   value="5">
     791    <const name="AbortedSaved"              value="5">
     792      <desc>
     793        A machine in the @c Saved stated has terminated abnormally before
     794        reaching the @c Running state. Similar to the @c Aborted state,
     795        this may indicate a crash of the VM process in host execution
     796        context, or the VM process has been terminated externally.
     797      </desc>
     798    </const>
     799
     800    <const name="Running"                   value="6">
    788801      <desc>
    789802        The machine is currently being executed.
     
    797810      </desc>
    798811    </const>
    799     <const name="Paused"                    value="6">
     812    <const name="Paused"                    value="7">
    800813      <desc>
    801814        Execution of the machine has been paused.
     
    809822      </desc>
    810823    </const>
    811     <const name="Stuck"                     value="7">
     824    <const name="Stuck"                     value="8">
    812825      <desc>
    813826        Execution of the machine has reached the "Guru Meditation"
     
    820833      </desc>
    821834    </const>
    822     <const name="Teleporting"               value="8">
     835    <const name="Teleporting"               value="9">
    823836      <desc>
    824837        The machine is about to be teleported to a different host or process.
     
    828841      </desc>
    829842    </const>
    830     <const name="LiveSnapshotting"          value="9">
     843    <const name="LiveSnapshotting"          value="10">
    831844      <desc>
    832845        A live snapshot is being taken. The machine is running normally, but
     
    837850      </desc>
    838851    </const>
    839     <const name="Starting"                  value="10">
     852    <const name="Starting"                  value="11">
    840853      <desc>
    841854        Machine is being started after powering it on from a
     
    843856      </desc>
    844857    </const>
    845     <const name="Stopping"                  value="11">
     858    <const name="Stopping"                  value="12">
    846859      <desc>
    847860        Machine is being normally stopped powering it off, or after the guest OS
     
    849862      </desc>
    850863    </const>
    851     <const name="Saving"                    value="12">
     864    <const name="Saving"                    value="13">
    852865      <desc>
    853866        Machine is saving its execution state to a file.
    854867      </desc>
    855868    </const>
    856     <const name="Restoring"                 value="13">
     869    <const name="Restoring"                 value="14">
    857870      <desc>
    858871        Execution state of the machine is being restored from a file
    859         after powering it on from the saved execution state.
    860       </desc>
    861     </const>
    862     <const name="TeleportingPausedVM"       value="14">
     872        after powering it on from either the @c Saved or @c AbortedSaved
     873        execution state.
     874      </desc>
     875    </const>
     876    <const name="TeleportingPausedVM"       value="15">
    863877      <desc>
    864878        The machine is being teleported to another host or process, but it is
     
    867881      </desc>
    868882    </const>
    869     <const name="TeleportingIn"             value="15">
     883    <const name="TeleportingIn"             value="16">
    870884      <desc>
    871885        Teleporting the machine state in from another host or process.
    872886      </desc>
    873887    </const>
    874     <const name="DeletingSnapshotOnline"    value="16">
     888    <const name="DeletingSnapshotOnline"    value="17">
    875889      <desc>
    876890        Like @c DeletingSnapshot, but the merging of media is ongoing in
     
    878892      </desc>
    879893    </const>
    880     <const name="DeletingSnapshotPaused"    value="17">
     894    <const name="DeletingSnapshotPaused"    value="18">
    881895      <desc>
    882896        Like @c DeletingSnapshotOnline, but the machine was paused when the
     
    884898      </desc>
    885899    </const>
    886     <const name="OnlineSnapshotting"        value="18">
     900    <const name="OnlineSnapshotting"        value="19">
    887901      <desc>
    888902        Like @c LiveSnapshotting, but the machine was paused when the
     
    890904      </desc>
    891905    </const>
    892     <const name="RestoringSnapshot"         value="19">
     906    <const name="RestoringSnapshot"         value="20">
    893907      <desc>
    894908        A machine snapshot is being restored; this typically does not take long.
    895909      </desc>
    896910    </const>
    897     <const name="DeletingSnapshot"          value="20">
     911    <const name="DeletingSnapshot"          value="21">
    898912      <desc>
    899913        A machine snapshot is being deleted; this can take a long time since this
     
    902916      </desc>
    903917    </const>
    904     <const name="SettingUp"                 value="21">
     918    <const name="SettingUp"                 value="22">
    905919      <desc>
    906920        Lengthy setup operation is in progress.
    907921      </desc>
    908922    </const>
    909     <const name="Snapshotting"              value="22">
     923    <const name="Snapshotting"              value="23">
    910924      <desc>
    911925        Taking an (offline) snapshot.
     
    913927    </const>
    914928
    915     <const name="FirstOnline" value="5" wsmap="suppress"> <!-- Running -->
     929    <const name="FirstOnline" value="6" wsmap="suppress"> <!-- Running -->
    916930      <desc>
    917931        Pseudo-state: first online state (for use in relational expressions).
    918932      </desc>
    919933    </const>
    920     <const name="LastOnline" value="18" wsmap="suppress"> <!-- OnlineSnapshotting -->
     934    <const name="LastOnline" value="19" wsmap="suppress"> <!-- OnlineSnapshotting -->
    921935      <desc>
    922936        Pseudo-state: last online state (for use in relational expressions).
     
    924938    </const>
    925939
    926     <const name="FirstTransient" value="8" wsmap="suppress"> <!-- Teleporting -->
     940    <const name="FirstTransient" value="9" wsmap="suppress"> <!-- Teleporting -->
    927941      <desc>
    928942        Pseudo-state: first transient state (for use in relational expressions).
    929943      </desc>
    930944    </const>
    931     <const name="LastTransient" value="22" wsmap="suppress"> <!-- Snapshotting -->
     945    <const name="LastTransient" value="23" wsmap="suppress"> <!-- Snapshotting -->
    932946      <desc>
    933947        Pseudo-state: last transient state (for use in relational expressions).
     
    65346548      <desc>
    65356549        Full path to the file that stores the execution state of
    6536         the machine when it is in the <link to="MachineState_Saved"/> state.
     6550        the machine when it is in either the <link to="MachineState_Saved"/>
     6551        or <link to="MachineState_AbortedSaved"/> state.
    65376552        <note>
    6538           When the machine is not in the Saved state, this attribute is
    6539           an empty string.
     6553          When the machine is not in the Saved or AbortedSaved state, this
     6554          attribute is an empty string.
    65406555        </note>
    65416556      </desc>
     
    84268441        <ul>
    84278442          <li>With "UnregisterOnly", the machine will only be unregistered, but no additional
    8428             cleanup will be performed. The call will fail if the machine is in "Saved" state
    8429             or has any snapshots or any media attached (see <link to="IMediumAttachment" />).
    8430             It is the responsibility of the caller to delete all such configuration in this mode.
    8431             In this mode, the API behaves like the former @c IVirtualBox::unregisterMachine() API
    8432             which it replaces.</li>
     8443            cleanup will be performed. The call will fail if the machine has any snapshots or
     8444            any media attached (see <link to="IMediumAttachment" />).  It is the responsibility
     8445            of the caller to delete all such configuration in this mode.  In this mode, the API
     8446            behaves like the former @c IVirtualBox::unregisterMachine() API which it replaces.</li>
    84338447          <li>With "DetachAllReturnNone", the call will succeed even if the machine is in "Saved"
    84348448            state or if it has snapshots or media attached. All media attached to the current machine
     
    85088522          <li>If <link to="#unregister" /> had been previously called with a @a cleanupMode
    85098523            argument other than "UnregisterOnly", this will delete all saved state files that
    8510             the machine had in use; possibly one if the machine was in "Saved" state and one
    8511             for each online snapshot that the machine had.</li>
     8524            the machine had in use; possibly one if the machine was in either the "Saved" or
     8525            "AbortedSaved" state and one for each online snapshot that the machine had.</li>
    85128526          <li>On each medium object passed in the @a aMedia array, this will call
    85138527            <link to="IMedium::close" />. If that succeeds, this will attempt to delete the
     
    91809194
    91819195        After this operation completes, the machine will go to the
    9182         Saved state. Next time it is powered up, this state will
     9196        Saved state. The next time it is powered up this state will
    91839197        be restored and the machine will continue its execution from
    91849198        the place where it was saved.
     
    92229236        Associates the given saved state file to the virtual machine.
    92239237
    9224         On success, the machine will go to the Saved state. Next time it is
    9225         powered up, it will be restored from the adopted saved state and
     9238        On success, the machine will go to the Saved state. The next time it is
     9239        powered up it will be restored from the adopted saved state and
    92269240        continue execution from the place where the saved state file was
    92279241        created.
     
    92509264      <desc>
    92519265        Forcibly resets the machine to "Powered Off" state if it is
    9252         currently in the "Saved" state (previously created by <link to="#saveState"/>).
    9253         Next time the machine is powered up, a clean boot will occur.
     9266        currently in the "Saved" state previously created by <link to="#saveState"/>)
     9267        or in the "AbortedSaved" state.  The next time the machine is powered up
     9268        a clean boot will occur.
    92549269        <note>
    92559270          This operation is equivalent to resetting or powering off
     
    92659280        <link to="#stateFilePath" /> attribute.
    92669281        <result name="VBOX_E_INVALID_VM_STATE">
    9267           Virtual machine not in state Saved.
     9282          Virtual machine not in either the Saved or AbortedSaved state.
    92689283        </result>
    92699284      </desc>
     
    92819296
    92829297        This method can be called for a PoweredOff, Saved (see
    9283         <link to="#saveState"/>), Running or
     9298        <link to="#saveState"/>), AbortedSaved, Running or
    92849299        Paused virtual machine. When the machine is PoweredOff, an
    92859300        offline snapshot is created. When the machine is Running a live
     
    94749489
    94759490        If the given snapshot is an online snapshot, the machine will go to
    9476         the <link to="MachineState_Saved">saved state</link>, so that the
     9491        the <link to="MachineState_Saved">Saved</link> state, so that the
    94779492        next time it is powered on, the execution state will be restored
    94789493        from the state of the snapshot.
     
    94839498
    94849499        <note>
    9485           If the machine state is <link to="MachineState_Saved">Saved</link>
    9486           prior to this operation, the saved state file will be implicitly
     9500          If the machine is in the <link to="MachineState_Saved">Saved</link>
     9501          state prior to this operation, the saved state file will be implicitly
    94879502          deleted (as if <link to="IMachine::discardSavedState"/> were
    94889503          called).
     
    98549869        powered on).
    98559870
    9856         If the machine is in the <link to="MachineState_Saved"/> state,
    9857         it will continue its execution the point where the state has
    9858         been saved.
     9871        If the machine is in the <link to="MachineState_Saved"/> state or the
     9872        <link to="MachineState_AbortedSaved"/> state it will continue its
     9873        execution from the point where the state was saved.
    98599874
    98609875        If the machine <link to="IMachine::teleporterEnabled"/> property is
     
    1011710132
    1011810133        <result name="VBOX_E_INVALID_VM_STATE">
    10119           Virtual machine in Saved state or currently changing state.
     10134          Virtual machine is in the Saved or AbortedSaved state or currently changing state.
    1012010135        </result>
    1012110136        <result name="VBOX_E_FILE_ERROR">
     
    1015010165        shared folders and stops sharing it.
    1015110166        <result name="VBOX_E_INVALID_VM_STATE">
    10152           Virtual machine in Saved state or currently changing state.
     10167          Virtual machine is in the Saved or AbortedSaved state or currently changing state.
    1015310168        </result>
    1015410169        <result name="VBOX_E_FILE_ERROR">
     
    1637716392      because when restoring it, the VM will be running.
    1637816393
    16379       If the machine was in <link to="MachineState_Saved">saved</link> saved,
    16380       the snapshot receives a copy of the execution state file
    16381       (<link to="IMachine::stateFilePath"/>).
     16394      If the machine was in the <link to="MachineState_Saved">Saved</link> or
     16395      <link to="MachineState_AbortedSaved">AbortedSaved</link> state, the snapshot
     16396      receives a copy of the execution state file (<link to="IMachine::stateFilePath"/>).
    1638216397
    1638316398      Otherwise, if the machine was not running (<link to="MachineState_PoweredOff"/>
  • trunk/src/VBox/Main/src-all/Global.cpp

    r89868 r91363  
    590590        case MachineState_Teleported:           return "Teleported";
    591591        case MachineState_Aborted:              return "Aborted";
     592        case MachineState_AbortedSaved:         return "Aborted-Saved";
    592593        case MachineState_Running:              return "Running";
    593594        case MachineState_Paused:               return "Paused";
  • trunk/src/VBox/Main/src-client/ConsoleImpl.cpp

    r91326 r91363  
    15811581HRESULT Console::i_loadDataFromSavedState()
    15821582{
    1583     if (mMachineState != MachineState_Saved || mSavedStateDataLoaded)
     1583    if ((mMachineState != MachineState_Saved && mMachineState != MachineState_AbortedSaved) || mSavedStateDataLoaded)
    15841584        return S_OK;
    15851585
     
    21822182        /* extra nice error message for a common case */
    21832183        case MachineState_Saved:
     2184        case MachineState_AbortedSaved:
    21842185            return setError(VBOX_E_INVALID_VM_STATE, tr("Cannot power down a saved virtual machine"));
    21852186        case MachineState_Stopping:
     
    29652966
    29662967    /// @todo see @todo in AttachUSBDevice() about the Paused state
    2967     if (mMachineState == MachineState_Saved)
     2968    if (mMachineState == MachineState_Saved || mMachineState == MachineState_AbortedSaved)
    29682969        return setError(VBOX_E_INVALID_VM_STATE,
    2969                         tr("Cannot create a transient shared folder on the machine in the saved state"));
     2970                        tr("Cannot create a transient shared folder on a machine in a saved state (machine state: %s)"),
     2971                        Global::stringifyMachineState(mMachineState));
    29702972    if (   mMachineState != MachineState_PoweredOff
    29712973        && mMachineState != MachineState_Teleported
     
    30363038
    30373039    /// @todo see @todo in AttachUSBDevice() about the Paused state
    3038     if (mMachineState == MachineState_Saved)
     3040    if (mMachineState == MachineState_Saved || mMachineState == MachineState_AbortedSaved)
    30393041        return setError(VBOX_E_INVALID_VM_STATE,
    3040                         tr("Cannot remove a transient shared folder from the machine in the saved state"));
     3042                        tr("Cannot remove a transient shared folder from a machine in a saved state (machine state: %s)"),
     3043                        Global::stringifyMachineState(mMachineState));;
    30413044    if (   mMachineState != MachineState_PoweredOff
    30423045        && mMachineState != MachineState_Teleported
     
    77057708        pPowerupProgress.createObject();
    77067709        Bstr progressDesc;
    7707         if (mMachineState == MachineState_Saved)
     7710        if (mMachineState == MachineState_Saved || mMachineState == MachineState_AbortedSaved)
    77087711            progressDesc = tr("Restoring virtual machine");
    77097712        else if (fTeleporterEnabled)
     
    77177720         * Saved VMs will have to prove that their saved states seem kosher.
    77187721         */
    7719         if (mMachineState == MachineState_Saved)
     7722        if (mMachineState == MachineState_Saved || mMachineState == MachineState_AbortedSaved)
    77207723        {
    77217724            rc = mMachine->COMGETTER(StateFilePath)(savedStateFile.asOutParam());
     
    77847787        task->mSharedFolders = sharedFolders;
    77857788        task->mStartPaused = aPaused;
    7786         if (mMachineState == MachineState_Saved)
     7789        if (mMachineState == MachineState_Saved || mMachineState == MachineState_AbortedSaved)
    77877790            try { task->mSavedStateFile = savedStateFile; }
    77887791            catch (std::bad_alloc &) { throw rc = E_OUTOFMEMORY; }
     
    79287931        }
    79297932        else if (   mMachineState == MachineState_Saved
     7933                 || mMachineState == MachineState_AbortedSaved
    79307934                 || !fTeleporterEnabled)
    79317935        {
     
    80428046         * since we've already started the thread and it is now responsible for
    80438047         * any error reporting and appropriate state change! */
    8044         if (mMachineState == MachineState_Saved)
     8048        if (mMachineState == MachineState_Saved || mMachineState == MachineState_AbortedSaved)
    80458049            i_setMachineState(MachineState_Restoring);
    80468050        else if (fTeleporterEnabled)
     
    89648968                case MachineState_Restoring:
    89658969                    /* failed to load the saved state file, but be patient: set
    8966                      * back to Saved (to preserve the saved state file) */
    8967                     that->i_setMachineState(MachineState_Saved);
     8970                     * to AbortedSaved (to preserve the saved state file) */
     8971                    that->i_setMachineState(MachineState_AbortedSaved);
    89688972                    break;
    89698973                case MachineState_TeleportingIn:
  • trunk/src/VBox/Main/src-server/MachineImpl.cpp

    r91326 r91363  
    80968096                        && mData->mMachineState != MachineState_Teleported
    80978097                        && mData->mMachineState != MachineState_Saved
     8098                        && mData->mMachineState != MachineState_AbortedSaved
    80988099                        && mData->mMachineState != MachineState_PoweredOff
    80998100                       )
     
    81288129                        && mData->mMachineState != MachineState_Teleported
    81298130                        && mData->mMachineState != MachineState_Saved
     8131                        && mData->mMachineState != MachineState_AbortedSaved
    81308132                        && mData->mMachineState != MachineState_PoweredOff
    81318133                        && !Global::IsOnline(mData->mMachineState)
     
    86368638     */
    86378639
    8638     /* set the machine state to Aborted or Saved when appropriate */
    8639     if (config.fAborted)
     8640    /* set the machine state to either Aborted-Saved, Aborted, or Saved if appropriate */
     8641    if (config.fAborted && !mSSData->strStateFilePath.isEmpty())
     8642    {
     8643        /* no need to use i_setMachineState() during init() */
     8644        mData->mMachineState = MachineState_AbortedSaved;
     8645    }
     8646    else if (config.fAborted)
    86408647    {
    86418648        mSSData->strStateFilePath.setNull();
     
    1000110008
    1000210009    if (    mData->mMachineState == MachineState_Saved
     10010         || mData->mMachineState == MachineState_AbortedSaved
    1000310011         || mData->mMachineState == MachineState_Restoring
    1000410012            // when doing certain snapshot operations we may or may not have
     
    1002710035
    1002810036    config.timeLastStateChange = mData->mLastStateChange;
    10029     config.fAborted = (mData->mMachineState == MachineState_Aborted);
     10037    config.fAborted = (mData->mMachineState == MachineState_Aborted || mData->mMachineState == MachineState_AbortedSaved);
    1003010038    /// @todo Live Migration:        config.fTeleported = (mData->mMachineState == MachineState_Teleported);
    1003110039
     
    1054410552            mData->pMachineConfigFile->timeLastStateChange = mData->mLastStateChange;
    1054510553
    10546             mData->pMachineConfigFile->fAborted = (mData->mMachineState == MachineState_Aborted);
     10554            mData->pMachineConfigFile->fAborted = (mData->mMachineState == MachineState_Aborted
     10555                                                || mData->mMachineState == MachineState_AbortedSaved);
    1054710556/// @todo live migration             mData->pMachineConfigFile->fTeleported = (mData->mMachineState == MachineState_Teleported);
    1054810557        }
     
    1266412673        Log1WarningThisFunc(("ABNORMAL client termination! (wasBusy=%d)\n", Global::IsOnlineOrTransient(lastState)));
    1266512674
    12666         /* reset the state to Aborted */
    12667         if (mData->mMachineState != MachineState_Aborted)
     12675        /*
     12676         * Move the VM to the 'Aborted' machine state unless we are restoring a
     12677         * VM that was in the 'Saved' machine state.  In that case, if the VM
     12678         * fails before reaching either the 'Restoring' machine state or the
     12679         * 'Running' machine state then we set the machine state to
     12680         * 'AbortedSaved' in order to preserve the saved state file so that the
     12681         * VM can be restored in the future.
     12682         */
     12683        if (mData->mMachineState == MachineState_Saved || mData->mMachineState == MachineState_Restoring)
     12684            i_setMachineState(MachineState_AbortedSaved);
     12685        else if (mData->mMachineState != MachineState_Aborted)
    1266812686            i_setMachineState(MachineState_Aborted);
    1266912687    }
     
    1309013108    if (FAILED(rc)) return rc;
    1309113109
    13092     if (mData->mMachineState != MachineState_Saved)
     13110    if (   mData->mMachineState != MachineState_Saved
     13111        && mData->mMachineState != MachineState_AbortedSaved)
    1309313112        return setError(VBOX_E_INVALID_VM_STATE,
    13094             tr("Cannot delete the machine state as the machine is not in the saved state (machine state: %s)"),
     13113            tr("Cannot discard the saved state as the machine is not in the Saved or Aborted-Saved state (machine state: %s)"),
    1309513114            Global::stringifyMachineState(mData->mMachineState));
    1309613115
     
    1461514634{
    1461614635    LogFlowThisFuncEnter();
    14617     LogFlowThisFunc(("aMachineState=%s\n", Global::stringifyMachineState(aMachineState) ));
    1461814636
    1461914637    AutoCaller autoCaller(this);
     
    1463614654    /* detect some state transitions */
    1463714655
    14638     if (   (   oldMachineState == MachineState_Saved
    14639             && aMachineState   == MachineState_Restoring)
     14656    if (   (   (   oldMachineState == MachineState_Saved
     14657                || oldMachineState == MachineState_AbortedSaved
     14658               )
     14659                && aMachineState   == MachineState_Restoring
     14660            )
    1464014661        || (   (   oldMachineState == MachineState_PoweredOff
    1464114662                || oldMachineState == MachineState_Teleported
     
    1467214693                 || aMachineState == MachineState_Teleported
    1467314694                 || aMachineState == MachineState_Aborted
     14695                 || aMachineState == MachineState_AbortedSaved
    1467414696                )
    1467514697            )
     
    1468514707    if (oldMachineState == MachineState_Restoring)
    1468614708    {
    14687         if (aMachineState != MachineState_Saved)
     14709        if (aMachineState != MachineState_Saved && aMachineState != MachineState_AbortedSaved)
    1468814710        {
    1468914711            /*
    1469014712             *  delete the saved state file once the machine has finished
    1469114713             *  restoring from it (note that Console sets the state from
    14692              *  Restoring to Saved if the VM couldn't restore successfully,
     14714             *  Restoring to AbortedSaved if the VM couldn't restore successfully,
    1469314715             *  to give the user an ability to fix an error and retry --
    1469414716             *  we keep the saved state file in this case)
     
    1469914721    else if (   oldMachineState == MachineState_Saved
    1470014722             && (   aMachineState == MachineState_PoweredOff
    14701                  || aMachineState == MachineState_Aborted
    1470214723                 || aMachineState == MachineState_Teleported
    1470314724                )
    1470414725            )
    1470514726    {
    14706         /*
    14707          *  delete the saved state after SessionMachine::ForgetSavedState() is called
    14708          *  or if the VM process (owning a direct VM session) crashed while the
    14709          *  VM was Saved
    14710          */
    14711 
    14712         /// @todo (dmik)
    14713         //      Not sure that deleting the saved state file just because of the
    14714         //      client death before it attempted to restore the VM is a good
    14715         //      thing. But when it crashes we need to go to the Aborted state
    14716         //      which cannot have the saved state file associated... The only
    14717         //      way to fix this is to make the Aborted condition not a VM state
    14718         //      but a bool flag: i.e., when a crash occurs, set it to true and
    14719         //      change the state to PoweredOff or Saved depending on the
    14720         //      saved state presence.
    14721 
     14727        /* delete the saved state after SessionMachine::ForgetSavedState() is called */
    1472214728        deleteSavedState = true;
    1472314729        mData->mCurrentStateModified = TRUE;
    1472414730        stsFlags |= SaveSTS_CurStateModified;
    1472514731    }
     14732    /* failure to reach the restoring state should always go to MachineState_AbortedSaved */
     14733    Assert(!(oldMachineState == MachineState_Saved && aMachineState == MachineState_Aborted));
    1472614734
    1472714735    if (   aMachineState == MachineState_Starting
     
    1476514773            || aMachineState == MachineState_Teleported
    1476614774            || aMachineState == MachineState_Aborted
     14775            || aMachineState == MachineState_AbortedSaved
    1476714776            || aMachineState == MachineState_Saved))
    1476814777    {
  • trunk/src/VBox/Main/src-server/MachineImplMoveVM.cpp

    r91326 r91363  
    245245        return hrc;
    246246
    247     if (machineState == MachineState_Saved)
     247    if (machineState == MachineState_Saved || machineState == MachineState_AbortedSaved)
    248248    {
    249249        m_pMachine->COMGETTER(StateFilePath)(bstr_stateFilePath.asOutParam());
  • trunk/src/VBox/Main/src-server/SnapshotImpl.cpp

    r91326 r91363  
    17701770                i_composeSavedStateFilename(task.m_strStateFilePath);
    17711771        }
    1772         else if (task.m_machineStateBackup == MachineState_Saved)
     1772        else if (task.m_machineStateBackup == MachineState_Saved || task.m_machineStateBackup == MachineState_AbortedSaved)
    17731773            // taking an offline snapshot from machine in "saved" state: use existing state file
    17741774            task.m_strStateFilePath = mSSData->strStateFilePath;
     
    23052305        /* Delete the saved state file if the machine was Saved prior to this
    23062306         * operation */
    2307         if (task.m_machineStateBackup == MachineState_Saved)
     2307        if (task.m_machineStateBackup == MachineState_Saved || task.m_machineStateBackup == MachineState_AbortedSaved)
    23082308        {
    23092309            Assert(!mSSData->strStateFilePath.isEmpty());
     
    26792679        && mData->mMachineState != MachineState_Teleported
    26802680        && mData->mMachineState != MachineState_Aborted
     2681        && mData->mMachineState != MachineState_AbortedSaved
    26812682        && mData->mMachineState != MachineState_Running
    26822683        && mData->mMachineState != MachineState_Paused)
  • trunk/src/VBox/ValidationKit/testdriver/vboxwrappers.py

    r91055 r91363  
    8585    if eState == vboxcon.MachineState_Teleported: return 'Teleported';
    8686    if eState == vboxcon.MachineState_Aborted: return 'Aborted';
     87    if eState == vboxcon.MachineState_AbortedSaved: return 'Aborted-Saved';
    8788    if eState == vboxcon.MachineState_Running: return 'Running';
    8889    if eState == vboxcon.MachineState_Paused: return 'Paused';
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