|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Objectjava.lang.Enum<MachineState>
org.virtualbox_4_3.MachineState
public enum MachineState
Virtual machine execution state.
This enumeration represents possible values of the IMachine.getState()
attribute.
Below is the basic virtual machine state diagram. It shows how the state
changes during virtual machine execution. The text in square braces shows
a method of the IConsole interface that performs the given state
transition.
+---------[powerDown()] <- Stuck <--[failure]-+ V | +-> PoweredOff --+-->[powerUp()]--> Starting --+ | +-----[resume()]-----+ | | | | V | | Aborted -----+ +--> Running --[pause()]--> Paused | | ^ | ^ | | Saved -----------[powerUp()]--> Restoring -+ | | | | | ^ | | | | | | +-----------------------------------------+-|-------------------+ + | | | | | | | +-- Saving <--------[takeSnapshot()]<-------+---------------------+ | | | | | +-------- Saving <--------[saveState()]<----------+---------------------+ | | | +-------------- Stopping -------[powerDown()]<----------+---------------------+Note that states to the right from PoweredOff, Aborted and Saved in the above diagram are called online VM states. These states represent the virtual machine which is being executed in a dedicated process (usually with a GUI window attached to it where you can see the activity of the virtual machine and interact with it). There are two special pseudo-states, FirstOnline and LastOnline, that can be used in relational expressions to detect if the given machine state is online or not:
if (machine.GetState() >= MachineState_FirstOnline && machine.GetState() <= MachineState_LastOnline) { ...the machine is being executed... }When the virtual machine is in one of the online VM states (that is, being executed), only a few machine settings can be modified. Methods working with such settings contain an explicit note about that. An attempt to change any other setting or perform a modifying operation during this time will result in the VBOX_E_INVALID_VM_STATE error. All online states except Running, Paused and Stuck are transitional: they represent temporary conditions of the virtual machine that will last as long as the operation that initiated such a condition. The Stuck state is a special case. It means that execution of the machine has reached the "Guru Meditation" condition. This condition indicates an internal VMM (virtual machine manager) failure which may happen as a result of either an unhandled low-level virtual hardware exception or one of the recompiler exceptions (such as the too-many-trapscondition). Note also that any online VM state may transit to the Aborted state. This happens if the process that is executing the virtual machine terminates unexpectedly (for example, crashes). Other than that, the Aborted state is equivalent to PoweredOff. There are also a few additional state diagrams that do not deal with virtual machine execution and therefore are shown separately. The states shown on these diagrams are called offline VM states(this includes PoweredOff, Aborted and Saved too). The first diagram shows what happens when a lengthy setup operation is being executed (such as
IMachine.attachDevice(String,Integer,Integer,org.virtualbox_4_3.DeviceType,org.virtualbox_4_3.IMedium)
).
+----------------------------------(same state as before the call)------+ | | +-> PoweredOff --+ | | | | |-> Aborted -----+-->[lengthy VM configuration call] --> SettingUp -----+ | | +-> Saved -------+The next two diagrams demonstrate the process of taking a snapshot of a powered off virtual machine, restoring the state to that as of a snapshot or deleting a snapshot, respectively.
+----------------------------------(same state as before the call)------+ | | +-> PoweredOff --+ | | +-->[takeSnapshot()] -------------------> Saving ------+ +-> Aborted -----+ +-> PoweredOff --+ | | | Aborted -----+-->[restoreSnapshot() ]-------> RestoringSnapshot -+ | | [deleteSnapshot() ]-------> DeletingSnapshot --+ +-> Saved -------+ | | | +---(Saved if restored from an online snapshot, PoweredOff otherwise)---+Note that the Saving state is present in both the offline state group and online state group. Currently, the only way to determine what group is assumed in a particular case is to remember the previous machine state: if it was Running or Paused, then Saving is an online state, otherwise it is an offline state. This inconsistency may be removed in one of the future versions of VirtualBox by adding a new state. Interface ID: {EC6C6A9E-113D-4FF4-B44F-0B69F21C97FE}
Enum Constant Summary | |
---|---|
Aborted
The process running the machine has terminated abnormally. |
|
DeletingSnapshot
A machine snapshot is being deleted; this can take a long time since this may require merging differencing media. |
|
DeletingSnapshotOnline
Like DeletingSnapshot, but the merging of media is ongoing in the background while the machine is running. |
|
DeletingSnapshotPaused
Like DeletingSnapshotOnline, but the machine was paused when the merging of differencing media was started. |
|
FaultTolerantSyncing
The machine is being synced with a fault tolerant VM running elsewhere. |
|
FirstOnline
Pseudo-state: first online state (for use in relational expressions). |
|
FirstTransient
Pseudo-state: first transient state (for use in relational expressions). |
|
LastOnline
Pseudo-state: last online state (for use in relational expressions). |
|
LastTransient
Pseudo-state: last transient state (for use in relational expressions). |
|
LiveSnapshotting
A live snapshot is being taken. |
|
Null
Null value (never used by the API). |
|
Paused
Execution of the machine has been paused. |
|
PoweredOff
The machine is not running and has no saved execution state; it has either never been started or been shut down successfully. |
|
Restoring
Execution state of the machine is being restored from a file after powering it on from the saved execution state. |
|
RestoringSnapshot
A machine snapshot is being restored; this typically does not take long. |
|
Running
The machine is currently being executed. |
|
Saved
The machine is not currently running, but the execution state of the machine has been saved to an external file when it was running, from where it can be resumed. |
|
Saving
Machine is saving its execution state to a file, or an online snapshot of the machine is being taken. |
|
SettingUp
Lengthy setup operation is in progress. |
|
Starting
Machine is being started after powering it on from a zero execution state. |
|
Stopping
Machine is being normally stopped powering it off, or after the guest OS has initiated a shutdown sequence. |
|
Stuck
Execution of the machine has reached the "Guru Meditation" condition. |
|
Teleported
The machine was teleported to a different host (or process) and then powered off. |
|
Teleporting
The machine is about to be teleported to a different host or process. |
|
TeleportingIn
Teleporting the machine state in from another host or process. |
|
TeleportingPausedVM
The machine is being teleported to another host or process, but it is not running. |
Method Summary | |
---|---|
static MachineState |
fromValue(long v)
|
static MachineState |
fromValue(java.lang.String v)
|
int |
value()
|
static MachineState |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. |
static MachineState[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
Methods inherited from class java.lang.Enum |
---|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Enum Constant Detail |
---|
public static final MachineState Null
public static final MachineState PoweredOff
public static final MachineState Saved
public static final MachineState Teleported
public static final MachineState Aborted
public static final MachineState Running
public static final MachineState Paused
public static final MachineState Stuck
public static final MachineState Teleporting
public static final MachineState LiveSnapshotting
public static final MachineState Starting
public static final MachineState Stopping
public static final MachineState Saving
public static final MachineState Restoring
public static final MachineState TeleportingPausedVM
public static final MachineState TeleportingIn
public static final MachineState FaultTolerantSyncing
public static final MachineState DeletingSnapshotOnline
public static final MachineState DeletingSnapshotPaused
public static final MachineState RestoringSnapshot
public static final MachineState DeletingSnapshot
public static final MachineState SettingUp
public static final MachineState FirstOnline
public static final MachineState LastOnline
public static final MachineState FirstTransient
public static final MachineState LastTransient
Method Detail |
---|
public static MachineState[] values()
for (MachineState c : MachineState.values()) System.out.println(c);
public static MachineState valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.
java.lang.IllegalArgumentException
- if this enum type has no constant
with the specified name
java.lang.NullPointerException
- if the argument is nullpublic int value()
public static MachineState fromValue(long v)
public static MachineState fromValue(java.lang.String v)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |