- Timestamp:
- Jun 26, 2007 12:19:05 PM (18 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ConsoleImpl.cpp
r3278 r3288 3115 3115 AutoLock alock (this); 3116 3116 3117 /* VM might have been stopped when this message arrives */ 3118 if (mMachineState < MachineState_Running || 3119 mMachineState == MachineState_Stopping) 3120 { 3117 /* protect mpVM (we don't need error info, since it's a callback) */ 3118 AutoVMCallerQuiet autoVMCaller (this); 3119 if (FAILED (autoVMCaller.rc())) 3120 { 3121 /* The VM may be no more operational when this message arrives 3122 * (e.g. it may be Saving or Stopping or just PoweredOff) -- 3123 * autoVMCaller.rc() will return a failure in this case. */ 3121 3124 LogFlowThisFunc (("Attach request ignored (mMachineState=%d).\n", 3122 3125 mMachineState)); 3123 return E_FAIL;3126 return autoVMCaller.rc(); 3124 3127 } 3125 3128 … … 3130 3133 return S_OK; 3131 3134 } 3132 3133 /* protect mpVM */3134 AutoVMCaller autoVMCaller (this);3135 CheckComRCReturnRC (autoVMCaller.rc());3136 3135 3137 3136 /* Don't proceed unless we've found the usb controller. */ … … 3198 3197 } 3199 3198 3200 /* VM might have been stopped when this message arrives */ 3199 3201 3200 if (device.isNull()) 3202 3201 { 3203 LogFlowThisFunc (("Device not found.\n")); 3204 if (mMachineState < MachineState_Running || 3205 mMachineState == MachineState_Stopping) 3202 LogFlowThisFunc (("USB device not found.\n")); 3203 3204 /* The VM may be no more operational when this message arrives 3205 * (e.g. it may be Saving or Stopping or just PoweredOff). Use 3206 * AutoVMCaller to detect it -- AutoVMCaller::rc() will return a 3207 * failure in this case. */ 3208 3209 AutoVMCallerQuiet autoVMCaller (this); 3210 if (FAILED (autoVMCaller.rc())) 3206 3211 { 3207 3212 LogFlowThisFunc (("Detach request ignored (mMachineState=%d).\n", 3208 3213 mMachineState)); 3209 return E_FAIL; 3210 } 3211 /* the device must be in the list */ 3214 return autoVMCaller.rc(); 3215 } 3216 3217 /* the device must be in the list otherwise */ 3212 3218 AssertFailedReturn (E_FAIL); 3213 3219 } -
trunk/src/VBox/Main/include/ConsoleImpl.h
r3278 r3288 272 272 273 273 /** 274 * Same as AutoVMCaller but doesn't set extended error info on failure. 275 */ 276 typedef AutoVMCallerBase <true, false> AutoVMCallerQuiet; 277 278 /** 274 279 * Base template for SaveVMPtr and SaveVMPtrQuiet. 275 280 */
Note:
See TracChangeset
for help on using the changeset viewer.