- Timestamp:
- Aug 27, 2010 1:05:10 PM (14 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/FTM.cpp
r32002 r32051 570 570 { 571 571 int rc; 572 bool fFullSync = false; 572 573 573 574 if (enmState != FTMSYNCSTATE_DELTA_MEMORY) … … 580 581 { 581 582 case FTMSYNCSTATE_FULL: 583 fFullSync = true; 584 /* no break */ 585 case FTMSYNCSTATE_DELTA_VM: 582 586 { 583 587 bool fSuspended = false; 584 588 585 rc = ftmR3TcpSubmitCommand(pVM, "full-sync");589 rc = ftmR3TcpSubmitCommand(pVM, (fFullSync) ? "full-sync" : "checkpoint"); 586 590 AssertRC(rc); 587 591 592 pVM->ftm.s.fDeltaLoadSaveActive = (fFullSync == false); 588 593 rc = VMR3Save(pVM, NULL /* pszFilename */, &g_ftmR3TcpOps, pVM, true /* fContinueAfterwards */, NULL, NULL, &fSuspended); 594 pVM->ftm.s.fDeltaLoadSaveActive = false; 589 595 AssertRC(rc); 590 596 591 rc = ftmR3TcpReadACK(pVM, "full-sync-complete");597 rc = ftmR3TcpReadACK(pVM, (fFullSync) ? "full-sync-complete" : "checkpoint-complete"); 592 598 AssertRC(rc); 593 599 break; 594 600 } 595 596 case FTMSYNCSTATE_DELTA_VM:597 break;598 601 599 602 case FTMSYNCSTATE_DELTA_MEMORY: … … 812 815 for (;;) 813 816 { 817 bool fFullSync = false; 814 818 char szCmd[128]; 819 815 820 rc = ftmR3TcpReadLine(pVM, szCmd, sizeof(szCmd)); 816 821 AssertRC(rc); … … 866 871 } 867 872 else 868 if (!strcmp(szCmd, "heartbeat")) 869 { 870 } 871 else 872 if (!strcmp(szCmd, "checkpoint")) 873 { 874 } 875 else 876 if (!strcmp(szCmd, "full-sync")) 873 if ( !strcmp(szCmd, "checkpoint") 874 || (fFullSync = true) /* intended assignment */ 875 || !strcmp(szCmd, "full-sync")) 877 876 { 878 877 rc = ftmR3TcpWriteACK(pVM); … … 884 883 pVM->ftm.s.syncstate.uOffStream = 0; 885 884 885 pVM->ftm.s.fDeltaLoadSaveActive = (fFullSync == false); 886 886 rc = VMR3LoadFromStream(pVM, &g_ftmR3TcpOps, pVM, NULL, NULL); 887 pVM->ftm.s.fDeltaLoadSaveActive = false; 887 888 RTSocketRelease(pVM->ftm.s.hSocket); 888 889 AssertRC(rc); … … 907 908 rc = ftmR3TcpWriteACK(pVM); 908 909 AssertRC(rc); 909 } 910 } 910 911 } 911 912 LogFlowFunc(("returns mRc=%Rrc\n", rc)); -
trunk/src/VBox/VMM/FTMInternal.h
r31895 r32051 60 60 /** Set when this master VM is busy with checkpointing. */ 61 61 bool fCheckpointingActive; 62 bool fAlignment[6]; 62 /** Set when VM save/restore should only include changed pages. */ 63 bool fDeltaLoadSaveActive; 64 bool fAlignment[5]; 63 65 64 66 /** Current active socket. */ -
trunk/src/VBox/VMM/PGMSavedState.cpp
r31847 r32051 32 32 #include <VBox/param.h> 33 33 #include <VBox/err.h> 34 #include <VBox/ftm.h> 34 35 35 36 #include <iprt/asm.h> … … 398 399 static int pgmR3SaveRomVirginPages(PVM pVM, PSSMHANDLE pSSM, bool fLiveSave) 399 400 { 401 if (FTMIsDeltaLoadSaveActive(pVM)) 402 return VINF_SUCCESS; /* nothing to do as nothing has changed here */ 403 400 404 pgmLock(pVM); 401 405 for (PPGMROMRANGE pRom = pVM->pgm.s.pRomRangesR3; pRom; pRom = pRom->pNextR3) … … 473 477 static int pgmR3SaveShadowedRomPages(PVM pVM, PSSMHANDLE pSSM, bool fLiveSave, bool fFinalPass) 474 478 { 479 if (FTMIsDeltaLoadSaveActive(pVM)) 480 return VINF_SUCCESS; /* nothing to do as we deal with those pages seperately */ 481 475 482 /* 476 483 * The Shadowed ROMs. … … 1513 1520 RTGCPHYS GCPhysCur = 0; 1514 1521 PPGMRAMRANGE pCur; 1522 bool fFTMDeltaSaveActive = FTMIsDeltaLoadSaveActive(pVM); 1523 1515 1524 pgmLock(pVM); 1516 1525 do … … 1538 1547 } 1539 1548 1549 PPGMPAGE pCurPage = &pCur->aPages[iPage]; 1550 1540 1551 /* 1541 1552 * Only save pages that haven't changed since last scan and are dirty. … … 1550 1561 if (paLSPages[iPage].fIgnore) 1551 1562 continue; 1552 if (PGM_PAGE_GET_TYPE( &pCur->aPages[iPage]) != PGMPAGETYPE_RAM) /* in case of recent remappings */1563 if (PGM_PAGE_GET_TYPE(pCurPage) != PGMPAGETYPE_RAM) /* in case of recent remappings */ 1553 1564 continue; 1554 if ( PGM_PAGE_GET_STATE( &pCur->aPages[iPage])1565 if ( PGM_PAGE_GET_STATE(pCurPage) 1555 1566 != ( paLSPages[iPage].fZero 1556 1567 ? PGM_PAGE_STATE_ZERO … … 1569 1580 { 1570 1581 #ifdef PGMLIVESAVERAMPAGE_WITH_CRC32 1571 if (PGM_PAGE_GET_TYPE( &pCur->aPages[iPage]) != PGMPAGETYPE_RAM)1582 if (PGM_PAGE_GET_TYPE(pCurPage) != PGMPAGETYPE_RAM) 1572 1583 pgmR3StateVerifyCrc32ForRamPage(pVM, pCur, paLSPages, iPage, "save#1"); 1573 1584 #endif 1574 1585 continue; 1575 1586 } 1576 if (PGM_PAGE_GET_TYPE( &pCur->aPages[iPage]) != PGMPAGETYPE_RAM)1587 if (PGM_PAGE_GET_TYPE(pCurPage) != PGMPAGETYPE_RAM) 1577 1588 continue; 1578 1589 } … … 1583 1594 int rc; 1584 1595 RTGCPHYS GCPhys = pCur->GCPhys + ((RTGCPHYS)iPage << PAGE_SHIFT); 1585 bool fZero = PGM_PAGE_IS_ZERO( &pCur->aPages[iPage]) || PGM_PAGE_IS_BALLOONED(&pCur->aPages[iPage]);1596 bool fZero = PGM_PAGE_IS_ZERO(pCurPage) || PGM_PAGE_IS_BALLOONED(pCurPage); 1586 1597 1587 1598 if (!fZero) … … 1593 1604 uint8_t abPage[PAGE_SIZE]; 1594 1605 void const *pvPage; 1595 rc = pgmPhysGCPhys2CCPtrInternalReadOnly(pVM, &pCur->aPages[iPage], GCPhys, &pvPage);1606 rc = pgmPhysGCPhys2CCPtrInternalReadOnly(pVM, pCurPage, GCPhys, &pvPage); 1596 1607 if (RT_SUCCESS(rc)) 1597 1608 { … … 1608 1619 if (!ASMMemIsZeroPage(pvPage)) 1609 1620 { 1610 if (GCPhys == GCPhysLast + PAGE_SIZE) 1611 SSMR3PutU8(pSSM, PGM_STATE_REC_RAM_RAW); 1621 if (fFTMDeltaSaveActive) 1622 { 1623 if ( PGM_PAGE_IS_WRITTEN_TO(pCurPage) 1624 || PGM_PAGE_IS_FT_DIRTY(pCurPage)) 1625 { 1626 SSMR3PutU8(pSSM, PGM_STATE_REC_RAM_RAW | PGM_STATE_REC_FLAG_ADDR); 1627 SSMR3PutGCPhys(pSSM, GCPhys); 1628 rc = SSMR3PutMem(pSSM, abPage, PAGE_SIZE); 1629 } 1630 /* else nothing changed, so skip it. */ 1631 } 1612 1632 else 1613 1633 { 1614 SSMR3PutU8(pSSM, PGM_STATE_REC_RAM_RAW | PGM_STATE_REC_FLAG_ADDR); 1615 SSMR3PutGCPhys(pSSM, GCPhys); 1634 if (GCPhys == GCPhysLast + PAGE_SIZE) 1635 SSMR3PutU8(pSSM, PGM_STATE_REC_RAM_RAW); 1636 else 1637 { 1638 SSMR3PutU8(pSSM, PGM_STATE_REC_RAM_RAW | PGM_STATE_REC_FLAG_ADDR); 1639 SSMR3PutGCPhys(pSSM, GCPhys); 1640 } 1641 rc = SSMR3PutMem(pSSM, abPage, PAGE_SIZE); 1616 1642 } 1617 rc = SSMR3PutMem(pSSM, abPage, PAGE_SIZE);1618 1643 } 1619 1644 else … … 1675 1700 } /* for each range */ 1676 1701 } while (pCur); 1702 1677 1703 pgmUnlock(pVM); 1678 1704 -
trunk/src/VBox/VMM/VMMAll/FTMAll.cpp
r31792 r32051 49 49 #endif 50 50 } 51 52 53 /** 54 * Checks if the delta save/load is enabled 55 * 56 * @returns true/false 57 * 58 * @param pVM The VM to operate on. 59 */ 60 VMMDECL(bool) FTMIsDeltaLoadSaveActive(PVM pVM) 61 { 62 return pVM->ftm.s.fDeltaLoadSaveActive; 63 } 64
Note:
See TracChangeset
for help on using the changeset viewer.