Changeset 4297 in vbox for trunk/src/VBox/Main
- Timestamp:
- Aug 22, 2007 8:49:37 PM (18 years ago)
- svn:sync-xref-src-repo-rev:
- 23820
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ConsoleImpl.cpp
r4270 r4297 1468 1468 1469 1469 if (mMachineState != MachineState_Running && 1470 mMachineState != MachineState_Paused) 1470 mMachineState != MachineState_Paused && 1471 mMachineState != MachineState_Stuck) 1471 1472 { 1472 1473 /* extra nice error message for a common case */ … … 1891 1892 // Paused, Starting, Saving, Stopping, etc? if not, we should make a 1892 1893 // 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. 1895 1900 * 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). 1900 1906 */ 1901 if (mMachineState < MachineState_Running) 1907 if (mMachineState != MachineState_Running && 1908 mMachineState != MachineState_Paused) 1902 1909 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); 1905 1913 1906 1914 /* protect mpVM */ … … 1999 2007 AutoLock alock (this); 2000 2008 2009 /// @todo see @todo in AttachUSBDevice() about the Paused state 2001 2010 if (mMachineState == MachineState_Saved) 2002 2011 return setError (E_FAIL, 2003 tr ("Cannot create a transient shared folder on a"2012 tr ("Cannot create a transient shared folder on the " 2004 2013 "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); 2005 2019 2006 2020 ComObjPtr <SharedFolder> sharedFolder; … … 2065 2079 AutoLock alock (this); 2066 2080 2081 /// @todo see @todo in AttachUSBDevice() about the Paused state 2067 2082 if (mMachineState == MachineState_Saved) 2068 2083 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); 2071 2091 2072 2092 ComObjPtr <SharedFolder> sharedFolder; … … 2124 2144 AutoLock alock (this); 2125 2145 2126 if (mMachineState > MachineState_Running && 2127 mMachineState != MachineState_Paused) 2146 if (mMachineState > MachineState_Paused) 2128 2147 { 2129 2148 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); 2131 2152 } 2132 2153 … … 2296 2317 if (mMachineState >= MachineState_Running) 2297 2318 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); 2299 2322 2300 2323 MachineState_T machineState = MachineState_InvalidMachineState; … … 2315 2338 if (mMachineState >= MachineState_Running) 2316 2339 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); 2318 2343 2319 2344 MachineState_T machineState = MachineState_InvalidMachineState; … … 2334 2359 if (mMachineState >= MachineState_Running) 2335 2360 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); 2337 2364 2338 2365 MachineState_T machineState = MachineState_InvalidMachineState; … … 3869 3896 AssertMsg (mMachineState == MachineState_Running || 3870 3897 mMachineState == MachineState_Paused || 3898 mMachineState == MachineState_Stuck || 3871 3899 mMachineState == MachineState_Saving || 3872 3900 mMachineState == MachineState_Starting || … … 4548 4576 that->setMachineState (MachineState_Paused); 4549 4577 } 4578 4579 break; 4550 4580 } 4551 4581 … … 4572 4602 that->setMachineState (MachineState_Running); 4573 4603 } 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; 4574 4621 } 4575 4622 -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r4269 r4297 111 111 <enum 112 112 name="MachineState" 113 uuid=" b8bb15f7-4fa2-4e84-87a8-b4677dd87deb"113 uuid="73bf04d0-7c4f-4684-9abf-d65a9ad74343" 114 114 > 115 115 <desc> … … 118 118 </desc> 119 119 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> 121 127 <const name="PoweredOff" value="1"> 122 128 <desc> … … 150 156 action). 151 157 </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> 152 163 </desc> 153 164 </const> … … 156 167 The execution of the machine has been paused. 157 168 <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. 162 178 </note> 163 179 </desc> 164 180 </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"> 166 191 <desc> 167 192 The machine is being started after … … 170 195 </desc> 171 196 </const> 172 <const name="Stopping" value=" 7">197 <const name="Stopping" value="8"> 173 198 <desc> 174 199 The machine is being normally stopped … … 177 202 </desc> 178 203 </const> 179 <const name="Saving" value=" 8">204 <const name="Saving" value="9"> 180 205 <desc> 181 206 The machine is saving its execution state to a file as a … … 185 210 </desc> 186 211 </const> 187 <const name="Restoring" value=" 9">212 <const name="Restoring" value="10"> 188 213 <desc> 189 214 The execution state of the machine is being restored from a file … … 192 217 </desc> 193 218 </const> 194 <const name="Discarding" value="1 0">219 <const name="Discarding" value="11"> 195 220 <desc> 196 221 A snapshot of the machine is being discarded after calling
Note:
See TracChangeset
for help on using the changeset viewer.