Changeset 58161 in vbox for trunk/src/VBox/Devices/VMMDev
- Timestamp:
- Oct 9, 2015 6:07:59 PM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 103269
- Location:
- trunk/src/VBox/Devices/VMMDev
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/VMMDev/VMMDev.cpp
r58160 r58161 438 438 { 439 439 int rc; 440 if (pThis->fH BCheckEnabled)441 { 442 uint64_t const nsNowTS = TMTimerGetNano(pThis->p HearbeatFlatlinedTimer);443 if (!pThis->f HasMissedHB)440 if (pThis->fHeartbeatActive) 441 { 442 uint64_t const nsNowTS = TMTimerGetNano(pThis->pFlatlinedTimer); 443 if (!pThis->fFlatlined) 444 444 { /* likely */ } 445 445 else 446 446 { 447 447 LogRel(("VMMDev: GuestHeartBeat: Guest is alive (gone %'llu ns)\n", nsNowTS - pThis->nsLastHeartbeatTS)); 448 ASMAtomicWriteBool(&pThis->f HasMissedHB, false);448 ASMAtomicWriteBool(&pThis->fFlatlined, false); 449 449 } 450 450 ASMAtomicWriteU64(&pThis->nsLastHeartbeatTS, nsNowTS); 451 451 452 452 /* Postpone (or restart if we missed a beat) the timeout timer. */ 453 rc = TMTimerSetNano(pThis->p HearbeatFlatlinedTimer, pThis->cNsHeartbeatTimeout);453 rc = TMTimerSetNano(pThis->pFlatlinedTimer, pThis->cNsHeartbeatTimeout); 454 454 } 455 455 else … … 467 467 { 468 468 PVMMDEV pThis = (PVMMDEV)pvUser; 469 if (pThis->fH BCheckEnabled)469 if (pThis->fHeartbeatActive) 470 470 { 471 471 uint64_t cNsElapsed = TMTimerGetNano(pTimer) - pThis->nsLastHeartbeatTS; 472 if ( !pThis->f HasMissedHB472 if ( !pThis->fFlatlined 473 473 && cNsElapsed >= pThis->cNsHeartbeatInterval) 474 474 { 475 475 LogRel(("VMMDev: vmmDevHeartbeatFlatlinedTimer: Guest seems to be unresponsive. Last heartbeat received %RU64 seconds ago\n", 476 476 cNsElapsed / RT_NS_1SEC)); 477 ASMAtomicWriteBool(&pThis->f HasMissedHB, true);477 ASMAtomicWriteBool(&pThis->fFlatlined, true); 478 478 } 479 479 } … … 496 496 pReq->cNsInterval = pThis->cNsHeartbeatInterval; 497 497 498 if (pReq->fEnabled != pThis->fH BCheckEnabled)499 { 500 ASMAtomicWriteBool(&pThis->fH BCheckEnabled, pReq->fEnabled);498 if (pReq->fEnabled != pThis->fHeartbeatActive) 499 { 500 ASMAtomicWriteBool(&pThis->fHeartbeatActive, pReq->fEnabled); 501 501 if (pReq->fEnabled) 502 502 { 503 503 /* Start the countdown. */ 504 rc = TMTimerSetNano(pThis->p HearbeatFlatlinedTimer, pThis->cNsHeartbeatTimeout);504 rc = TMTimerSetNano(pThis->pFlatlinedTimer, pThis->cNsHeartbeatTimeout); 505 505 if (RT_SUCCESS(rc)) 506 506 LogRel(("VMMDev: Heartbeat checking timer set to trigger every %RU64 milliseconds\n", … … 511 511 else 512 512 { 513 rc = TMTimerStop(pThis->p HearbeatFlatlinedTimer);513 rc = TMTimerStop(pThis->pFlatlinedTimer); 514 514 LogRel(("VMMDev: Heartbeat checking timer has been stopped, rc=%Rrc\n", rc)); 515 515 } … … 517 517 else 518 518 { 519 LogRel(("VMMDev: vmmDevReqHandler_HeartbeatConfigure: fHBCheckEnabled=%RTbool\n", pThis->fH BCheckEnabled));519 LogRel(("VMMDev: vmmDevReqHandler_HeartbeatConfigure: fHBCheckEnabled=%RTbool\n", pThis->fHeartbeatActive)); 520 520 rc = VINF_SUCCESS; 521 521 } … … 4176 4176 */ 4177 4177 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL, vmmDevHeartbeatFlatlinedTimer, pThis, 4178 TMTIMER_FLAGS_NO_CRIT_SECT, "Heartbeat flatlined", &pThis->p HearbeatFlatlinedTimer);4178 TMTIMER_FLAGS_NO_CRIT_SECT, "Heartbeat flatlined", &pThis->pFlatlinedTimer); 4179 4179 AssertRCReturn(rc, rc); 4180 4180 -
trunk/src/VBox/Devices/VMMDev/VMMDevState.h
r58159 r58161 360 360 #endif /* !VBOX_WITHOUT_TESTING_FEATURES */ 361 361 362 /** @name Heartbeat 363 * @{ */ 362 364 /** Timestamp of the last heartbeat from guest in nanosec. */ 363 365 uint64_t volatile nsLastHeartbeatTS; 364 366 /** Indicates whether we missed HB from guest on last check. */ 365 bool volatile f HasMissedHB;367 bool volatile fFlatlined; 366 368 /** Indicates whether heartbeat check is active. */ 367 bool volatile fH BCheckEnabled;369 bool volatile fHeartbeatActive; 368 370 /** Alignment padding. */ 369 371 bool afAlignment8[6]; … … 375 377 uint64_t cNsHeartbeatTimeout; 376 378 /** Timer for signalling a flatlined guest. */ 377 PTMTIMERR3 pHearbeatFlatlinedTimer; 379 PTMTIMERR3 pFlatlinedTimer; 380 /** @} */ 378 381 } VMMDevState; 379 382 typedef VMMDevState VMMDEV;
Note:
See TracChangeset
for help on using the changeset viewer.