VirtualBox

Ignore:
Timestamp:
Oct 7, 2021 10:34:32 AM (3 years ago)
Author:
vboxsync
Message:

Devices/Secureity/DrvTpmEmuTpms: Implement a VM reset callback, bugref:10075

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Security/DrvTpmEmuTpms.cpp

    r91595 r91615  
    322322    {
    323323        LogRel(("DrvTpmEmuTpms#%u: Failed to initialize TPM emulation with %#x\n",
     324                pDrvIns->iInstance, rcTpm));
     325        PDMDrvHlpVMSetError(pDrvIns, VERR_INVALID_PARAMETER, RT_SRC_POS, "Failed to startup the TPM with %u", rcTpm);
     326    }
     327}
     328
     329
     330/**
     331 * @interface_method_impl{PDMDRVREG,pfnReset}
     332 */
     333static DECLCALLBACK(void) drvTpmEmuTpmsReset(PPDMDRVINS pDrvIns)
     334{
     335    PDMDRV_CHECK_VERSIONS_RETURN_VOID(pDrvIns);
     336
     337    TPMLIB_Terminate();
     338    TPM_RESULT rcTpm = TPMLIB_MainInit();
     339    if (RT_UNLIKELY(rcTpm != TPM_SUCCESS))
     340    {
     341        LogRel(("DrvTpmEmuTpms#%u: Failed to reset TPM emulation with %#x\n",
    324342                pDrvIns->iInstance, rcTpm));
    325343        PDMDrvHlpVMSetError(pDrvIns, VERR_INVALID_PARAMETER, RT_SRC_POS, "Failed to startup the TPM with %u", rcTpm);
     
    487505    drvTpmEmuTpmsPowerOn,
    488506    /* pfnReset */
    489     NULL,
     507    drvTpmEmuTpmsReset,
    490508    /* pfnSuspend */
    491509    NULL,
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