Changeset 235 in vbox for trunk/src/VBox
- Timestamp:
- Jan 23, 2007 1:10:43 PM (18 years ago)
- svn:sync-xref-src-repo-rev:
- 17761
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ConsoleImpl.cpp
r1 r235 3311 3311 while (it != mCallbacks.end()) 3312 3312 (*it++)->OnKeyboardLedsChange(fNumLock, fCapsLock, fScrollLock); 3313 } 3314 3315 /** 3316 * @note Locks this object for reading. 3317 */ 3318 void Console::onRuntimeError (BOOL aFatal, INPTR BSTR aErrorID, INPTR BSTR aMessage) 3319 { 3320 AutoCaller autoCaller (this); 3321 AssertComRCReturnVoid (autoCaller.rc()); 3322 3323 AutoReaderLock alock (this); 3324 3325 CallbackList::iterator it = mCallbacks.begin(); 3326 while (it != mCallbacks.end()) 3327 (*it++)->OnRuntimeError (aFatal, aErrorID, aMessage); 3313 3328 } 3314 3329 … … 5322 5337 #undef STR_CONV 5323 5338 5324 /* 5325 * Register VM state change handler 5326 */ 5327 rc = VMR3AtStateRegister(pVM, Console::vmstateChangeCallback, pConsole); 5328 AssertRC (rc); 5329 5330 /* 5331 * Save the VM pointer in the machine object. 5332 */ 5339 /* Register VM state change handler */ 5340 int rc2 = VMR3AtStateRegister (pVM, Console::vmstateChangeCallback, pConsole); 5341 AssertRC (rc2); 5342 if (VBOX_SUCCESS (rc)) 5343 rc = rc2; 5344 5345 /* Register VM runtime error handler */ 5346 rc2 = VMR3AtRuntimeErrorRegister (pVM, Console::setVMRuntimeErrorCallback, pConsole); 5347 AssertRC (rc2); 5348 if (VBOX_SUCCESS (rc)) 5349 rc = rc2; 5350 5351 /* Save the VM pointer in the machine object */ 5333 5352 pConsole->mpVM = pVM; 5334 5353 … … 5709 5728 AssertReturnVoid (task); 5710 5729 5730 /* we ignore RT_SRC_POS_DECL arguments to avoid confusion of end-users */ 5711 5731 HRESULT hrc = setError (E_FAIL, tr ("%N.\n" 5712 "At '%s' (%d) in %s.\n" 5713 "VBox status code: %d %Vrc\n"), 5732 "VBox status code: %d (%Vrc)"), 5714 5733 tr (pszFormat), &args, 5715 pszFile, iLine, pszFunction,5716 5734 rc, rc); 5717 5735 task->mProgress->notifyComplete (hrc); 5718 5736 } 5719 5737 5720 5738 /** 5739 * VM runtime error callback function. 5740 * See VMSetRuntimeError for the detailed description of parameters. 5741 * 5742 * @param pVM The VM handle. 5743 * @param pvUser The user argument. 5744 * @param fFatal Whether it is a fatal error or not. 5745 * @param pszErrorID Error ID string. 5746 * @param pszFormat Error message format string. 5747 * @param args Error message arguments. 5748 * @thread EMT. 5749 */ 5750 /* static */ DECLCALLBACK(void) 5751 Console::setVMRuntimeErrorCallback (PVM pVM, void *pvUser, bool fFatal, 5752 const char *pszErrorID, 5753 const char *pszFormat, va_list args) 5754 { 5755 LogFlowFuncEnter(); 5756 5757 Console *that = static_cast <Console *> (pvUser); 5758 AssertReturnVoid (that); 5759 5760 Utf8Str message = Utf8StrFmt (pszFormat, args); 5761 5762 LogRel (("Console: VM runtime error: fatal=%RTbool, " 5763 "errorID=%s message=\"%s\"\n", 5764 fFatal, pszErrorID, message.raw())); 5765 5766 that->onRuntimeError (BOOL (fFatal), Bstr (pszErrorID), Bstr (message)); 5767 5768 LogFlowFuncLeave(); 5769 } 5721 5770 5722 5771 /** -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r132 r235 2435 2435 <li><i>fatal</i></li> 2436 2436 <li><i>non-fatal with retry</i></li> 2437 <li><i>non-fatal w ithout retry</i></li>2437 <li><i>non-fatal warnings</i></li> 2438 2438 </ul> 2439 2439 … … 2446 2446 Resuming the execution can lead to unpredictable results. 2447 2447 2448 <b>Non-fatal</b> errors a re indicated by the2448 <b>Non-fatal</b> errors and warnings are indicated by the 2449 2449 @a fatal parameter set to <tt>false</tt>. If the virtual machine 2450 2450 is in the Paused state by the time the error notification is 2451 received, it means that the user can retrythe machine2451 received, it means that the user can <i>try to resume</i> the machine 2452 2452 execution after attempting to solve the probem that caused the 2453 2453 error. In this case, the notification handler is supposed … … 2458 2458 the machine execution using the <link to="IConsole::resume()"/> 2459 2459 call. If the machine execution is not Paused during this 2460 notification, then it means this notification is a warning (for2461 example, about a fatal condition that can happen very soon); no2462 anyimmediate action is required from the user, the machine2460 notification, then it means this notification is a <i>warning</i> 2461 (for example, about a fatal condition that can happen very soon); 2462 no immediate action is required from the user, the machine 2463 2463 continues its normal execution. 2464 2464 … … 2471 2471 Currently, the following error identificators are known: 2472 2472 <ul> 2473 <li> "HostMemoryLow"</li>2474 <li> "HostAudioNotResponding"</li>2475 <li> "VDIStorageFull"</li>2473 <li><tt>"HostMemoryLow"</tt></li> 2474 <li><tt>"HostAudioNotResponding"</tt></li> 2475 <li><tt>"VDIStorageFull"</tt></li> 2476 2476 </ul> 2477 2477 -
trunk/src/VBox/Main/include/ConsoleImpl.h
r1 r235 189 189 void onAdditionsStateChange(); 190 190 void onAdditionsOutdated(); 191 void onKeyboardLedsChange(bool fNumLock, bool fCapsLock, bool fScrollLock); 191 void onKeyboardLedsChange (bool fNumLock, bool fCapsLock, bool fScrollLock); 192 void onRuntimeError (BOOL aFatal, INPTR BSTR aErrorID, INPTR BSTR aMessage); 192 193 193 194 static const PDMDRVREG DrvStatusReg; … … 375 376 const char *pszFormat, va_list args); 376 377 378 static DECLCALLBACK(void) 379 setVMRuntimeErrorCallback (PVM pVM, void *pvUser, bool fFatal, 380 const char *pszErrorID, 381 const char *pszFormat, va_list args); 382 377 383 HRESULT captureUSBDevices (PVM pVM); 378 384 void releaseAllUSBDevices (void);
Note:
See TracChangeset
for help on using the changeset viewer.