Changeset 32102 in vbox for trunk/src/VBox/VMM/FTM.cpp
- Timestamp:
- Aug 30, 2010 2:49:44 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/FTM.cpp
r32096 r32102 117 117 AssertRCReturn(rc, rc); 118 118 119 STAM_REL_REG(pVM, &pVM->ftm.s.StatReceivedMem, STAMTYPE_COUNTER, "/FT/Received/Mem", STAMUNIT_BYTES, "The amount of memory pages that was received."); 120 STAM_REL_REG(pVM, &pVM->ftm.s.StatReceivedState, STAMTYPE_COUNTER, "/FT/Received/State", STAMUNIT_BYTES, "The amount of state information that was received."); 121 STAM_REL_REG(pVM, &pVM->ftm.s.StatSentMem, STAMTYPE_COUNTER, "/FT/Sent/Mem", STAMUNIT_BYTES, "The amount of memory pages that was sent."); 122 STAM_REL_REG(pVM, &pVM->ftm.s.StatSentState, STAMTYPE_COUNTER, "/FT/Sent/State", STAMUNIT_BYTES, "The amount of state information that was sent."); 119 /* 120 * Register statistics. 121 */ 122 STAM_REL_REG(pVM, &pVM->ftm.s.StatReceivedMem, STAMTYPE_COUNTER, "/FT/Received/Mem", STAMUNIT_BYTES, "The amount of memory pages that was received."); 123 STAM_REL_REG(pVM, &pVM->ftm.s.StatReceivedState, STAMTYPE_COUNTER, "/FT/Received/State", STAMUNIT_BYTES, "The amount of state information that was received."); 124 STAM_REL_REG(pVM, &pVM->ftm.s.StatSentMem, STAMTYPE_COUNTER, "/FT/Sent/Mem", STAMUNIT_BYTES, "The amount of memory pages that was sent."); 125 STAM_REL_REG(pVM, &pVM->ftm.s.StatSentState, STAMTYPE_COUNTER, "/FT/Sent/State", STAMUNIT_BYTES, "The amount of state information that was sent."); 126 STAM_REL_REG(pVM, &pVM->ftm.s.StatDeltaVM, STAMTYPE_COUNTER, "/FT/Sync/DeltaVM", STAMUNIT_OCCURENCES, "Number of delta vm syncs."); 127 STAM_REL_REG(pVM, &pVM->ftm.s.StatFullSync, STAMTYPE_COUNTER, "/FT/Sync/Full", STAMUNIT_OCCURENCES, "Number of full vm syncs."); 128 STAM_REL_REG(pVM, &pVM->ftm.s.StatDeltaMem, STAMTYPE_COUNTER, "/FT/Sync/DeltaMem", STAMUNIT_OCCURENCES, "Number of delta mem syncs."); 123 129 124 130 return VINF_SUCCESS; … … 578 584 579 585 /** 586 * VMR3ReqCallWait callback 587 * 588 * @param pVM The VM handle. 589 * 590 */ 591 static DECLCALLBACK(void) ftmR3WriteProtectMemory(PVM pVM) 592 { 593 int rc = PGMR3PhysWriteProtectRAM(pVM); 594 AssertRC(rc); 595 } 596 597 /** 580 598 * Sync the VM state partially or fully 581 599 * … … 584 602 * @param enmState Which state to sync 585 603 */ 586 static DECLCALLBACK(void)ftmR3PerformSync(PVM pVM, FTMSYNCSTATE enmState)604 static int ftmR3PerformSync(PVM pVM, FTMSYNCSTATE enmState) 587 605 { 588 606 int rc; … … 592 610 { 593 611 rc = VMR3Suspend(pVM); 594 AssertR eturnVoid(RT_SUCCESS(rc));612 AssertRCReturn(rc, rc); 595 613 } 596 614 … … 604 622 bool fSuspended = false; 605 623 624 STAM_REL_COUNTER_INC((fFullSync) ? &pVM->ftm.s.StatFullSync : &pVM->ftm.s.StatDeltaVM); 625 606 626 rc = ftmR3TcpSubmitCommand(pVM, (fFullSync) ? "full-sync" : "checkpoint"); 607 627 AssertRC(rc); … … 619 639 case FTMSYNCSTATE_DELTA_MEMORY: 620 640 /* Nothing to do as we sync the memory in an async thread; no need to block EMT. */ 641 STAM_REL_COUNTER_INC(&pVM->ftm.s.StatDeltaMem); 621 642 break; 622 643 } 644 623 645 /* Write protect all memory. */ 624 rc = PGMR3PhysWriteProtectRAM(pVM);625 AssertRC (rc);646 rc = VMR3ReqCallWait(pVM, VMCPUID_ANY, (PFNRT)ftmR3WriteProtectMemory, 1, pVM); 647 AssertRCReturn(rc, rc); 626 648 627 649 if (enmState != FTMSYNCSTATE_DELTA_MEMORY) 628 650 { 629 651 rc = VMR3Resume(pVM); 630 AssertRC(rc); 631 } 652 AssertRCReturn(rc, rc); 653 } 654 return VINF_SUCCESS; 632 655 } 633 656 … … 725 748 */ 726 749 727 rc = VMR3ReqCallWait(pVM, VMCPUID_ANY, (PFNRT)ftmR3PerformSync, 2, pVM, FTMSYNCSTATE_FULL); 728 AssertRC(rc); 750 rc = ftmR3PerformSync(pVM, FTMSYNCSTATE_FULL); 729 751 730 752 for (;;) … … 743 765 744 766 /* sync the changed memory with the standby node. */ 745 rc = VMR3ReqCallWait(pVM, VMCPUID_ANY, (PFNRT)ftmR3PerformSync, 2, pVM, FTMSYNCSTATE_DELTA_MEMORY); 746 AssertRC(rc); 767 rc = ftmR3PerformSync(pVM, FTMSYNCSTATE_DELTA_MEMORY); 747 768 748 769 /* Enumerate all dirty pages and send them to the standby VM. */ … … 1045 1066 VMMR3DECL(int) FTMR3SyncState(PVM pVM) 1046 1067 { 1068 VM_ASSERT_OTHER_THREAD(pVM); 1069 1047 1070 if (!pVM->fFaultTolerantMaster) 1048 1071 return VINF_SUCCESS; … … 1060 1083 1061 1084 /* Sync state + changed memory with the standby node. */ 1062 rc = VMR3ReqCallWait(pVM, VMCPUID_ANY, (PFNRT)ftmR3PerformSync, 2, pVM, FTMSYNCSTATE_DELTA_VM); 1063 AssertRC(rc); 1085 rc = ftmR3PerformSync(pVM, FTMSYNCSTATE_DELTA_VM); 1064 1086 1065 1087 PDMCritSectLeave(&pVM->ftm.s.CritSect);
Note:
See TracChangeset
for help on using the changeset viewer.