VirtualBox

Changeset 105168 in vbox


Ignore:
Timestamp:
Jul 6, 2024 12:01:23 AM (7 months ago)
Author:
vboxsync
Message:

VMM/DBGF: Added a /DBGF/PowerOffOnBsod boolean option (default false). bugref:10687

Location:
trunk/src/VBox/VMM
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/DBGFR3BugCheck.cpp

    r98103 r105168  
    4141#include <iprt/assert.h>
    4242#include <iprt/ctype.h>
     43#include <iprt/message.h>
    4344
    4445
     
    5960int dbgfR3BugCheckInit(PVM pVM)
    6061{
     62    PCFGMNODE const pCfgNode = CFGMR3GetChild(CFGMR3GetRoot(pVM), "DBGF/");
     63
     64    /** @cfgm{/DBGF/PowerOffOnBsod, boolean, false}
     65     * Enables powering off the VM automatically on a BSOD.
     66     */
     67    pVM->dbgf.s.BugCheck.fCfgPowerOffOnBsod;
     68    int rc = CFGMR3QueryBoolDef(pCfgNode, "PowerOffOnBsod", &pVM->dbgf.s.BugCheck.fCfgPowerOffOnBsod, false);
     69    AssertLogRelRCReturn(rc, rc);
     70
    6171    pVM->dbgf.s.BugCheck.idCpu    = NIL_VMCPUID;
    6272    pVM->dbgf.s.BugCheck.enmEvent = DBGFEVENT_END;
     
    863873     * Take actions.
    864874     */
    865     /** @todo Take actions on BSOD, like notifying main or stopping the VM...
    866      * For testing it makes little sense to continue after a BSOD. */
     875    if (pVM->dbgf.s.BugCheck.fCfgPowerOffOnBsod)
     876    {
     877        RTMsgError("Powering off - guest BSOD: %s\n", szDetails);
     878        PUVM const pUVM = pVM->pUVM;
     879        VMR3ReqCallNoWaitU(pUVM, VMCPUID_ANY_QUEUE, (PFNRT)VMR3PowerOff, 1, pUVM);
     880    }
    867881    return rc;
    868882}
  • trunk/src/VBox/VMM/include/DBGFInternal.h

    r102092 r105168  
    11621162
    11631163    /**
    1164      * Bug check data.
    1165      * @note This will not be reset on reset.
     1164     * Bug check configuration and data.
     1165     * @note The data will not be reset on reset.
    11661166     */
    11671167    struct
    11681168    {
     1169        /** Whether to power off VM on BSOD.   */
     1170        bool                    fCfgPowerOffOnBsod;
     1171        /** Explicit padding. */
     1172        bool                    afReserved[3];
     1173
    11691174        /** The ID of the CPU reporting it. */
    11701175        VMCPUID                 idCpu;
     
    11741179        /** The total reset count at the time (VMGetResetCount). */
    11751180        uint32_t                uResetNo;
    1176         /** Explicit padding. */
    1177         uint32_t                uPadding;
    11781181        /** When it was reported (TMVirtualGet). */
    11791182        uint64_t                uTimestamp;
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