VirtualBox

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


Ignore:
Timestamp:
Aug 22, 2007 8:49:37 PM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
23820
Message:

Main/GUI: Implemented the Stuck state.

Location:
trunk/src/VBox/Main
Files:
2 edited

Legend:

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

    r4270 r4297  
    14681468
    14691469    if (mMachineState != MachineState_Running &&
    1470         mMachineState != MachineState_Paused)
     1470        mMachineState != MachineState_Paused &&
     1471        mMachineState != MachineState_Stuck)
    14711472    {
    14721473        /* extra nice error message for a common case */
     
    18911892    //  Paused, Starting, Saving, Stopping, etc? if not, we should make a
    18921893    //  stricter check (mMachineState != MachineState_Running).
    1893     /* bird: It is not permitted to attach or detach while the VM is saving, is restoring
    1894      * or has stopped - definintly not.
     1894    //
     1895    //  I'm changing it to the semi-strict check for the time being. We'll
     1896    //  consider the below later.
     1897    //
     1898    /* bird: It is not permitted to attach or detach while the VM is saving,
     1899     * is restoring or has stopped - definintly not.
    18951900     *
    1896      * Attaching while starting, well, if you don't create any deadlock it should work...
    1897      * Paused should work I guess, but we shouldn't push our luck if we're pausing because an
    1898      * runtime error condition was raised (which is one of the reasons there better be a separate
    1899      * state for that in the VMM).
     1901     * Attaching while starting, well, if you don't create any deadlock it
     1902     * should work...  Paused should work I guess, but we shouldn't push our
     1903     * luck if we're pausing because an runtime error condition was raised
     1904     * (which is one of the reasons there better be a separate state for that
     1905     * in the VMM).
    19001906     */
    1901     if (mMachineState < MachineState_Running)
     1907    if (mMachineState != MachineState_Running &&
     1908        mMachineState != MachineState_Paused)
    19021909        return setError (E_FAIL,
    1903             tr ("Cannot attach a USB device to a machine which is not running "
    1904                 "(machine state: %d)"), mMachineState);
     1910            tr ("Cannot attach a USB device to the machine which is not running"
     1911                "(machine state: %d)"),
     1912            mMachineState);
    19051913
    19061914    /* protect mpVM */
     
    19992007    AutoLock alock (this);
    20002008
     2009    /// @todo see @todo in AttachUSBDevice() about the Paused state
    20012010    if (mMachineState == MachineState_Saved)
    20022011        return setError (E_FAIL,
    2003             tr ("Cannot create a transient shared folder on a "
     2012            tr ("Cannot create a transient shared folder on the "
    20042013                "machine in the saved state"));
     2014    if (mMachineState > MachineState_Paused)
     2015        return setError (E_FAIL,
     2016            tr ("Cannot create a transient shared folder on the "
     2017                "machine while it is changing the state (machine state: %d)"),
     2018            mMachineState);
    20052019
    20062020    ComObjPtr <SharedFolder> sharedFolder;
     
    20652079    AutoLock alock (this);
    20662080
     2081    /// @todo see @todo in AttachUSBDevice() about the Paused state
    20672082    if (mMachineState == MachineState_Saved)
    20682083        return setError (E_FAIL,
    2069             tr ("Cannot remove a transient shared folder when the "
    2070                 "machine is in the saved state."));
     2084            tr ("Cannot remove a transient shared folder from the "
     2085                "machine in the saved state"));
     2086    if (mMachineState > MachineState_Paused)
     2087        return setError (E_FAIL,
     2088            tr ("Cannot remove a transient shared folder from the "
     2089                "machine while it is changing the state (machine state: %d)"),
     2090            mMachineState);
    20712091
    20722092    ComObjPtr <SharedFolder> sharedFolder;
     
    21242144    AutoLock alock (this);
    21252145
    2126     if (mMachineState > MachineState_Running &&
    2127         mMachineState != MachineState_Paused)
     2146    if (mMachineState > MachineState_Paused)
    21282147    {
    21292148        return setError (E_FAIL,
    2130             tr ("Cannot take a snapshot of a machine while it is changing state.  (Machine state: %d)"), mMachineState);
     2149            tr ("Cannot take a snapshot of the machine "
     2150                "while it is changing the state (machine state: %d)"),
     2151            mMachineState);
    21312152    }
    21322153
     
    22962317    if (mMachineState >= MachineState_Running)
    22972318        return setError (E_FAIL,
    2298             tr ("Cannot discard a snapshot on a running machine (Machine state: %d)"), mMachineState);
     2319            tr ("Cannot discard a snapshot of the running machine "
     2320                "(machine state: %d)"),
     2321            mMachineState);
    22992322
    23002323    MachineState_T machineState = MachineState_InvalidMachineState;
     
    23152338    if (mMachineState >= MachineState_Running)
    23162339        return setError (E_FAIL,
    2317             tr ("Cannot discard the current state of a running machine.  (Machine state: %d)"), mMachineState);
     2340            tr ("Cannot discard the current state of the running machine "
     2341                "(nachine state: %d)"),
     2342            mMachineState);
    23182343
    23192344    MachineState_T machineState = MachineState_InvalidMachineState;
     
    23342359    if (mMachineState >= MachineState_Running)
    23352360        return setError (E_FAIL,
    2336             tr ("Cannot discard the current snapshot and state on a running machine.  (Machine state: %d)"), mMachineState);
     2361            tr ("Cannot discard the current snapshot and state of the "
     2362                "running machine (machine state: %d)"),
     2363            mMachineState);
    23372364
    23382365    MachineState_T machineState = MachineState_InvalidMachineState;
     
    38693896    AssertMsg (mMachineState == MachineState_Running ||
    38703897               mMachineState == MachineState_Paused ||
     3898               mMachineState == MachineState_Stuck ||
    38713899               mMachineState == MachineState_Saving ||
    38723900               mMachineState == MachineState_Starting ||
     
    45484576                that->setMachineState (MachineState_Paused);
    45494577            }
     4578
     4579            break;
    45504580        }
    45514581
     
    45724602                that->setMachineState (MachineState_Running);
    45734603            }
     4604
     4605            break;
     4606        }
     4607
     4608        case VMSTATE_GURU_MEDITATION:
     4609        {
     4610            AutoLock alock (that);
     4611
     4612            if (that->mVMStateChangeCallbackDisabled)
     4613                break;
     4614
     4615            /* Guru respects only running VMs */
     4616            Assert ((that->mMachineState >= MachineState_Running));
     4617
     4618            that->setMachineState (MachineState_Stuck);
     4619
     4620            break;
    45744621        }
    45754622
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r4269 r4297  
    111111  <enum
    112112     name="MachineState"
    113      uuid="b8bb15f7-4fa2-4e84-87a8-b4677dd87deb"
     113     uuid="73bf04d0-7c4f-4684-9abf-d65a9ad74343"
    114114     >
    115115    <desc>
     
    118118    </desc>
    119119
    120     <const name="InvalidMachineState"   value="0"/>
     120    <const name="InvalidMachineState"   value="0">
     121      <desc>
     122        Invalid machine state. This state is never used by the virtual machine
     123        and may be used as a <tt>null</tt> value for state
     124        variables.
     125      </desc>
     126    </const>
    121127    <const name="PoweredOff"            value="1">
    122128      <desc>
     
    150156          action).
    151157        </note>
     158        <note>
     159          For whoever decides to touch this enum: In order to keep the
     160          aforementioned comparisons valid, this state must immediately
     161          preceed the Paused state.
     162        </note>
    152163      </desc>
    153164    </const>
     
    156167        The execution of the machine has been paused.
    157168        <note>
    158           This value can be used in comparison expressions:
    159           all state values above it represent unstable states of the
    160           virtual machine. No any settings can be altered when the
    161           VM is in one of the unstable sates.
     169          This value can be used in comparison expressions: all state values
     170          above it represent unstable states of the running virtual
     171          machine. Unless explicitly stated otherwise, no machine settings can
     172          be altered when it is in one of the unstable sates.
     173        </note>
     174        <note>
     175          For whoever decides to touch this enum: In order to keep the
     176          aforementioned comparisons valid, this state must immediately
     177          follow the Running state.
    162178        </note>
    163179      </desc>
    164180    </const>
    165     <const name="Starting"              value="6">
     181    <const name="Stuck"                 value="6">
     182      <desc>
     183        The execution of the machine has reached the Guru Meditaion
     184        condition. This condition indicates an internal VMM failure which may
     185        happen as a result of either an unhandled low-level virtual hardware
     186        exception or one of the recompiler exceptions (such as
     187        the <i>too-many-traps</i> condition).
     188      </desc>
     189    </const>
     190    <const name="Starting"              value="7">
    166191      <desc>
    167192        The machine is being started after
     
    170195      </desc>
    171196    </const>
    172     <const name="Stopping"              value="7">
     197    <const name="Stopping"              value="8">
    173198      <desc>
    174199        The machine is being normally stopped
     
    177202      </desc>
    178203    </const>
    179     <const name="Saving"                value="8">
     204    <const name="Saving"                value="9">
    180205      <desc>
    181206        The machine is saving its execution state to a file as a
     
    185210      </desc>
    186211    </const>
    187     <const name="Restoring"             value="9">
     212    <const name="Restoring"             value="10">
    188213      <desc>
    189214        The execution state of the machine is being restored from a file
     
    192217      </desc>
    193218    </const>
    194     <const name="Discarding"            value="10">
     219    <const name="Discarding"            value="11">
    195220      <desc>
    196221        A snapshot of the machine is being discarded after calling
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