VirtualBox

Changeset 18645 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Apr 2, 2009 3:38:31 PM (16 years ago)
Author:
vboxsync
Message:

VMSetRuntimeError[V] refactoring: fFatal -> fFlags, may return informational status codes.

Location:
trunk/src/VBox
Files:
23 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/DevIchAc97.cpp

    r12978 r18645  
    16801680        ac97Reset (pDevIns);
    16811681
    1682         PDMDevHlpVMSetRuntimeError (pDevIns, false, "HostAudioNotResponding",
     1682        PDMDevHlpVMSetRuntimeError (pDevIns, 0 /*fFlags*/, "HostAudioNotResponding",
    16831683            N_ ("No audio devices could be opened. Selecting the NULL audio backend "
    16841684                "with the consequence that no sound is audible"));
     
    16961696            len += RTStrPrintf (szMissingVoices + len, sizeof(szMissingVoices) - len, len ? ", PCM_mic" : "PCM_mic");
    16971697
    1698         PDMDevHlpVMSetRuntimeError (pDevIns, false, "HostAudioNotResponding",
     1698        PDMDevHlpVMSetRuntimeError (pDevIns, 0 /*fFlags*/, "HostAudioNotResponding",
    16991699            N_ ("Some audio devices (%s) could not be opened. Guest applications generating audio "
    17001700                "output or depending on audio input may hang. Make sure your host audio device "
  • trunk/src/VBox/Devices/Audio/DevSB16.cpp

    r18497 r18645  
    18361836        s->voice = NULL;
    18371837        AUD_init_null();
    1838         PDMDevHlpVMSetRuntimeError(pDevIns, false, "HostAudioNotResponding",
     1838        PDMDevHlpVMSetRuntimeError(pDevIns, 0 /*fFlags*/, "HostAudioNotResponding",
    18391839            N_("No audio devices could be opened. Selecting the NULL audio backend "
    18401840               "with the consequence that no sound is audible"));
  • trunk/src/VBox/Devices/Network/DevE1000.cpp

    r18622 r18645  
    48534853        if (rc == VINF_NAT_DNS)
    48544854        {
    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"));
    48574857        }
    48584858        pState->pDrv = (PPDMINETWORKCONNECTOR)
  • trunk/src/VBox/Devices/Network/DevPCNet.cpp

    r18573 r18645  
    49914991        {
    49924992#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"));
    49954995#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"));
    49984998#endif
    49994999        }
  • trunk/src/VBox/Devices/Network/DrvNAT.cpp

    r17655 r18645  
    387387
    388388        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. */
    389390        AssertRelease(cChangedFDs >= 0);
     391#endif
    390392        if (cChangedFDs >= 0)
    391393        {
     
    397399                size_t cbRead;
    398400                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
    401403                 * device's thread sends before we've entered multiplex,
    402404                 * so to avoid false alarm drain pipe here to the very end
    403405                 *
    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.
    406408                 *
    407409                 * XXX:Make it reading exactly we need to drain the pipe.
     
    564566        cDroppedPackets++;
    565567    }
    566     else 
     568    else
    567569    {
    568570        LogRel(("NAT: %d messages suppressed about dropping package (couldn't allocate queue item)\n", cDroppedPackets));
  • trunk/src/VBox/Devices/Serial/DrvHostSerial.cpp

    r16527 r18645  
    974974        {
    975975ioctl_error:
    976             PDMDrvHlpVMSetRuntimeError(pDrvIns, false, "DrvHostSerialFail",
     976            PDMDrvHlpVMSetRuntimeError(pDrvIns, 0 /*fFlags*/, "DrvHostSerialFail",
    977977                                       N_("Ioctl failed for serial host device '%s' (%Rrc). The device will not work properly"),
    978978                                       pThis->pszDevicePath, RTErrConvertFromErrno(errno));
     
    990990        if (rc < 0)
    991991        {
    992             PDMDrvHlpVMSetRuntimeError(pDrvIns, false, "DrvHostSerialFail",
     992            PDMDrvHlpVMSetRuntimeError(pDrvIns, 0 /*fFlags*/, "DrvHostSerialFail",
    993993                                       N_("Ioctl failed for serial host device '%s' (%Rrc). The device will not work properly"),
    994994                                       pThis->pszDevicePath, RTErrConvertFromErrno(errno));
     
    10921092
    10931093ioctl_error:
    1094     PDMDrvHlpVMSetRuntimeError(pDrvIns, false, "DrvHostSerialFail",
     1094    PDMDrvHlpVMSetRuntimeError(pDrvIns, 0 /*fFlags*/, "DrvHostSerialFail",
    10951095                                N_("Ioctl failed for serial host device '%s' (%Rrc). The device will not work properly"),
    10961096                                pThis->pszDevicePath, RTErrConvertFromErrno(errno));
     
    11121112    rc = RTThreadPoke(pThread->Thread);
    11131113    if (RT_FAILURE(rc))
    1114         PDMDrvHlpVMSetRuntimeError(pDrvIns, false, "DrvHostSerialFail",
     1114        PDMDrvHlpVMSetRuntimeError(pDrvIns, 0 /*fFlags*/, "DrvHostSerialFail",
    11151115                                    N_("Suspending serial monitor thread failed for serial device '%s' (%Rrc). The shutdown may take longer than expected"),
    11161116                                    pThis->pszDevicePath, RTErrConvertFromErrno(rc));
  • trunk/src/VBox/Devices/Storage/DevATA.cpp

    r18434 r18645  
    13701370    int rc;
    13711371    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"));
    13751374    AssertRC(rc);
    13761375}
     
    13801379    int rc;
    13811380    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"));
    13851383    AssertRC(rc);
    13861384}
     
    13901388    int rc;
    13911389    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"));
    13951392    AssertRC(rc);
    13961393}
     
    52395236        if (!ataWaitForAsyncIOIsIdle(&pThis->aCts[i], 30000))
    52405237        {
    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"));
    52445240            AssertMsgFailed(("Async I/O thread busy after reset\n"));
    52455241        }
  • trunk/src/VBox/Devices/Storage/DrvHostBase.cpp

    r18440 r18645  
    19731973                if (pThis->fAttachFailError)
    19741974                    return rc;
    1975                 int erc = PDMDrvHlpVMSetRuntimeError(pDrvIns,
    1976                                                      false, "DrvHost_MOUNTFAIL",
     1975                int erc = PDMDrvHlpVMSetRuntimeError(pDrvIns, 0 /*fFlags*/,
     1976                                                     "DrvHost_MOUNTFAIL",
    19771977                                                     N_("Cannot attach to host device '%s'"), pszDevice);
    19781978                AssertRC(erc);
  • trunk/src/VBox/Frontends/VBoxBFE/VBoxBFE.cpp

    r18265 r18645  
    11071107 * @param   pVM         The VM handle.
    11081108 * @param   pvUser      The user argument.
    1109  * @param   fFata       Wheather it is a fatal error or not.
     1109 * @param   fFlags      The action flags. See VMSETRTERR_FLAGS_*.
    11101110 * @param   pszErrorId  Error ID string.
    11111111 * @param   pszError    Error message format string.
    1112  * @param   args        Error message arguments.
     1112 * @param   va          Error message arguments.
    11131113 * @thread EMT.
    11141114 */
    1115 DECLCALLBACK(void) setVMRuntimeErrorCallback(PVM pVM, void *pvUser, bool fFatal,
     1115DECLCALLBACK(void) setVMRuntimeErrorCallback(PVM pVM, void *pvUser, uint32_t fFlags,
    11161116                                             const char *pszErrorId,
    1117                                              const char *pszFormat, va_list args)
     1117                                             const char *pszFormat, va_list va)
    11181118{
    11191119    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);
    11221125    va_end(va2);
    11231126}
  • trunk/src/VBox/Main/ConsoleImpl.cpp

    r18591 r18645  
    59895989 * @param   pVM             The VM handle.
    59905990 * @param   pvUser          The user argument.
    5991  * @param   fFatal          Whether it is a fatal error or not.
    5992  * @param   pszErrorID      Error ID string.
     5991 * @param   fFlags          The action flags. See VMSETRTERR_FLAGS_*.
     5992 * @param   pszErrorId      Error ID string.
    59935993 * @param   pszFormat       Error message format string.
    5994  * @param   args            Error message arguments.
     5994 * @param   va              Error message arguments.
    59955995 * @thread EMT.
    59965996 */
    59975997/* static */ DECLCALLBACK(void)
    5998 Console::setVMRuntimeErrorCallback (PVM pVM, void *pvUser, bool fFatal,
    5999                                     const char *pszErrorID,
    6000                                     const char *pszFormat, va_list args)
    6001 {
     5998Console::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);
    60026003    LogFlowFuncEnter();
    60036004
     
    60056006    AssertReturnVoid (that);
    60066007
    6007     Utf8Str message = Utf8StrFmtVA (pszFormat, args);
     6008    Utf8Str message = Utf8StrFmtVA (pszFormat, va);
    60086009
    60096010    LogRel (("Console: VM runtime error: fatal=%RTbool, "
    60106011             "errorID=%s message=\"%s\"\n",
    6011              fFatal, pszErrorID, message.raw()));
    6012 
    6013     that->onRuntimeError (BOOL (fFatal), Bstr (pszErrorID), Bstr (message));
     6012             fFatal, pszErrorId, message.raw()));
     6013
     6014    that->onRuntimeError (BOOL (fFatal), Bstr (pszErrorId), Bstr (message));
    60146015
    60156016    LogFlowFuncLeave();
  • trunk/src/VBox/Main/ConsoleImpl2.cpp

    r18591 r18645  
    4040#include <iprt/dir.h>
    4141#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
    4246
    4347#include <VBox/vmapi.h>
     
    192196    hrc = pMachine->COMGETTER(MemorySize)(&cRamMBs);                                H();
    193197#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;
    195200#endif
    196201    uint64_t const cbRam = cRamMBs * (uint64_t)_1M;
  • trunk/src/VBox/Main/include/ConsoleImpl.h

    r18348 r18645  
    458458
    459459    static DECLCALLBACK(void)
    460     setVMRuntimeErrorCallback (PVM pVM, void *pvUser, bool fFatal,
    461                                const char *pszErrorID,
    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);
    463463
    464464    HRESULT                     captureUSBDevices (PVM pVM);
  • trunk/src/VBox/VMM/PDMDevHlp.cpp

    r18534 r18645  
    977977
    978978/** @copydoc PDMDEVHLPR3::pfnVMSetRuntimeError */
    979 static DECLCALLBACK(int) pdmR3DevHlp_VMSetRuntimeError(PPDMDEVINS pDevIns, bool fFatal, const char *pszErrorID, const char *pszFormat, ...)
     979static DECLCALLBACK(int) pdmR3DevHlp_VMSetRuntimeError(PPDMDEVINS pDevIns, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, ...)
    980980{
    981981    PDMDEV_ASSERT_DEVINS(pDevIns);
    982982    va_list args;
    983983    va_start(args, pszFormat);
    984     int rc = VMSetRuntimeErrorV(pDevIns->Internal.s.pVMR3, fFatal, pszErrorID, pszFormat, args);
     984    int rc = VMSetRuntimeErrorV(pDevIns->Internal.s.pVMR3, fFlags, pszErrorId, pszFormat, args);
    985985    va_end(args);
    986986    return rc;
     
    989989
    990990/** @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, fFatal, pszErrorID, pszFormat, va);
     991static 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);
    995995    return rc;
    996996}
  • trunk/src/VBox/VMM/PDMDriver.cpp

    r18614 r18645  
    790790
    791791/** @copydoc PDMDRVHLP::pfnVMSetRuntimeError */
    792 static DECLCALLBACK(int) pdmR3DrvHlp_VMSetRuntimeError(PPDMDRVINS pDrvIns, bool fFatal, const char *pszErrorID, const char *pszFormat, ...)
     792static DECLCALLBACK(int) pdmR3DrvHlp_VMSetRuntimeError(PPDMDRVINS pDrvIns, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, ...)
    793793{
    794794    PDMDRV_ASSERT_DRVINS(pDrvIns);
    795795    va_list args;
    796796    va_start(args, pszFormat);
    797     int rc = VMSetRuntimeErrorV(pDrvIns->Internal.s.pVM, fFatal, pszErrorID, pszFormat, args);
     797    int rc = VMSetRuntimeErrorV(pDrvIns->Internal.s.pVM, fFlags, pszErrorId, pszFormat, args);
    798798    va_end(args);
    799799    return rc;
     
    802802
    803803/** @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, fFatal, pszErrorID, pszFormat, va);
     804static 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);
    808808    return rc;
    809809}
  • trunk/src/VBox/VMM/PGM.cpp

    r18617 r18645  
    37293729 * This is called by PGMChangeMode and pgmR3InitPaging().
    37303730 *
    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 *
    37323734 * @param   pVM             VM handle.
    37333735 * @param   enmGuestMode    The new guest mode. This is assumed to be different from
     
    39283930            CPUMGetGuestCpuId(pVM, 1, &u32Dummy, &u32Dummy, &u32Dummy, &u32Features);
    39293931            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
    39403935            GCPhysCR3 = CPUMGetGuestCR3(pVM) & X86_CR3_PAE_PAGE_MASK;
    39413936            rc = PGM_GST_NAME_PAE(Enter)(pVM, GCPhysCR3);
  • trunk/src/VBox/VMM/PGMPhys.cpp

    r18620 r18645  
    30103010        AssertRC(rc);
    30113011
    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");
    30133013
    30143014        /* 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  
    31103110
    31113111/**
    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 */
     3124static 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 */
     3157static int vmR3SetRuntimeErrorCommonF(PVM pVM, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, ...)
    31173158{
    31183159    va_list va;
    31193160    va_start(va, pszFormat);
    3120     pCur->pfnAtRuntimeError(pVM, pCur->pvUser, fFatal, pszErrorID, pszFormat, va);
     3161    int rc = vmR3SetRuntimeErrorCommon(pVM, fFlags, pszErrorId, pszFormat, &va);
    31213162    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 *
    31273171 * The message is found in VMINT.
    31283172 *
     3173 * @returns VBox status code, see VMSetRuntimeError.
    31293174 * @param   pVM             The VM handle.
    31303175 * @thread  EMT.
    31313176 */
    3132 VMMR3DECL(void) VMR3SetRuntimeErrorWorker(PVM pVM)
     3177VMMR3DECL(int) VMR3SetRuntimeErrorWorker(PVM pVM)
    31333178{
    31343179    VM_ASSERT_EMT(pVM);
     
    31383183     * Unpack the error (if we managed to format one).
    31393184     */
    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;
    31443189    if (pErr)
    31453190    {
    31463191        AssertCompile(sizeof(const char) == sizeof(uint8_t));
    3147         if (pErr->offErrorID)
    3148             pszErrorID = (const char *)pErr + pErr->offErrorID;
     3192        if (pErr->offErrorId)
     3193            pszErrorId = (const char *)pErr + pErr->offErrorId;
    31493194        if (pErr->offMessage)
    31503195            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.
    31683210 *
    31693211 * @param   pVM             The VM handle.
    3170  * @param   fFatal          Whether it is a fatal error or not.
    3171  * @param   pszErrorID      Error ID string.
     3212 * @param   fFlags          The error flags.
     3213 * @param   pszErrorId      Error ID string.
    31723214 * @param   pszFormat       Format string.
    3173  * @param   pArgs           Pointer to the format arguments.
     3215 * @param   pVa             Pointer to the format arguments.
     3216 *
    31743217 * @thread  EMT
    31753218 */
    3176 DECLCALLBACK(void) vmR3SetRuntimeErrorV(PVM pVM, bool fFatal,
    3177                                         const char *pszErrorID,
    3178                                         const char *pszFormat, va_list *pArgs)
     3219DECLCALLBACK(int) vmR3SetRuntimeErrorV(PVM pVM, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, va_list *pVa)
    31793220{
    31803221    /*
    31813222     * Make a copy of the message.
    31823223     */
    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);
    31953233}
    31963234
  • trunk/src/VBox/VMM/VMInternal.h

    r16311 r18645  
    181181    uint32_t                        off;
    182182    /** Offset from the start of this structure to the error ID. */
    183     uint32_t                        offErrorID;
     183    uint32_t                        offErrorId;
    184184    /** Offset from the start of this structure to the formatted message text. */
    185185    uint32_t                        offMessage;
    186     /** Whether the error is fatal or not */
    187     bool                            fFatal;
     186    /** Error flags. */
     187    uint32_t                        fFlags;
    188188} VMRUNTIMEERROR, *PVMRUNTIMEERROR;
    189189
     
    546546typedef VMINTUSERPERVMCPU *PVMINTUSERPERVMCPU;
    547547
     548__BEGIN_DECLS
     549
    548550DECLCALLBACK(int)   vmR3EmulationThread(RTTHREAD ThreadSelf, void *pvArg);
    549551int                 vmR3SetHaltMethodU(PUVM pUVM, VMHALTMETHOD enmHaltMethod);
     
    551553DECLCALLBACK(void)  vmR3SetErrorUV(PUVM pUVM, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list *args);
    552554void                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);
     555DECLCALLBACK(int)   vmR3SetRuntimeErrorV(PVM pVM, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, va_list *pVa);
     556void                vmSetRuntimeErrorCopy(PVM pVM, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, va_list va);
    555557void                vmR3DestroyFinalBitFromEMT(PUVM pUVM);
    556558void                vmR3SetState(PVM pVM, VMSTATE enmStateNew);
    557559
     560__END_DECLS
     561
    558562
    559563/** @} */
  • trunk/src/VBox/VMM/VMM.cpp

    r18617 r18645  
    14581458         */
    14591459        case VMMCALLHOST_VM_SET_RUNTIME_ERROR:
    1460             VMR3SetRuntimeErrorWorker(pVM);
    1461             pVM->vmm.s.rcCallHost = VINF_SUCCESS;
     1460            pVM->vmm.s.rcCallHost = VMR3SetRuntimeErrorWorker(pVM);
    14621461            break;
    14631462
  • trunk/src/VBox/VMM/VMMAll/VMAll.cpp

    r13832 r18645  
    3030#include <VBox/vm.h>
    3131#include <VBox/err.h>
     32#include <VBox/log.h>
    3233
    3334#include <iprt/assert.h>
    3435#include <iprt/string.h>
     36#ifndef IN_RC
     37# include <iprt/thread.h>
     38#endif
    3539
    3640
     
    184188/**
    185189 * Sets the runtime error message.
     190 *
    186191 * As opposed VMSetError(), this method is intended to inform the VM user about
    187192 * errors and error-like conditions that happen at an arbitrary point during VM
    188193 * execution (like "host memory low" or "out of host disk space").
    189194 *
    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 *
    213214 * @param   pszFormat       Error message format string.
    214215 * @param   ...             Error message arguments.
    215216 *
    216  * @return  VBox status code (whether the error has been successfully set
    217  *          and delivered to callbacks or not).
    218  *
    219217 * @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 */
     219VMMDECL(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);
    234225    return rc;
    235226}
     
    239230 * va_list version of VMSetRuntimeError.
    240231 *
    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.
    249243 *
    250244 * @thread  Any
    251245 */
    252 VMMDECL(int) VMSetRuntimeErrorV(PVM pVM, bool fFatal, const char *pszErrorID,
    253                                const char *pszFormat, va_list args)
    254 {
     246VMMDECL(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
    255263#ifdef IN_RING3
    256264    /*
     
    258266     */
    259267    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;
    261270    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);
    264282    VMR3ReqFree(pReq);
    265283    va_end(va2);
     
    267285#else
    268286    /*
    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);
    272291
    273292# 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);
    277294# else
     295    int rc = VMMR0CallHost(pVM, VMMCALLHOST_VM_SET_RUNTIME_ERROR, 0);
    278296# endif
    279297#endif
    280     return VINF_SUCCESS;
     298
     299    Log(("VMSetRuntimeErrorV: returns %Rrc (pszErrorId=%s)\n", rc, pszErrorId));
     300    return rc;
    281301}
    282302
     
    285305 * Copies the error to a VMRUNTIMEERROR structure.
    286306 *
    287  * This is mainly intended for Ring-0 and GC where the error must be copied to
     307 * This is mainly intended for Ring-0 and RC where the error must be copied to
    288308 * memory accessible from ring-3. But it's just possible that we might add
    289309 * APIs for retrieving the VMRUNTIMEERROR copy later.
    290310 *
    291311 * @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.
    296317 * @thread  EMT
    297318 */
    298 void vmSetRuntimeErrorCopy(PVM pVM, bool fFatal, const char *pszErrorID,
    299                            const char *pszFormat, va_list args)
     319void vmSetRuntimeErrorCopy(PVM pVM, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, va_list va)
    300320{
    301321#if 0 /// @todo implement Ring-0 and GC VMSetError
     
    308328
    309329    /* calc reasonable start size. */
    310     size_t cchErrorID = pszErrorID ? strlen(pszErrorID) : 0;
     330    size_t cchErrorID = pszErrorId ? strlen(pszErrorId) : 0;
    311331    size_t cchFormat = strlen(pszFormat);
    312332    size_t cb = sizeof(VMRUNTIMEERROR)
     
    322342        PVMRUNTIMEERROR pErr = (PVMRUNTIMEERROR)pv;
    323343        pErr->cbAllocated = cb;
     344        pErr->fFlags = fFlags;
    324345        pErr->off = sizeof(PVMRUNTIMEERROR);
    325         pErr->offErrorID = = 0;
     346        pErr->offErrorID = 0;
    326347
    327348        if (cchErrorID)
    328349        {
    329350            pErr->offErrorID = pErr->off;
    330             memcpy((uint8_t *)pErr + pErr->off, pszErrorID, cchErrorID + 1);
     351            memcpy((uint8_t *)pErr + pErr->off, pszErrorId, cchErrorID + 1);
    331352            pErr->off += cchErrorID + 1;
    332353        }
  • trunk/src/VBox/VMM/VMMGC/PDMGCDevice.cpp

    r18101 r18645  
    6464static DECLCALLBACK(int)  pdmGCDevHlp_VMSetError(PPDMDEVINS pDevIns, int rc, RT_SRC_POS_DECL, const char *pszFormat, ...);
    6565static 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);
     66static DECLCALLBACK(int)  pdmGCDevHlp_VMSetRuntimeError(PPDMDEVINS pDevIns, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, ...);
     67static DECLCALLBACK(int)  pdmGCDevHlp_VMSetRuntimeErrorV(PPDMDEVINS pDevIns, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, va_list va);
    6868static DECLCALLBACK(int)  pdmGCDevHlp_PATMSetMMIOPatchInfo(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, RTGCPTR pCachedData);
    6969static DECLCALLBACK(PVM)  pdmGCDevHlp_GetVM(PPDMDEVINS pDevIns);
     
    322322
    323323/** @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, fFatal, pszErrorID, pszFormat, args);
    330     va_end(args);
     324static 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);
    331331    return rc;
    332332}
     
    334334
    335335/** @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, fFatal, pszErrorID, pszFormat, va);
     336static 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);
    340340    return rc;
    341341}
  • trunk/src/VBox/VMM/VMMR0/PDMR0Device.cpp

    r18101 r18645  
    6565static DECLCALLBACK(int)  pdmR0DevHlp_VMSetError(PPDMDEVINS pDevIns, int rc, RT_SRC_POS_DECL, const char *pszFormat, ...);
    6666static 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);
     67static DECLCALLBACK(int)  pdmR0DevHlp_VMSetRuntimeError(PPDMDEVINS pDevIns, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, ...);
     68static DECLCALLBACK(int)  pdmR0DevHlp_VMSetRuntimeErrorV(PPDMDEVINS pDevIns, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, va_list va);
    6969static DECLCALLBACK(int)  pdmR0DevHlp_PATMSetMMIOPatchInfo(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, RTGCPTR pCachedData);
    7070static DECLCALLBACK(PVM)  pdmR0DevHlp_GetVM(PPDMDEVINS pDevIns);
     
    325325
    326326/** @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, fFatal, pszErrorID, pszFormat, args);
    333     va_end(args);
     327static 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);
    334334    return rc;
    335335}
     
    337337
    338338/** @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, fFatal, pszErrorID, pszFormat, va);
     339static 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);
    343343    return rc;
    344344}
  • trunk/src/VBox/VMM/testcase/tstVMREQ.cpp

    r14831 r18645  
    5353 * Testings va_list passing in VMSetRuntimeError.
    5454 */
    55 static DECLCALLBACK(void) MyAtRuntimeError(PVM pVM, void *pvUser, bool fFatal, const char *pszErrorId, const char *pszFormat, va_list va)
     55static DECLCALLBACK(void) MyAtRuntimeError(PVM pVM, void *pvUser, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, va_list va)
    5656{
    5757    if (strcmp((const char *)pvUser, "user argument"))
     
    6060        g_cErrors++;
    6161    }
    62     if (fFatal)
    63     {
    64         RTPrintf(TESTCASE ": fFatal=%d!\n", fFatal);
     62    if (fFlags)
     63    {
     64        RTPrintf(TESTCASE ": fFlags=%#x!\n", fFlags);
    6565        g_cErrors++;
    6666    }
     
    287287        PassVA(pVM, "hello %s", "world");
    288288        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");
    290290
    291291        /*
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette