Changeset 18645 in vbox
- Timestamp:
- Apr 2, 2009 3:38:31 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 27 edited
-
include/VBox/pdmdev.h (modified) (8 diffs)
-
include/VBox/pdmdrv.h (modified) (4 diffs)
-
include/VBox/pdmusb.h (modified) (2 diffs)
-
include/VBox/vmapi.h (modified) (2 diffs)
-
src/VBox/Devices/Audio/DevIchAc97.cpp (modified) (2 diffs)
-
src/VBox/Devices/Audio/DevSB16.cpp (modified) (1 diff)
-
src/VBox/Devices/Network/DevE1000.cpp (modified) (1 diff)
-
src/VBox/Devices/Network/DevPCNet.cpp (modified) (1 diff)
-
src/VBox/Devices/Network/DrvNAT.cpp (modified) (3 diffs)
-
src/VBox/Devices/Serial/DrvHostSerial.cpp (modified) (4 diffs)
-
src/VBox/Devices/Storage/DevATA.cpp (modified) (4 diffs)
-
src/VBox/Devices/Storage/DrvHostBase.cpp (modified) (1 diff)
-
src/VBox/Frontends/VBoxBFE/VBoxBFE.cpp (modified) (1 diff)
-
src/VBox/Main/ConsoleImpl.cpp (modified) (2 diffs)
-
src/VBox/Main/ConsoleImpl2.cpp (modified) (2 diffs)
-
src/VBox/Main/include/ConsoleImpl.h (modified) (1 diff)
-
src/VBox/VMM/PDMDevHlp.cpp (modified) (2 diffs)
-
src/VBox/VMM/PDMDriver.cpp (modified) (2 diffs)
-
src/VBox/VMM/PGM.cpp (modified) (2 diffs)
-
src/VBox/VMM/PGMPhys.cpp (modified) (1 diff)
-
src/VBox/VMM/VM.cpp (modified) (2 diffs)
-
src/VBox/VMM/VMInternal.h (modified) (3 diffs)
-
src/VBox/VMM/VMM.cpp (modified) (1 diff)
-
src/VBox/VMM/VMMAll/VMAll.cpp (modified) (8 diffs)
-
src/VBox/VMM/VMMGC/PDMGCDevice.cpp (modified) (3 diffs)
-
src/VBox/VMM/VMMR0/PDMR0Device.cpp (modified) (3 diffs)
-
src/VBox/VMM/testcase/tstVMREQ.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/pdmdev.h
r18143 r18645 2113 2113 * @returns VBox status code. 2114 2114 * @param pDevIns Device instance. 2115 * @param fF atal Whether it is a fatal error or not.2116 * @param pszErrorI DError ID string.2115 * @param fFlags The action flags. See VMSETRTERR_FLAGS_*. 2116 * @param pszErrorId Error ID string. 2117 2117 * @param pszFormat Error message format string. 2118 2118 * @param ... Error message arguments. 2119 2119 */ 2120 DECLR3CALLBACKMEMBER(int, pfnVMSetRuntimeError,(PPDMDEVINS pDevIns, bool fFatal, const char *pszErrorID, const char *pszFormat, ...));2120 DECLR3CALLBACKMEMBER(int, pfnVMSetRuntimeError,(PPDMDEVINS pDevIns, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, ...)); 2121 2121 2122 2122 /** … … 2125 2125 * @returns VBox status code. 2126 2126 * @param pDevIns Device instance. 2127 * @param fF atal Whether it is a fatal error or not.2128 * @param pszErrorI DError ID string.2127 * @param fFlags The action flags. See VMSETRTERR_FLAGS_*. 2128 * @param pszErrorId Error ID string. 2129 2129 * @param pszFormat Error message format string. 2130 2130 * @param va Error message arguments. 2131 2131 */ 2132 DECLR3CALLBACKMEMBER(int, pfnVMSetRuntimeErrorV,(PPDMDEVINS pDevIns, bool fFatal, const char *pszErrorID, const char *pszFormat, va_list va));2132 DECLR3CALLBACKMEMBER(int, pfnVMSetRuntimeErrorV,(PPDMDEVINS pDevIns, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, va_list va)); 2133 2133 2134 2134 /** … … 2950 2950 * @returns VBox status code. 2951 2951 * @param pDevIns Device instance. 2952 * @param fF atal Whether it is a fatal error or not.2953 * @param pszErrorI DError ID string.2952 * @param fFlags The action flags. See VMSETRTERR_FLAGS_*. 2953 * @param pszErrorId Error ID string. 2954 2954 * @param pszFormat Error message format string. 2955 2955 * @param ... Error message arguments. 2956 2956 */ 2957 DECLRCCALLBACKMEMBER(int, pfnVMSetRuntimeError,(PPDMDEVINS pDevIns, bool fFatal, const char *pszErrorID, const char *pszFormat, ...));2957 DECLRCCALLBACKMEMBER(int, pfnVMSetRuntimeError,(PPDMDEVINS pDevIns, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, ...)); 2958 2958 2959 2959 /** … … 2962 2962 * @returns VBox status code. 2963 2963 * @param pDevIns Device instance. 2964 * @param fF atal Whether it is a fatal error or not.2965 * @param pszErrorI DError ID string.2964 * @param fFlags The action flags. See VMSETRTERR_FLAGS_*. 2965 * @param pszErrorId Error ID string. 2966 2966 * @param pszFormat Error message format string. 2967 2967 * @param va Error message arguments. 2968 2968 */ 2969 DECLRCCALLBACKMEMBER(int, pfnVMSetRuntimeErrorV,(PPDMDEVINS pDevIns, bool fFatal, const char *pszErrorID, const char *pszFormat, va_list va));2969 DECLRCCALLBACKMEMBER(int, pfnVMSetRuntimeErrorV,(PPDMDEVINS pDevIns, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, va_list va)); 2970 2970 2971 2971 /** … … 3088 3088 * @returns VBox status code. 3089 3089 * @param pDevIns Device instance. 3090 * @param fF atal Whether it is a fatal error or not.3091 * @param pszErrorI DError ID string.3090 * @param fFlags The action flags. See VMSETRTERR_FLAGS_*. 3091 * @param pszErrorId Error ID string. 3092 3092 * @param pszFormat Error message format string. 3093 3093 * @param ... Error message arguments. 3094 3094 */ 3095 DECLR0CALLBACKMEMBER(int, pfnVMSetRuntimeError,(PPDMDEVINS pDevIns, bool fFatal, const char *pszErrorID, const char *pszFormat, ...));3095 DECLR0CALLBACKMEMBER(int, pfnVMSetRuntimeError,(PPDMDEVINS pDevIns, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, ...)); 3096 3096 3097 3097 /** … … 3100 3100 * @returns VBox status code. 3101 3101 * @param pDevIns Device instance. 3102 * @param fF atal Whether it is a fatal error or not.3103 * @param pszErrorI DError ID string.3102 * @param fFlags The action flags. See VMSETRTERR_FLAGS_*. 3103 * @param pszErrorId Error ID string. 3104 3104 * @param pszFormat Error message format string. 3105 3105 * @param va Error message arguments. 3106 3106 */ 3107 DECLR0CALLBACKMEMBER(int, pfnVMSetRuntimeErrorV,(PPDMDEVINS pDevIns, bool fFatal, const char *pszErrorID, const char *pszFormat, va_list va));3107 DECLR0CALLBACKMEMBER(int, pfnVMSetRuntimeErrorV,(PPDMDEVINS pDevIns, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, va_list va)); 3108 3108 3109 3109 /** … … 3241 3241 * Set the VM runtime error. See PDMDevHlpVMSetRuntimeError() for printf like message formatting. 3242 3242 */ 3243 #define PDMDEV_SET_RUNTIME_ERROR(pDevIns, fF atal, pszErrorID, pszError) \3244 PDMDevHlpVMSetRuntimeError(pDevIns, fF atal, pszErrorID, "%s", pszError)3243 #define PDMDEV_SET_RUNTIME_ERROR(pDevIns, fFlags, pszErrorId, pszError) \ 3244 PDMDevHlpVMSetRuntimeError(pDevIns, fFlags, pszErrorId, "%s", pszError) 3245 3245 3246 3246 /** @def PDMDEVINS_2_RCPTR … … 3827 3827 * @copydoc PDMDEVHLPR3::pfnVMSetRuntimeError 3828 3828 */ 3829 DECLINLINE(int) PDMDevHlpVMSetRuntimeError(PPDMDEVINS pDevIns, bool fFatal, const char *pszErrorID, const char *pszFormat, ...)3829 DECLINLINE(int) PDMDevHlpVMSetRuntimeError(PPDMDEVINS pDevIns, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, ...) 3830 3830 { 3831 3831 va_list va; 3832 3832 int rc; 3833 3833 va_start(va, pszFormat); 3834 rc = pDevIns->CTX_SUFF(pDevHlp)->pfnVMSetRuntimeErrorV(pDevIns, fF atal, pszErrorID, pszFormat, va);3834 rc = pDevIns->CTX_SUFF(pDevHlp)->pfnVMSetRuntimeErrorV(pDevIns, fFlags, pszErrorId, pszFormat, va); 3835 3835 va_end(va); 3836 3836 return rc; -
trunk/include/VBox/pdmdrv.h
r15940 r18645 453 453 * @returns VBox status code. 454 454 * @param pDrvIns Driver instance. 455 * @param fF atal Whether it is a fatal error or not.456 * @param pszErrorI DError ID string.455 * @param fFlags The action flags. See VMSETRTERR_FLAGS_*. 456 * @param pszErrorId Error ID string. 457 457 * @param pszFormat Error message format string. 458 458 * @param ... Error message arguments. 459 459 */ 460 DECLR3CALLBACKMEMBER(int, pfnVMSetRuntimeError,(PPDMDRVINS pDrvIns, bool fFatal, const char *pszErrorID, const char *pszFormat, ...));460 DECLR3CALLBACKMEMBER(int, pfnVMSetRuntimeError,(PPDMDRVINS pDrvIns, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, ...)); 461 461 462 462 /** … … 465 465 * @returns VBox status code. 466 466 * @param pDrvIns Driver instance. 467 * @param fF atal Whether it is a fatal error or not.468 * @param pszErrorI DError ID string.467 * @param fFlags The action flags. See VMSETRTERR_FLAGS_*. 468 * @param pszErrorId Error ID string. 469 469 * @param pszFormat Error message format string. 470 470 * @param va Error message arguments. 471 471 */ 472 DECLR3CALLBACKMEMBER(int, pfnVMSetRuntimeErrorV,(PPDMDRVINS pDrvIns, bool fFatal, const char *pszErrorID, const char *pszFormat, va_list va));472 DECLR3CALLBACKMEMBER(int, pfnVMSetRuntimeErrorV,(PPDMDRVINS pDrvIns, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, va_list va)); 473 473 474 474 /** … … 769 769 * @copydoc PDMDRVHLP::pfnVMSetRuntimeError 770 770 */ 771 DECLINLINE(int) PDMDrvHlpVMSetRuntimeError(PPDMDRVINS pDrvIns, bool fFatal, const char *pszErrorID, const char *pszFormat, ...)771 DECLINLINE(int) PDMDrvHlpVMSetRuntimeError(PPDMDRVINS pDrvIns, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, ...) 772 772 { 773 773 va_list va; 774 774 int rc; 775 775 va_start(va, pszFormat); 776 rc = pDrvIns->pDrvHlp->pfnVMSetRuntimeErrorV(pDrvIns, fF atal, pszErrorID, pszFormat, va);776 rc = pDrvIns->pDrvHlp->pfnVMSetRuntimeErrorV(pDrvIns, fFlags, pszErrorId, pszFormat, va); 777 777 va_end(va); 778 778 return rc; … … 782 782 * Set the VM runtime error. See PDMDrvHlpVMSetRuntimeError() for printf like message formatting. 783 783 */ 784 #define PDMDRV_SET_RUNTIME_ERROR(pDrvIns, fF atal, pszErrorID, pszError) \785 PDMDrvHlpVMSetRuntimeError(pDrvIns, fF atal, pszErrorID, "%s", pszError)784 #define PDMDRV_SET_RUNTIME_ERROR(pDrvIns, fFlags, pszErrorId, pszError) \ 785 PDMDrvHlpVMSetRuntimeError(pDrvIns, fFlags, pszErrorId, "%s", pszError) 786 786 787 787 #endif /* IN_RING3 */ -
trunk/include/VBox/pdmusb.h
r13005 r18645 555 555 * @returns VBox status code. 556 556 * @param pUsbIns The USB device instance. 557 * @param fF atal Whether it is a fatal error or not.558 * @param pszErrorI DError ID string.557 * @param fFlags The action flags. See VMSETRTERR_FLAGS_*. 558 * @param pszErrorId Error ID string. 559 559 * @param pszFormat Error message format string. 560 560 * @param va Error message arguments. 561 561 */ 562 DECLR3CALLBACKMEMBER(int, pfnVMSetRuntimeErrorV,(PPDMUSBINS pUsbIns, bool fFatal, const char *pszErrorID, const char *pszFormat, va_list va));562 DECLR3CALLBACKMEMBER(int, pfnVMSetRuntimeErrorV,(PPDMUSBINS pUsbIns, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, va_list va)); 563 563 564 564 /** … … 660 660 661 661 /** @def PDMUSB_SET_ERROR 662 * Set the VM error. See PDMDevHlpVMSetError() for printf like message formatting. 662 * Set the VM error. See PDMUsbHlpVMSetError() for printf like message 663 * formatting. 663 664 */ 664 665 #define PDMUSB_SET_ERROR(pUsbIns, rc, pszError) \ 665 PDM DevHlpVMSetError(pUsbIns, rc, RT_SRC_POS, "%s", pszError)666 PDMUsbHlpVMSetError(pUsbIns, rc, RT_SRC_POS, "%s", pszError) 666 667 667 668 /** @def PDMUSB_SET_RUNTIME_ERROR 668 * Set the VM runtime error. See PDMDevHlpVMSetRuntimeError() for printf like message formatting. 669 */ 670 #define PDMUSB_SET_RUNTIME_ERROR(pUsbIns, fFatal, pszErrorID, pszError) \ 671 PDMDevHlpVMSetRuntimeError(pUsbIns, fFatal, pszErrorID, "%s", pszError) 669 * Set the VM runtime error. See PDMUsbHlpVMSetRuntimeError() for printf like 670 * message formatting. 671 */ 672 #define PDMUSB_SET_RUNTIME_ERROR(pUsbIns, fFlags, pszErrorId, pszError) \ 673 PDMUsbHlpVMSetRuntimeError(pUsbIns, fFlags, pszErrorId, "%s", pszError) 672 674 673 675 -
trunk/include/VBox/vmapi.h
r15317 r18645 131 131 /** 132 132 * VM runtime error callback function. 133 * 133 134 * See VMSetRuntimeError for the detailed description of parameters. 134 135 * 135 136 * @param pVM The VM handle. 136 137 * @param pvUser The user argument. 137 * @param fF atal Whether it is a fatal error or not.138 * @param pszErrorI DError ID string.138 * @param fFlags The error flags. 139 * @param pszErrorId Error ID string. 139 140 * @param pszFormat Error message format string. 140 * @param args Error message arguments. 141 */ 142 typedef DECLCALLBACK(void) FNVMATRUNTIMEERROR(PVM pVM, void *pvUser, bool fFatal, 143 const char *pszErrorID, 144 const char *pszFormat, va_list args); 141 * @param va Error message arguments. 142 */ 143 typedef DECLCALLBACK(void) FNVMATRUNTIMEERROR(PVM pVM, void *pvUser, uint32_t fFlags, const char *pszErrorId, 144 const char *pszFormat, va_list va); 145 145 /** Pointer to a VM runtime error callback. */ 146 146 typedef FNVMATRUNTIMEERROR *PFNVMATRUNTIMEERROR; 147 147 148 VMMDECL(int) VMSetRuntimeError(PVM pVM, bool fFatal, const char *pszErrorID, const char *pszFormat, ...); 149 VMMDECL(int) VMSetRuntimeErrorV(PVM pVM, bool fFatal, const char *pszErrorID, const char *pszFormat, va_list args); 148 VMMDECL(int) VMSetRuntimeError(PVM pVM, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, ...); 149 VMMDECL(int) VMSetRuntimeErrorV(PVM pVM, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, va_list args); 150 151 /** @name VMSetRuntimeError fFlags 152 * When no flags are given the VM will continue running and it's up to the front 153 * end to take action on the error condition. 154 * 155 * @{ */ 156 /** The error is fatal. 157 * The VM is not in a state where it can be saved and will enter a state 158 * where it can no longer execute code. The caller must propagate status 159 * codes. */ 160 #define VMSETRTERR_FLAGS_FATAL RT_BIT_32(0) 161 /** Suspend the VM after, or if possible before, raising the error on EMT. The 162 * caller must propagate status codes. */ 163 #define VMSETRTERR_FLAGS_SUSPEND RT_BIT_32(1) 164 /** Don't wait for the EMT to handle the request. 165 * Only valid when on a worker thread and there is a high risk of a dead 166 * lock. Be careful not to flood the user with errors. */ 167 #define VMSETRTERR_FLAGS_NO_WAIT RT_BIT_32(2) 168 /** @} */ 150 169 151 170 … … 398 417 VMMR3DECL(int) VMR3AtRuntimeErrorRegister(PVM pVM, PFNVMATRUNTIMEERROR pfnAtRuntimeError, void *pvUser); 399 418 VMMR3DECL(int) VMR3AtRuntimeErrorDeregister(PVM pVM, PFNVMATRUNTIMEERROR pfnAtRuntimeError, void *pvUser); 400 VMMR3DECL( void)VMR3SetRuntimeErrorWorker(PVM pVM);419 VMMR3DECL(int) VMR3SetRuntimeErrorWorker(PVM pVM); 401 420 VMMR3DECL(int) VMR3ReqCall(PVM pVM, VMREQDEST enmDest, PVMREQ *ppReq, unsigned cMillies, PFNRT pfnFunction, unsigned cArgs, ...); 402 421 VMMR3DECL(int) VMR3ReqCallVoidU(PUVM pUVM, VMREQDEST enmDest, PVMREQ *ppReq, unsigned cMillies, PFNRT pfnFunction, unsigned cArgs, ...); -
trunk/src/VBox/Devices/Audio/DevIchAc97.cpp
r12978 r18645 1680 1680 ac97Reset (pDevIns); 1681 1681 1682 PDMDevHlpVMSetRuntimeError (pDevIns, false, "HostAudioNotResponding",1682 PDMDevHlpVMSetRuntimeError (pDevIns, 0 /*fFlags*/, "HostAudioNotResponding", 1683 1683 N_ ("No audio devices could be opened. Selecting the NULL audio backend " 1684 1684 "with the consequence that no sound is audible")); … … 1696 1696 len += RTStrPrintf (szMissingVoices + len, sizeof(szMissingVoices) - len, len ? ", PCM_mic" : "PCM_mic"); 1697 1697 1698 PDMDevHlpVMSetRuntimeError (pDevIns, false, "HostAudioNotResponding",1698 PDMDevHlpVMSetRuntimeError (pDevIns, 0 /*fFlags*/, "HostAudioNotResponding", 1699 1699 N_ ("Some audio devices (%s) could not be opened. Guest applications generating audio " 1700 1700 "output or depending on audio input may hang. Make sure your host audio device " -
trunk/src/VBox/Devices/Audio/DevSB16.cpp
r18497 r18645 1836 1836 s->voice = NULL; 1837 1837 AUD_init_null(); 1838 PDMDevHlpVMSetRuntimeError(pDevIns, false, "HostAudioNotResponding",1838 PDMDevHlpVMSetRuntimeError(pDevIns, 0 /*fFlags*/, "HostAudioNotResponding", 1839 1839 N_("No audio devices could be opened. Selecting the NULL audio backend " 1840 1840 "with the consequence that no sound is audible")); -
trunk/src/VBox/Devices/Network/DevE1000.cpp
r18622 r18645 4853 4853 if (rc == VINF_NAT_DNS) 4854 4854 { 4855 VMSetRuntimeError(PDMDevHlpGetVM(pDevIns), false, "NoDNSforNAT",4856 N_("A Domain Name Server (DNS) for NAT networking could not be determined. Ensure that your host is correctly connected to an ISP. If you ignore this warning the guest will not be able to perform nameserver lookups and it will probably observe delays if trying so"));4855 PDMDevHlpVMSetRuntimeError(pDevIns, 0 /*fFlags*/, "NoDNSforNAT", 4856 N_("A Domain Name Server (DNS) for NAT networking could not be determined. Ensure that your host is correctly connected to an ISP. If you ignore this warning the guest will not be able to perform nameserver lookups and it will probably observe delays if trying so")); 4857 4857 } 4858 4858 pState->pDrv = (PPDMINETWORKCONNECTOR) -
trunk/src/VBox/Devices/Network/DevPCNet.cpp
r18573 r18645 4991 4991 { 4992 4992 #ifdef RT_OS_LINUX 4993 VMSetRuntimeError(PDMDevHlpGetVM(pDevIns), false, "NoDNSforNAT",4994 N_("A Domain Name Server (DNS) for NAT networking could not be determined. Please check your /etc/resolv.conf for <tt>nameserver</tt> entries. Either add one manually (<i>man resolv.conf</i>) or ensure that your host is correctly connected to an ISP. If you ignore this warning the guest will not be able to perform nameserver lookups and it will probably observe delays if trying so"));4993 PDMDevHlpVMSetRuntimeError(pDevIns, 0 /*fFlags*/, "NoDNSforNAT", 4994 N_("A Domain Name Server (DNS) for NAT networking could not be determined. Please check your /etc/resolv.conf for <tt>nameserver</tt> entries. Either add one manually (<i>man resolv.conf</i>) or ensure that your host is correctly connected to an ISP. If you ignore this warning the guest will not be able to perform nameserver lookups and it will probably observe delays if trying so")); 4995 4995 #else 4996 VMSetRuntimeError(PDMDevHlpGetVM(pDevIns), false, "NoDNSforNAT",4997 N_("A Domain Name Server (DNS) for NAT networking could not be determined. Ensure that your host is correctly connected to an ISP. If you ignore this warning the guest will not be able to perform nameserver lookups and it will probably observe delays if trying so"));4996 PDMDevHlpVMSetRuntimeError(pDevIns, 0 /*fFlags*/, "NoDNSforNAT", 4997 N_("A Domain Name Server (DNS) for NAT networking could not be determined. Ensure that your host is correctly connected to an ISP. If you ignore this warning the guest will not be able to perform nameserver lookups and it will probably observe delays if trying so")); 4998 4998 #endif 4999 4999 } -
trunk/src/VBox/Devices/Network/DrvNAT.cpp
r17655 r18645 387 387 388 388 int cChangedFDs = poll(polls, nFDs + 1, ms ? ms : -1); 389 #ifndef RT_OS_LINUX /* 2.6.23 + gdb -> hitting all the time. probably a bug in poll/ptrace/whatever. */ 389 390 AssertRelease(cChangedFDs >= 0); 391 #endif 390 392 if (cChangedFDs >= 0) 391 393 { … … 397 399 size_t cbRead; 398 400 int counter = 0; 399 /* 400 * drvNATSend decoupled so we don't know how many times 401 /* 402 * drvNATSend decoupled so we don't know how many times 401 403 * device's thread sends before we've entered multiplex, 402 404 * so to avoid false alarm drain pipe here to the very end 403 405 * 404 * @todo: Probably we should counter drvNATSend to count how 405 * deep pipe has been filed before drain. 406 * @todo: Probably we should counter drvNATSend to count how 407 * deep pipe has been filed before drain. 406 408 * 407 409 * XXX:Make it reading exactly we need to drain the pipe. … … 564 566 cDroppedPackets++; 565 567 } 566 else 568 else 567 569 { 568 570 LogRel(("NAT: %d messages suppressed about dropping package (couldn't allocate queue item)\n", cDroppedPackets)); -
trunk/src/VBox/Devices/Serial/DrvHostSerial.cpp
r16527 r18645 974 974 { 975 975 ioctl_error: 976 PDMDrvHlpVMSetRuntimeError(pDrvIns, false, "DrvHostSerialFail",976 PDMDrvHlpVMSetRuntimeError(pDrvIns, 0 /*fFlags*/, "DrvHostSerialFail", 977 977 N_("Ioctl failed for serial host device '%s' (%Rrc). The device will not work properly"), 978 978 pThis->pszDevicePath, RTErrConvertFromErrno(errno)); … … 990 990 if (rc < 0) 991 991 { 992 PDMDrvHlpVMSetRuntimeError(pDrvIns, false, "DrvHostSerialFail",992 PDMDrvHlpVMSetRuntimeError(pDrvIns, 0 /*fFlags*/, "DrvHostSerialFail", 993 993 N_("Ioctl failed for serial host device '%s' (%Rrc). The device will not work properly"), 994 994 pThis->pszDevicePath, RTErrConvertFromErrno(errno)); … … 1092 1092 1093 1093 ioctl_error: 1094 PDMDrvHlpVMSetRuntimeError(pDrvIns, false, "DrvHostSerialFail",1094 PDMDrvHlpVMSetRuntimeError(pDrvIns, 0 /*fFlags*/, "DrvHostSerialFail", 1095 1095 N_("Ioctl failed for serial host device '%s' (%Rrc). The device will not work properly"), 1096 1096 pThis->pszDevicePath, RTErrConvertFromErrno(errno)); … … 1112 1112 rc = RTThreadPoke(pThread->Thread); 1113 1113 if (RT_FAILURE(rc)) 1114 PDMDrvHlpVMSetRuntimeError(pDrvIns, false, "DrvHostSerialFail",1114 PDMDrvHlpVMSetRuntimeError(pDrvIns, 0 /*fFlags*/, "DrvHostSerialFail", 1115 1115 N_("Suspending serial monitor thread failed for serial device '%s' (%Rrc). The shutdown may take longer than expected"), 1116 1116 pThis->pszDevicePath, RTErrConvertFromErrno(rc)); -
trunk/src/VBox/Devices/Storage/DevATA.cpp
r18434 r18645 1370 1370 int rc; 1371 1371 LogRel(("PIIX3 ATA: Host disk full\n")); 1372 rc = VMSetRuntimeError(PDMDevHlpGetVM(pDevIns), 1373 false, "DevATA_DISKFULL", 1374 N_("Host system reported disk full. VM execution is suspended. You can resume after freeing some space")); 1372 rc = PDMDevHlpVMSetRuntimeError(pDevIns, 0 /*fFlags*/, "DevATA_DISKFULL", 1373 N_("Host system reported disk full. VM execution is suspended. You can resume after freeing some space")); 1375 1374 AssertRC(rc); 1376 1375 } … … 1380 1379 int rc; 1381 1380 LogRel(("PIIX3 ATA: File too big\n")); 1382 rc = VMSetRuntimeError(PDMDevHlpGetVM(pDevIns), 1383 false, "DevATA_FILETOOBIG", 1384 N_("Host system reported that the file size limit of the host file system has been exceeded. VM execution is suspended. You need to move your virtual hard disk to a filesystem which allows bigger files")); 1381 rc = PDMDevHlpVMSetRuntimeError(pDevIns, 0 /*fFlags*/, "DevATA_FILETOOBIG", 1382 N_("Host system reported that the file size limit of the host file system has been exceeded. VM execution is suspended. You need to move your virtual hard disk to a filesystem which allows bigger files")); 1385 1383 AssertRC(rc); 1386 1384 } … … 1390 1388 int rc; 1391 1389 LogRel(("PIIX3 ATA: iSCSI target unavailable\n")); 1392 rc = VMSetRuntimeError(PDMDevHlpGetVM(pDevIns), 1393 false, "DevATA_ISCSIDOWN", 1394 N_("The iSCSI target has stopped responding. VM execution is suspended. You can resume when it is available again")); 1390 rc = PDMDevHlpVMSetRuntimeError(pDevIns, 0 /*fFlags*/, "DevATA_ISCSIDOWN", 1391 N_("The iSCSI target has stopped responding. VM execution is suspended. You can resume when it is available again")); 1395 1392 AssertRC(rc); 1396 1393 } … … 5239 5236 if (!ataWaitForAsyncIOIsIdle(&pThis->aCts[i], 30000)) 5240 5237 { 5241 VMSetRuntimeError(PDMDevHlpGetVM(pDevIns), 5242 false, "DevATA_ASYNCBUSY", 5243 N_("The IDE async I/O thread remained busy after a reset, usually a host filesystem performance problem\n")); 5238 PDMDevHlpVMSetRuntimeError(pDevIns, 0 /*fFlags*/, "DevATA_ASYNCBUSY", 5239 N_("The IDE async I/O thread remained busy after a reset, usually a host filesystem performance problem\n")); 5244 5240 AssertMsgFailed(("Async I/O thread busy after reset\n")); 5245 5241 } -
trunk/src/VBox/Devices/Storage/DrvHostBase.cpp
r18440 r18645 1973 1973 if (pThis->fAttachFailError) 1974 1974 return rc; 1975 int erc = PDMDrvHlpVMSetRuntimeError(pDrvIns, 1976 false,"DrvHost_MOUNTFAIL",1975 int erc = PDMDrvHlpVMSetRuntimeError(pDrvIns, 0 /*fFlags*/, 1976 "DrvHost_MOUNTFAIL", 1977 1977 N_("Cannot attach to host device '%s'"), pszDevice); 1978 1978 AssertRC(erc); -
trunk/src/VBox/Frontends/VBoxBFE/VBoxBFE.cpp
r18265 r18645 1107 1107 * @param pVM The VM handle. 1108 1108 * @param pvUser The user argument. 1109 * @param fF ata Wheather it is a fatal error or not.1109 * @param fFlags The action flags. See VMSETRTERR_FLAGS_*. 1110 1110 * @param pszErrorId Error ID string. 1111 1111 * @param pszError Error message format string. 1112 * @param argsError message arguments.1112 * @param va Error message arguments. 1113 1113 * @thread EMT. 1114 1114 */ 1115 DECLCALLBACK(void) setVMRuntimeErrorCallback(PVM pVM, void *pvUser, bool fFatal,1115 DECLCALLBACK(void) setVMRuntimeErrorCallback(PVM pVM, void *pvUser, uint32_t fFlags, 1116 1116 const char *pszErrorId, 1117 const char *pszFormat, va_list args)1117 const char *pszFormat, va_list va) 1118 1118 { 1119 1119 va_list va2; 1120 va_copy(va2, args); /* Have to make a copy here or GCC will break. */ 1121 RTPrintf("%s: %s!\n%N!\n", fFatal ? "Error" : "Warning", pszErrorId, pszFormat, &va2); 1120 va_copy(va2, va); /* Have to make a copy here or GCC/AMD64 will break. */ 1121 RTPrintf("%s: %s!\n%N!\n", 1122 fFlags & VMSETRTERR_FLAGS_FATAL ? "Error" : "Warning", 1123 pszErrorId, pszFormat, &va2); 1124 RTStrmFlush(g_pStdErr); 1122 1125 va_end(va2); 1123 1126 } -
trunk/src/VBox/Main/ConsoleImpl.cpp
r18591 r18645 5989 5989 * @param pVM The VM handle. 5990 5990 * @param pvUser The user argument. 5991 * @param fF atal Whether it is a fatal error or not.5992 * @param pszErrorI DError ID string.5991 * @param fFlags The action flags. See VMSETRTERR_FLAGS_*. 5992 * @param pszErrorId Error ID string. 5993 5993 * @param pszFormat Error message format string. 5994 * @param argsError message arguments.5994 * @param va Error message arguments. 5995 5995 * @thread EMT. 5996 5996 */ 5997 5997 /* static */ DECLCALLBACK(void) 5998 Console::setVMRuntimeErrorCallback (PVM pVM, void *pvUser, bool fFatal, 5999 const char *pszErrorID, 6000 const char *pszFormat, va_list args) 6001 { 5998 Console::setVMRuntimeErrorCallback (PVM pVM, void *pvUser, uint32_t fFlags, 5999 const char *pszErrorId, 6000 const char *pszFormat, va_list va) 6001 { 6002 bool const fFatal = !!(fFlags & VMSETRTERR_FLAGS_FATAL); 6002 6003 LogFlowFuncEnter(); 6003 6004 … … 6005 6006 AssertReturnVoid (that); 6006 6007 6007 Utf8Str message = Utf8StrFmtVA (pszFormat, args);6008 Utf8Str message = Utf8StrFmtVA (pszFormat, va); 6008 6009 6009 6010 LogRel (("Console: VM runtime error: fatal=%RTbool, " 6010 6011 "errorID=%s message=\"%s\"\n", 6011 fFatal, pszErrorI D, message.raw()));6012 6013 that->onRuntimeError (BOOL (fFatal), Bstr (pszErrorI D), Bstr (message));6012 fFatal, pszErrorId, message.raw())); 6013 6014 that->onRuntimeError (BOOL (fFatal), Bstr (pszErrorId), Bstr (message)); 6014 6015 6015 6016 LogFlowFuncLeave(); -
trunk/src/VBox/Main/ConsoleImpl2.cpp
r18591 r18645 40 40 #include <iprt/dir.h> 41 41 #include <iprt/param.h> 42 #if 0 /* enable to play with lots of memory. */ 43 # include <iprt/env.h> 44 # include <iprt/string.h> 45 #endif 42 46 43 47 #include <VBox/vmapi.h> … … 192 196 hrc = pMachine->COMGETTER(MemorySize)(&cRamMBs); H(); 193 197 #if 0 /* enable to play with lots of memory. */ 194 cRamMBs = 512 * 1024; 198 if (RTEnvExist("VBOX_RAM_SIZE")) 199 cRamMBs = RTStrToUInt64(RTEnvGet("VBOX_RAM_SIZE")) * 1024; 195 200 #endif 196 201 uint64_t const cbRam = cRamMBs * (uint64_t)_1M; -
trunk/src/VBox/Main/include/ConsoleImpl.h
r18348 r18645 458 458 459 459 static DECLCALLBACK(void) 460 setVMRuntimeErrorCallback (PVM pVM, void *pvUser, boolfFatal,461 const char *pszErrorI D,462 const char *pszFormat, va_list args);460 setVMRuntimeErrorCallback (PVM pVM, void *pvUser, uint32_t fFatal, 461 const char *pszErrorId, 462 const char *pszFormat, va_list va); 463 463 464 464 HRESULT captureUSBDevices (PVM pVM); -
trunk/src/VBox/VMM/PDMDevHlp.cpp
r18534 r18645 977 977 978 978 /** @copydoc PDMDEVHLPR3::pfnVMSetRuntimeError */ 979 static DECLCALLBACK(int) pdmR3DevHlp_VMSetRuntimeError(PPDMDEVINS pDevIns, bool fFatal, const char *pszErrorID, const char *pszFormat, ...)979 static DECLCALLBACK(int) pdmR3DevHlp_VMSetRuntimeError(PPDMDEVINS pDevIns, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, ...) 980 980 { 981 981 PDMDEV_ASSERT_DEVINS(pDevIns); 982 982 va_list args; 983 983 va_start(args, pszFormat); 984 int rc = VMSetRuntimeErrorV(pDevIns->Internal.s.pVMR3, fF atal, pszErrorID, pszFormat, args);984 int rc = VMSetRuntimeErrorV(pDevIns->Internal.s.pVMR3, fFlags, pszErrorId, pszFormat, args); 985 985 va_end(args); 986 986 return rc; … … 989 989 990 990 /** @copydoc PDMDEVHLPR3::pfnVMSetRuntimeErrorV */ 991 static DECLCALLBACK(int) pdmR3DevHlp_VMSetRuntimeErrorV(PPDMDEVINS pDevIns, bool fFatal, const char *pszErrorID, const char *pszFormat, va_list va)992 { 993 PDMDEV_ASSERT_DEVINS(pDevIns); 994 int rc = VMSetRuntimeErrorV(pDevIns->Internal.s.pVMR3, fF atal, pszErrorID, pszFormat, va);991 static DECLCALLBACK(int) pdmR3DevHlp_VMSetRuntimeErrorV(PPDMDEVINS pDevIns, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, va_list va) 992 { 993 PDMDEV_ASSERT_DEVINS(pDevIns); 994 int rc = VMSetRuntimeErrorV(pDevIns->Internal.s.pVMR3, fFlags, pszErrorId, pszFormat, va); 995 995 return rc; 996 996 } -
trunk/src/VBox/VMM/PDMDriver.cpp
r18614 r18645 790 790 791 791 /** @copydoc PDMDRVHLP::pfnVMSetRuntimeError */ 792 static DECLCALLBACK(int) pdmR3DrvHlp_VMSetRuntimeError(PPDMDRVINS pDrvIns, bool fFatal, const char *pszErrorID, const char *pszFormat, ...)792 static DECLCALLBACK(int) pdmR3DrvHlp_VMSetRuntimeError(PPDMDRVINS pDrvIns, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, ...) 793 793 { 794 794 PDMDRV_ASSERT_DRVINS(pDrvIns); 795 795 va_list args; 796 796 va_start(args, pszFormat); 797 int rc = VMSetRuntimeErrorV(pDrvIns->Internal.s.pVM, fF atal, pszErrorID, pszFormat, args);797 int rc = VMSetRuntimeErrorV(pDrvIns->Internal.s.pVM, fFlags, pszErrorId, pszFormat, args); 798 798 va_end(args); 799 799 return rc; … … 802 802 803 803 /** @copydoc PDMDRVHLP::pfnVMSetRuntimeErrorV */ 804 static DECLCALLBACK(int) pdmR3DrvHlp_VMSetRuntimeErrorV(PPDMDRVINS pDrvIns, bool fFatal, const char *pszErrorID, const char *pszFormat, va_list va)805 { 806 PDMDRV_ASSERT_DRVINS(pDrvIns); 807 int rc = VMSetRuntimeErrorV(pDrvIns->Internal.s.pVM, fF atal, pszErrorID, pszFormat, va);804 static DECLCALLBACK(int) pdmR3DrvHlp_VMSetRuntimeErrorV(PPDMDRVINS pDrvIns, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, va_list va) 805 { 806 PDMDRV_ASSERT_DRVINS(pDrvIns); 807 int rc = VMSetRuntimeErrorV(pDrvIns->Internal.s.pVM, fFlags, pszErrorId, pszFormat, va); 808 808 return rc; 809 809 } -
trunk/src/VBox/VMM/PGM.cpp
r18617 r18645 3729 3729 * This is called by PGMChangeMode and pgmR3InitPaging(). 3730 3730 * 3731 * @returns VBox status code. 3731 * @returns VBox status code. May suspend or power off the VM on error, but this 3732 * will trigger using FFs and not status codes. 3733 * 3732 3734 * @param pVM VM handle. 3733 3735 * @param enmGuestMode The new guest mode. This is assumed to be different from … … 3928 3930 CPUMGetGuestCpuId(pVM, 1, &u32Dummy, &u32Dummy, &u32Dummy, &u32Features); 3929 3931 if (!(u32Features & X86_CPUID_FEATURE_EDX_PAE)) 3930 { 3931 /* Pause first, then inform Main. */ 3932 rc = VMR3SuspendNoSave(pVM); 3933 AssertRC(rc); 3934 3935 VMSetRuntimeError(pVM, true, "PAEmode", 3936 N_("The guest is trying to switch to the PAE mode which is currently disabled by default in VirtualBox. PAE support can be enabled using the VM settings (General/Advanced)")); 3937 /* we must return VINF_SUCCESS here otherwise the recompiler will assert */ 3938 return VINF_SUCCESS; 3939 } 3932 return VMSetRuntimeError(pVM, VMSETRTERR_FLAGS_FATAL, "PAEmode", 3933 N_("The guest is trying to switch to the PAE mode which is currently disabled by default in VirtualBox. PAE support can be enabled using the VM settings (General/Advanced)")); 3934 3940 3935 GCPhysCR3 = CPUMGetGuestCR3(pVM) & X86_CR3_PAE_PAGE_MASK; 3941 3936 rc = PGM_GST_NAME_PAE(Enter)(pVM, GCPhysCR3); -
trunk/src/VBox/VMM/PGMPhys.cpp
r18620 r18645 3010 3010 AssertRC(rc); 3011 3011 3012 VMSetRuntimeError(pVM, false, "HostMemoryLow", "Unable to allocate and lock memory. The virtual machine will be paused. Please close applications to free up memory or close the VM");3012 VMSetRuntimeError(pVM, 0/*fFlags*/, "HostMemoryLow", "Unable to allocate and lock memory. The virtual machine will be paused. Please close applications to free up memory or close the VM"); 3013 3013 3014 3014 /* Wait for resume event; will only return in that case. If the VM is stopped, the EMT thread will be destroyed. */ -
trunk/src/VBox/VMM/VM.cpp
r18619 r18645 3110 3110 3111 3111 /** 3112 * Ellipsis to va_list wrapper for calling pfnAtRuntimeError. 3113 */ 3114 static void vmR3SetRuntimeErrorWorkerDoCall(PVM pVM, PVMATRUNTIMEERROR pCur, bool fFatal, 3115 const char *pszErrorID, 3116 const char *pszFormat, ...) 3112 * Worker for VMR3SetRuntimeErrorWorker and vmR3SetRuntimeErrorV. 3113 * 3114 * This does the common parts after the error has been saved / retrieved. 3115 * 3116 * @returns VBox status code with modifications, see VMSetRuntimeErrorV. 3117 * 3118 * @param pVM The VM handle. 3119 * @param fFlags The error flags. 3120 * @param pszErrorId Error ID string. 3121 * @param pszFormat Format string. 3122 * @param pVa Pointer to the format arguments. 3123 */ 3124 static int vmR3SetRuntimeErrorCommon(PVM pVM, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, va_list *pVa) 3125 { 3126 LogRel(("VM: Raising runtime error '%s' (fFlags=%#x)\n", pszErrorId, fFlags)); 3127 3128 /* 3129 * Take actions before the call. 3130 */ 3131 int rc = VINF_SUCCESS; 3132 if (fFlags & VMSETRTERR_FLAGS_FATAL) 3133 /** @todo Add some special VM state for the FATAL variant that isn't resumable. 3134 * It's too risky for 2.2.0, do after branching. */ 3135 rc = VMR3SuspendNoSave(pVM); 3136 else if (fFlags & VMSETRTERR_FLAGS_SUSPEND) 3137 rc = VMR3Suspend(pVM); 3138 3139 /* 3140 * Do the callback round. 3141 */ 3142 for (PVMATRUNTIMEERROR pCur = pVM->pUVM->vm.s.pAtRuntimeError; pCur; pCur = pCur->pNext) 3143 { 3144 va_list va; 3145 va_copy(va, *pVa); 3146 pCur->pfnAtRuntimeError(pVM, pCur->pvUser, fFlags, pszErrorId, pszFormat, va); 3147 va_end(va); 3148 } 3149 3150 return rc; 3151 } 3152 3153 3154 /** 3155 * Ellipsis to va_list wrapper for calling vmR3SetRuntimeErrorCommon. 3156 */ 3157 static int vmR3SetRuntimeErrorCommonF(PVM pVM, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, ...) 3117 3158 { 3118 3159 va_list va; 3119 3160 va_start(va, pszFormat); 3120 pCur->pfnAtRuntimeError(pVM, pCur->pvUser, fFatal, pszErrorID, pszFormat,va);3161 int rc = vmR3SetRuntimeErrorCommon(pVM, fFlags, pszErrorId, pszFormat, &va); 3121 3162 va_end(va); 3122 } 3123 3124 3125 /** 3126 * This is a worker function for GC and Ring-0 calls to VMSetError and VMSetErrorV. 3163 return rc; 3164 } 3165 3166 3167 /** 3168 * This is a worker function for RC and Ring-0 calls to VMSetError and 3169 * VMSetErrorV. 3170 * 3127 3171 * The message is found in VMINT. 3128 3172 * 3173 * @returns VBox status code, see VMSetRuntimeError. 3129 3174 * @param pVM The VM handle. 3130 3175 * @thread EMT. 3131 3176 */ 3132 VMMR3DECL( void) VMR3SetRuntimeErrorWorker(PVM pVM)3177 VMMR3DECL(int) VMR3SetRuntimeErrorWorker(PVM pVM) 3133 3178 { 3134 3179 VM_ASSERT_EMT(pVM); … … 3138 3183 * Unpack the error (if we managed to format one). 3139 3184 */ 3140 PVMRUNTIMEERROR pErr = pVM->vm.s.pRuntimeErrorR3;3141 const char *pszErrorID = NULL;3142 const char *pszMessage;3143 bool fFatal = false;3185 const char *pszErrorId = "SetRuntimeError"; 3186 const char *pszMessage = "No message!"; 3187 uint32_t fFlags = VMSETRTERR_FLAGS_FATAL; 3188 PVMRUNTIMEERROR pErr = pVM->vm.s.pRuntimeErrorR3; 3144 3189 if (pErr) 3145 3190 { 3146 3191 AssertCompile(sizeof(const char) == sizeof(uint8_t)); 3147 if (pErr->offErrorI D)3148 pszErrorI D = (const char *)pErr + pErr->offErrorID;3192 if (pErr->offErrorId) 3193 pszErrorId = (const char *)pErr + pErr->offErrorId; 3149 3194 if (pErr->offMessage) 3150 3195 pszMessage = (const char *)pErr + pErr->offMessage; 3151 else 3152 pszMessage = "No message!"; 3153 fFatal = pErr->fFatal; 3154 } 3155 else 3156 pszMessage = "No message! (Failed to allocate memory to put the error message in!)"; 3157 3158 /* 3159 * Call the at runtime error callbacks. 3160 */ 3161 for (PVMATRUNTIMEERROR pCur = pVM->pUVM->vm.s.pAtRuntimeError; pCur; pCur = pCur->pNext) 3162 vmR3SetRuntimeErrorWorkerDoCall(pVM, pCur, fFatal, pszErrorID, "%s", pszMessage); 3163 } 3164 3165 3166 /** 3167 * Worker which calls everyone listening to the VM runtime error messages. 3196 fFlags = pErr->fFlags; 3197 } 3198 3199 /* 3200 * Join cause with vmR3SetRuntimeErrorV. 3201 */ 3202 return vmR3SetRuntimeErrorCommonF(pVM, fFlags, pszErrorId, "%s", pszMessage); 3203 } 3204 3205 3206 /** 3207 * Worker for VMSetRuntimeErrorV for doing the job on EMT in ring-3. 3208 * 3209 * @returns VBox status code with modifications, see VMSetRuntimeErrorV. 3168 3210 * 3169 3211 * @param pVM The VM handle. 3170 * @param fF atal Whether it is a fatal error or not.3171 * @param pszErrorI DError ID string.3212 * @param fFlags The error flags. 3213 * @param pszErrorId Error ID string. 3172 3214 * @param pszFormat Format string. 3173 * @param pArgs Pointer to the format arguments. 3215 * @param pVa Pointer to the format arguments. 3216 * 3174 3217 * @thread EMT 3175 3218 */ 3176 DECLCALLBACK(void) vmR3SetRuntimeErrorV(PVM pVM, bool fFatal, 3177 const char *pszErrorID, 3178 const char *pszFormat, va_list *pArgs) 3219 DECLCALLBACK(int) vmR3SetRuntimeErrorV(PVM pVM, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, va_list *pVa) 3179 3220 { 3180 3221 /* 3181 3222 * Make a copy of the message. 3182 3223 */ 3183 vmSetRuntimeErrorCopy(pVM, fFatal, pszErrorID, pszFormat, *pArgs); 3184 3185 /* 3186 * Call the at error callbacks. 3187 */ 3188 for (PVMATRUNTIMEERROR pCur = pVM->pUVM->vm.s.pAtRuntimeError; pCur; pCur = pCur->pNext) 3189 { 3190 va_list va2; 3191 va_copy(va2, *pArgs); 3192 pCur->pfnAtRuntimeError(pVM, pCur->pvUser, fFatal, pszErrorID, pszFormat, va2); 3193 va_end(va2); 3194 } 3224 va_list va2; 3225 va_copy(va2, *pVa); 3226 vmSetRuntimeErrorCopy(pVM, fFlags, pszErrorId, pszFormat, va2); 3227 va_end(va2); 3228 3229 /* 3230 * Join paths with VMR3SetRuntimeErrorWorker. 3231 */ 3232 return vmR3SetRuntimeErrorCommon(pVM, fFlags, pszErrorId, pszFormat, pVa); 3195 3233 } 3196 3234 -
trunk/src/VBox/VMM/VMInternal.h
r16311 r18645 181 181 uint32_t off; 182 182 /** Offset from the start of this structure to the error ID. */ 183 uint32_t offErrorI D;183 uint32_t offErrorId; 184 184 /** Offset from the start of this structure to the formatted message text. */ 185 185 uint32_t offMessage; 186 /** Whether the error is fatal or not*/187 bool fFatal;186 /** Error flags. */ 187 uint32_t fFlags; 188 188 } VMRUNTIMEERROR, *PVMRUNTIMEERROR; 189 189 … … 546 546 typedef VMINTUSERPERVMCPU *PVMINTUSERPERVMCPU; 547 547 548 __BEGIN_DECLS 549 548 550 DECLCALLBACK(int) vmR3EmulationThread(RTTHREAD ThreadSelf, void *pvArg); 549 551 int vmR3SetHaltMethodU(PUVM pUVM, VMHALTMETHOD enmHaltMethod); … … 551 553 DECLCALLBACK(void) vmR3SetErrorUV(PUVM pUVM, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list *args); 552 554 void vmSetErrorCopy(PVM pVM, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list args); 553 DECLCALLBACK( void) vmR3SetRuntimeErrorV(PVM pVM, bool fFatal, const char *pszErrorID, const char *pszFormat, va_list *args);554 void vmSetRuntimeErrorCopy(PVM pVM, bool fFatal, const char *pszErrorID, const char *pszFormat, va_list args);555 DECLCALLBACK(int) vmR3SetRuntimeErrorV(PVM pVM, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, va_list *pVa); 556 void vmSetRuntimeErrorCopy(PVM pVM, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, va_list va); 555 557 void vmR3DestroyFinalBitFromEMT(PUVM pUVM); 556 558 void vmR3SetState(PVM pVM, VMSTATE enmStateNew); 557 559 560 __END_DECLS 561 558 562 559 563 /** @} */ -
trunk/src/VBox/VMM/VMM.cpp
r18617 r18645 1458 1458 */ 1459 1459 case VMMCALLHOST_VM_SET_RUNTIME_ERROR: 1460 VMR3SetRuntimeErrorWorker(pVM); 1461 pVM->vmm.s.rcCallHost = VINF_SUCCESS; 1460 pVM->vmm.s.rcCallHost = VMR3SetRuntimeErrorWorker(pVM); 1462 1461 break; 1463 1462 -
trunk/src/VBox/VMM/VMMAll/VMAll.cpp
r13832 r18645 30 30 #include <VBox/vm.h> 31 31 #include <VBox/err.h> 32 #include <VBox/log.h> 32 33 33 34 #include <iprt/assert.h> 34 35 #include <iprt/string.h> 36 #ifndef IN_RC 37 # include <iprt/thread.h> 38 #endif 35 39 36 40 … … 184 188 /** 185 189 * Sets the runtime error message. 190 * 186 191 * As opposed VMSetError(), this method is intended to inform the VM user about 187 192 * errors and error-like conditions that happen at an arbitrary point during VM 188 193 * execution (like "host memory low" or "out of host disk space"). 189 194 * 190 * The @a fFatal parameter defines whether the error is fatal or not. If it is 191 * true, then it is expected that the caller has already paused the VM execution 192 * before calling this method. The VM user is supposed to power off the VM 193 * immediately after it has received the runtime error notification via the 194 * FNVMATRUNTIMEERROR callback. 195 * 196 * If @a fFatal is false, then the paused state of the VM defines the kind of 197 * the error. If the VM is paused before calling this method, it means that 198 * the VM user may try to fix the error condition (i.e. free more host memory) 199 * and then resume the VM execution. If the VM is not paused before calling 200 * this method, it means that the given error is a warning about an error 201 * condition that may happen soon but that doesn't directly affect the 202 * VM execution by the time of the call. 203 * 204 * The @a pszErrorID parameter defines an unique error identificator. 205 * It is used by the front-ends to show a proper message to the end user 206 * containig possible actions (for example, Retry/Ignore). For this reason, 207 * an error ID assigned once to some particular error condition should not 208 * change in the future. The format of this parameter is "someErrorCondition". 209 * 210 * @param pVM VM handle. Must be non-NULL. 211 * @param fFatal Whether it is a fatal error or not. 212 * @param pszErrorID Error ID string. 195 * @returns VBox status code. For some flags the status code needs to be 196 * propagated up the stack, but this may depend on where the call was 197 * made. 198 * 199 * @param pVM The VM handle. 200 * 201 * @param fFlags Flags indicating which actions to take. 202 * See VMSETRTERR_FLAGS_* for details on each flag. 203 * 204 * @param pszErrorId Unique error identificator string. This is used by 205 * the frontends and maybe other devices or drivers, so 206 * once an ID has been selected it's essentially 207 * unchangable. Employ camelcase when constructing the 208 * string, leave out spaces. 209 * 210 * The registered runtime error callbacks should string 211 * switch on this and handle the ones it knows 212 * specifically and the unknown ones generically. 213 * 213 214 * @param pszFormat Error message format string. 214 215 * @param ... Error message arguments. 215 216 * 216 * @return VBox status code (whether the error has been successfully set217 * and delivered to callbacks or not).218 *219 217 * @thread Any 220 * @todo r=bird: The pausing/suspending of the VM should be done here, we'll just end 221 * up duplicating code all over the place otherwise. In the case of 222 * devices/drivers/etc they might not be trusted to pause/suspend the 223 * vm even. Change fFatal to fFlags and define action flags and a fatal flag. 224 * 225 * Also, why a string ID and not an enum? 226 */ 227 VMMDECL(int) VMSetRuntimeError(PVM pVM, bool fFatal, const char *pszErrorID, 228 const char *pszFormat, ...) 229 { 230 va_list args; 231 va_start(args, pszFormat); 232 int rc = VMSetRuntimeErrorV(pVM, fFatal, pszErrorID, pszFormat, args); 233 va_end(args); 218 */ 219 VMMDECL(int) VMSetRuntimeError(PVM pVM, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, ...) 220 { 221 va_list va; 222 va_start(va, pszFormat); 223 int rc = VMSetRuntimeErrorV(pVM, fFlags, pszErrorId, pszFormat, va); 224 va_end(va); 234 225 return rc; 235 226 } … … 239 230 * va_list version of VMSetRuntimeError. 240 231 * 241 * @param pVM VM handle. Must be non-NULL. 242 * @param fFatal Whether it is a fatal error or not. 243 * @param pszErrorID Error ID string. 244 * @param pszFormat Error message format string. 245 * @param args Error message arguments. 246 * 247 * @return VBox status code (whether the error has been successfully set 248 * and delivered to callbacks or not). 232 * @returns VBox status code. For some flags the status code needs to be 233 * propagated up the stack, but this may depend on where the call was 234 * made. For most actions, there is a force action flag mopping up if 235 * the status code can't be propagated. 236 * 237 * @param pVM The VM handle. 238 * @param fFlags Flags indicating which actions to take. See 239 * VMSETRTERR_FLAGS_*. 240 * @param pszErrorId Error ID string. 241 * @param pszFormat Error message format string. 242 * @param va Error message arguments. 249 243 * 250 244 * @thread Any 251 245 */ 252 VMMDECL(int) VMSetRuntimeErrorV(PVM pVM, bool fFatal, const char *pszErrorID, 253 const char *pszFormat, va_list args) 254 { 246 VMMDECL(int) VMSetRuntimeErrorV(PVM pVM, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, va_list va) 247 { 248 Log(("VMSetRuntimeErrorV: fFlags=%#x pszErrorId=%s\n", fFlags, pszErrorId)); 249 250 /* 251 * Relaxed parameter validation. 252 */ 253 AssertPtr(pVM); 254 AssertMsg(fFlags & ~(VMSETRTERR_FLAGS_NO_WAIT | VMSETRTERR_FLAGS_SUSPEND | VMSETRTERR_FLAGS_FATAL), ("%#x\n", fFlags)); 255 Assert(!(fFlags & VMSETRTERR_FLAGS_NO_WAIT) || !VM_IS_EMT(pVM)); 256 Assert(!(fFlags & VMSETRTERR_FLAGS_SUSPEND) || !(fFlags & VMSETRTERR_FLAGS_FATAL)); 257 AssertPtr(pszErrorId); 258 Assert(*pszErrorId); 259 Assert(memchr(pszErrorId, '\0', 128) != NULL); 260 AssertPtr(pszFormat); 261 Assert(memchr(pszFormat, '\0', 512) != NULL); 262 255 263 #ifdef IN_RING3 256 264 /* … … 258 266 */ 259 267 va_list va2; 260 va_copy(va2, args); /* Have to make a copy here or GCC will break. */ 268 va_copy(va2, va); /* Have to make a copy here or GCC will break. */ 269 int rc; 261 270 PVMREQ pReq; 262 VMR3ReqCall(pVM, VMREQDEST_ANY, &pReq, RT_INDEFINITE_WAIT, (PFNRT)vmR3SetRuntimeErrorV, 5, 263 pVM, fFatal, pszErrorID, pszFormat, &va2); 271 if ( !(fFlags & VMSETRTERR_FLAGS_NO_WAIT) 272 || VM_IS_EMT(pVM)) 273 { 274 rc = VMR3ReqCallU(pVM->pUVM, VMREQDEST_ANY, &pReq, RT_INDEFINITE_WAIT, VMREQFLAGS_VBOX_STATUS, 275 (PFNRT)vmR3SetRuntimeErrorV, 5, pVM, fFlags, pszErrorId, pszFormat, &va2); 276 if (RT_SUCCESS(rc)) 277 rc = pReq->iStatus; 278 } 279 else 280 rc = VMR3ReqCallU(pVM->pUVM, VMREQDEST_ANY, &pReq, 0, VMREQFLAGS_VBOX_STATUS | VMREQFLAGS_NO_WAIT, 281 (PFNRT)vmR3SetRuntimeErrorV, 5, pVM, fFlags, pszErrorId, pszFormat, &va2); 264 282 VMR3ReqFree(pReq); 265 283 va_end(va2); … … 267 285 #else 268 286 /* 269 * We're already on the EMT thread and can safely create a VMRUNTIMEERROR chunk. 270 */ 271 vmSetRuntimeErrorCopy(pVM, fFatal, pszErrorID, pszFormat, args); 287 * We're already on the EMT and can safely create a VMRUNTIMEERROR chunk. 288 */ 289 AssertReleaseMsgFailed(("Congratulations! You will have the pleasure of debugging the RC/R0 path.\n")); 290 vmSetRuntimeErrorCopy(pVM, fFlags, pszErrorId, pszFormat, va); 272 291 273 292 # ifdef IN_RC 274 VMMGCCallHost(pVM, VMMCALLHOST_VM_SET_RUNTIME_ERROR, 0); 275 # elif defined(IN_RING0) 276 VMMR0CallHost(pVM, VMMCALLHOST_VM_SET_RUNTIME_ERROR, 0); 293 int rc = VMMGCCallHost(pVM, VMMCALLHOST_VM_SET_RUNTIME_ERROR, 0); 277 294 # else 295 int rc = VMMR0CallHost(pVM, VMMCALLHOST_VM_SET_RUNTIME_ERROR, 0); 278 296 # endif 279 297 #endif 280 return VINF_SUCCESS; 298 299 Log(("VMSetRuntimeErrorV: returns %Rrc (pszErrorId=%s)\n", rc, pszErrorId)); 300 return rc; 281 301 } 282 302 … … 285 305 * Copies the error to a VMRUNTIMEERROR structure. 286 306 * 287 * This is mainly intended for Ring-0 and GC where the error must be copied to307 * This is mainly intended for Ring-0 and RC where the error must be copied to 288 308 * memory accessible from ring-3. But it's just possible that we might add 289 309 * APIs for retrieving the VMRUNTIMEERROR copy later. 290 310 * 291 311 * @param pVM VM handle. Must be non-NULL. 292 * @param fFatal Whether it is a fatal error or not. 293 * @param pszErrorID Error ID string. 294 * @param pszFormat Error message format string. 295 * @param args Error message arguments. 312 * @param fFlags The error flags. 313 * @param pszErrorId Error ID string. 314 * @param pszFormat Error message format string. 315 * @param va Error message arguments. This is of course spoiled 316 * by this call. 296 317 * @thread EMT 297 318 */ 298 void vmSetRuntimeErrorCopy(PVM pVM, bool fFatal, const char *pszErrorID, 299 const char *pszFormat, va_list args) 319 void vmSetRuntimeErrorCopy(PVM pVM, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, va_list va) 300 320 { 301 321 #if 0 /// @todo implement Ring-0 and GC VMSetError … … 308 328 309 329 /* calc reasonable start size. */ 310 size_t cchErrorID = pszErrorI D ? strlen(pszErrorID) : 0;330 size_t cchErrorID = pszErrorId ? strlen(pszErrorId) : 0; 311 331 size_t cchFormat = strlen(pszFormat); 312 332 size_t cb = sizeof(VMRUNTIMEERROR) … … 322 342 PVMRUNTIMEERROR pErr = (PVMRUNTIMEERROR)pv; 323 343 pErr->cbAllocated = cb; 344 pErr->fFlags = fFlags; 324 345 pErr->off = sizeof(PVMRUNTIMEERROR); 325 pErr->offErrorID = =0;346 pErr->offErrorID = 0; 326 347 327 348 if (cchErrorID) 328 349 { 329 350 pErr->offErrorID = pErr->off; 330 memcpy((uint8_t *)pErr + pErr->off, pszErrorI D, cchErrorID + 1);351 memcpy((uint8_t *)pErr + pErr->off, pszErrorId, cchErrorID + 1); 331 352 pErr->off += cchErrorID + 1; 332 353 } -
trunk/src/VBox/VMM/VMMGC/PDMGCDevice.cpp
r18101 r18645 64 64 static DECLCALLBACK(int) pdmGCDevHlp_VMSetError(PPDMDEVINS pDevIns, int rc, RT_SRC_POS_DECL, const char *pszFormat, ...); 65 65 static DECLCALLBACK(int) pdmGCDevHlp_VMSetErrorV(PPDMDEVINS pDevIns, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list va); 66 static DECLCALLBACK(int) pdmGCDevHlp_VMSetRuntimeError(PPDMDEVINS pDevIns, bool fFatal, const char *pszErrorID, const char *pszFormat, ...);67 static DECLCALLBACK(int) pdmGCDevHlp_VMSetRuntimeErrorV(PPDMDEVINS pDevIns, bool fFatal, const char *pszErrorID, const char *pszFormat, va_list va);66 static DECLCALLBACK(int) pdmGCDevHlp_VMSetRuntimeError(PPDMDEVINS pDevIns, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, ...); 67 static DECLCALLBACK(int) pdmGCDevHlp_VMSetRuntimeErrorV(PPDMDEVINS pDevIns, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, va_list va); 68 68 static DECLCALLBACK(int) pdmGCDevHlp_PATMSetMMIOPatchInfo(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, RTGCPTR pCachedData); 69 69 static DECLCALLBACK(PVM) pdmGCDevHlp_GetVM(PPDMDEVINS pDevIns); … … 322 322 323 323 /** @copydoc PDMDEVHLPRC::pfnVMSetRuntimeError */ 324 static DECLCALLBACK(int) pdmGCDevHlp_VMSetRuntimeError(PPDMDEVINS pDevIns, bool fFatal, const char *pszErrorID, const char *pszFormat, ...)325 { 326 PDMDEV_ASSERT_DEVINS(pDevIns); 327 va_list args;328 va_start( args, pszFormat);329 int rc = VMSetRuntimeErrorV(pDevIns->Internal.s.pVMRC, fF atal, pszErrorID, pszFormat, args);330 va_end( args);324 static DECLCALLBACK(int) pdmGCDevHlp_VMSetRuntimeError(PPDMDEVINS pDevIns, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, ...) 325 { 326 PDMDEV_ASSERT_DEVINS(pDevIns); 327 va_list va; 328 va_start(va, pszFormat); 329 int rc = VMSetRuntimeErrorV(pDevIns->Internal.s.pVMRC, fFlags, pszErrorId, pszFormat, va); 330 va_end(va); 331 331 return rc; 332 332 } … … 334 334 335 335 /** @copydoc PDMDEVHLPRC::pfnVMSetErrorV */ 336 static DECLCALLBACK(int) pdmGCDevHlp_VMSetRuntimeErrorV(PPDMDEVINS pDevIns, bool fFatal, const char *pszErrorID, const char *pszFormat, va_list va)337 { 338 PDMDEV_ASSERT_DEVINS(pDevIns); 339 int rc = VMSetRuntimeErrorV(pDevIns->Internal.s.pVMRC, fF atal, pszErrorID, pszFormat, va);336 static DECLCALLBACK(int) pdmGCDevHlp_VMSetRuntimeErrorV(PPDMDEVINS pDevIns, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, va_list va) 337 { 338 PDMDEV_ASSERT_DEVINS(pDevIns); 339 int rc = VMSetRuntimeErrorV(pDevIns->Internal.s.pVMRC, fFlags, pszErrorId, pszFormat, va); 340 340 return rc; 341 341 } -
trunk/src/VBox/VMM/VMMR0/PDMR0Device.cpp
r18101 r18645 65 65 static DECLCALLBACK(int) pdmR0DevHlp_VMSetError(PPDMDEVINS pDevIns, int rc, RT_SRC_POS_DECL, const char *pszFormat, ...); 66 66 static DECLCALLBACK(int) pdmR0DevHlp_VMSetErrorV(PPDMDEVINS pDevIns, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list va); 67 static DECLCALLBACK(int) pdmR0DevHlp_VMSetRuntimeError(PPDMDEVINS pDevIns, bool fFatal, const char *pszErrorID, const char *pszFormat, ...);68 static DECLCALLBACK(int) pdmR0DevHlp_VMSetRuntimeErrorV(PPDMDEVINS pDevIns, bool fFatal, const char *pszErrorID, const char *pszFormat, va_list va);67 static DECLCALLBACK(int) pdmR0DevHlp_VMSetRuntimeError(PPDMDEVINS pDevIns, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, ...); 68 static DECLCALLBACK(int) pdmR0DevHlp_VMSetRuntimeErrorV(PPDMDEVINS pDevIns, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, va_list va); 69 69 static DECLCALLBACK(int) pdmR0DevHlp_PATMSetMMIOPatchInfo(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, RTGCPTR pCachedData); 70 70 static DECLCALLBACK(PVM) pdmR0DevHlp_GetVM(PPDMDEVINS pDevIns); … … 325 325 326 326 /** @copydoc PDMDEVHLPR0::pfnVMSetRuntimeError */ 327 static DECLCALLBACK(int) pdmR0DevHlp_VMSetRuntimeError(PPDMDEVINS pDevIns, bool fFatal, const char *pszErrorID, const char *pszFormat, ...)328 { 329 PDMDEV_ASSERT_DEVINS(pDevIns); 330 va_list args;331 va_start( args, pszFormat);332 int rc = VMSetRuntimeErrorV(pDevIns->Internal.s.pVMR0, fF atal, pszErrorID, pszFormat, args);333 va_end( args);327 static DECLCALLBACK(int) pdmR0DevHlp_VMSetRuntimeError(PPDMDEVINS pDevIns, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, ...) 328 { 329 PDMDEV_ASSERT_DEVINS(pDevIns); 330 va_list va; 331 va_start(va, pszFormat); 332 int rc = VMSetRuntimeErrorV(pDevIns->Internal.s.pVMR0, fFlags, pszErrorId, pszFormat, va); 333 va_end(va); 334 334 return rc; 335 335 } … … 337 337 338 338 /** @copydoc PDMDEVHLPR0::pfnVMSetRuntimeErrorV */ 339 static DECLCALLBACK(int) pdmR0DevHlp_VMSetRuntimeErrorV(PPDMDEVINS pDevIns, bool fFatal, const char *pszErrorID, const char *pszFormat, va_list va)340 { 341 PDMDEV_ASSERT_DEVINS(pDevIns); 342 int rc = VMSetRuntimeErrorV(pDevIns->Internal.s.pVMR0, fF atal, pszErrorID, pszFormat, va);339 static DECLCALLBACK(int) pdmR0DevHlp_VMSetRuntimeErrorV(PPDMDEVINS pDevIns, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, va_list va) 340 { 341 PDMDEV_ASSERT_DEVINS(pDevIns); 342 int rc = VMSetRuntimeErrorV(pDevIns->Internal.s.pVMR0, fFlags, pszErrorId, pszFormat, va); 343 343 return rc; 344 344 } -
trunk/src/VBox/VMM/testcase/tstVMREQ.cpp
r14831 r18645 53 53 * Testings va_list passing in VMSetRuntimeError. 54 54 */ 55 static DECLCALLBACK(void) MyAtRuntimeError(PVM pVM, void *pvUser, bool fFatal, const char *pszErrorId, const char *pszFormat, va_list va)55 static DECLCALLBACK(void) MyAtRuntimeError(PVM pVM, void *pvUser, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, va_list va) 56 56 { 57 57 if (strcmp((const char *)pvUser, "user argument")) … … 60 60 g_cErrors++; 61 61 } 62 if (fF atal)63 { 64 RTPrintf(TESTCASE ": fF atal=%d!\n", fFatal);62 if (fFlags) 63 { 64 RTPrintf(TESTCASE ": fFlags=%#x!\n", fFlags); 65 65 g_cErrors++; 66 66 } … … 287 287 PassVA(pVM, "hello %s", "world"); 288 288 VMR3AtRuntimeErrorRegister(pVM, MyAtRuntimeError, (void *)"user argument"); 289 VMSetRuntimeError(pVM, false, "enum", "some %s string", "error");289 VMSetRuntimeError(pVM, 0 /*fFlags*/, "enum", "some %s string", "error"); 290 290 291 291 /*
Note:
See TracChangeset
for help on using the changeset viewer.

