- Timestamp:
- Jul 24, 2024 9:01:08 AM (6 months ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/TM.cpp
r104131 r105463 186 186 static DECLCALLBACK(int) tmR3Save(PVM pVM, PSSMHANDLE pSSM); 187 187 static DECLCALLBACK(int) tmR3Load(PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass); 188 static DECLCALLBACK(int) tmR3LoadDone(PVM pVM, PSSMHANDLE pSSM); 188 189 #ifdef VBOX_WITH_STATISTICS 189 190 static void tmR3TimerQueueRegisterStats(PVM pVM, PTMTIMERQUEUE pQueue, uint32_t cTimers); … … 693 694 NULL, NULL, NULL, 694 695 NULL, tmR3Save, NULL, 695 NULL, tmR3Load, NULL);696 NULL, tmR3Load, tmR3LoadDone); 696 697 if (RT_FAILURE(rc)) 697 698 return rc; … … 1093 1094 } 1094 1095 1096 #if 1 1097 # include <iprt/message.h> 1098 /** @callback_method_impl{FNTMTIMERINT} */ 1099 static DECLCALLBACK(void) tmR3AutoPowerOffTimer(PVM pVM, TMTIMERHANDLE hTimer, void *pvUser) 1100 { 1101 RT_NOREF(hTimer, pvUser); 1102 RTMsgInfo("The automatic power off timer fired...\n"); 1103 LogRel(("The automatic power off timer fired...\n")); 1104 int rc = VMR3ReqCallNoWait(pVM, VMCPUID_ANY_QUEUE, (PFNRT)VMR3PowerOff, 1, pVM->pUVM); 1105 AssertLogRelRC(rc); 1106 } 1107 #endif 1108 1095 1109 1096 1110 /** … … 1148 1162 tmR3TimerQueueRegisterStats(pVM, &pVM->tm.s.aTimerQueues[idxQueue], UINT32_MAX); 1149 1163 } 1164 #endif 1165 1166 #ifdef TM_SECONDS_TO_AUTOMATIC_POWER_OFF 1167 /* 1168 * Automatic VM shutdown timer. 1169 */ 1170 rc = TMR3TimerCreate(pVM, TMCLOCK_VIRTUAL, tmR3AutoPowerOffTimer, NULL, TMTIMER_FLAGS_NO_RING0, 1171 "Auto power off after " RT_XSTR(TM_SECONDS_TO_AUTOMATIC_POWER_OFF) " sec", &hTimer); 1172 AssertLogRelRCReturn(rc, rc); 1173 TMTimerSetMillies(pVM, hTimer, TM_SECONDS_TO_AUTOMATIC_POWER_OFF * RT_MS_1SEC); 1174 pVM->tm.s.hAutoPowerOff = hTimer; 1150 1175 #endif 1151 1176 … … 1486 1511 return VINF_SUCCESS; 1487 1512 } 1513 1514 1515 /** 1516 * @callback_method_impl{FNSSMINTLOADDONE, For rearming autopoweroff} 1517 */ 1518 static DECLCALLBACK(int) tmR3LoadDone(PVM pVM, PSSMHANDLE pSSM) 1519 { 1520 RT_NOREF(pVM, pSSM); 1521 #ifdef TM_SECONDS_TO_AUTOMATIC_POWER_OFF 1522 TMTimerSetMillies(pVM, pVM->tm.s.hAutoPowerOff, TM_SECONDS_TO_AUTOMATIC_POWER_OFF * RT_MS_1SEC); 1523 #endif 1524 return VINF_SUCCESS; 1525 } 1526 1488 1527 1489 1528 #ifdef VBOX_WITH_STATISTICS -
trunk/src/VBox/VMM/include/TMInternal.h
r104131 r105463 55 55 #define TMCLOCK_FREQ_VIRTUAL UINT32_C(1000000000) 56 56 57 /** @def TM_SECONDS_TO_AUTOMATIC_POWER_OFF 58 * Powers off the VM automatically after the defined number of seconds. 59 * This is for debugging only. */ 60 #if defined(DOXYGEN_RUNNING) || 0 61 # define TM_SECONDS_TO_AUTOMATIC_POWER_OFF 45 62 #endif 57 63 58 64 /** … … 740 746 STAMCOUNTER StatTSCSyncNotTicking; 741 747 /** @} */ 748 749 #ifdef TM_SECONDS_TO_AUTOMATIC_POWER_OFF 750 /** The automatic power off timer. */ 751 TMTIMERHANDLE hAutoPowerOff; 752 #endif 742 753 } TM; 743 754 /** Pointer to TM VM instance data. */
Note:
See TracChangeset
for help on using the changeset viewer.