VirtualBox

Changeset 22480 in vbox for trunk/src/VBox/Devices/PC


Ignore:
Timestamp:
Aug 26, 2009 5:14:13 PM (15 years ago)
Author:
vboxsync
Message:

SSM,VMM,Devices,Main,VBoxBFE: Live snapshot/migration SSM API adjustments.

Location:
trunk/src/VBox/Devices/PC
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/PC/DevACPI.cpp

    r21855 r22480  
    17741774
    17751775static DECLCALLBACK(int) acpi_load_state(PPDMDEVINS pDevIns, PSSMHANDLE pSSMHandle,
    1776                                          uint32_t u32Version)
     1776                                         uint32_t uVersion, uint32_t uPhase)
    17771777{
    17781778    ACPIState *s = PDMINS_2_DATA(pDevIns, ACPIState *);
    1779     int rc;
     1779
     1780    Assert(uPhase == SSM_PHASE_FINAL); NOREF(uPhase);
    17801781
    17811782    /*
     
    17831784     * after state successfully loaded.
    17841785     */
    1785     rc = acpiUnregisterPmHandlers(s);
     1786    int rc = acpiUnregisterPmHandlers(s);
    17861787    if (RT_FAILURE(rc))
    17871788        return rc;
    17881789
    1789     switch (u32Version)
     1790    switch (uVersion)
    17901791    {
    17911792        case 4:
     
    21822183                                   acpiPciConfigWrite, &s->pfnAcpiPciConfigWrite);
    21832184
    2184     rc = PDMDevHlpSSMRegister(pDevIns, pDevIns->pDevReg->szDeviceName, iInstance, 5, sizeof(*s),
    2185                               NULL, acpi_save_state, NULL, NULL, acpi_load_state,  NULL);
     2185    rc = PDMDevHlpSSMRegister(pDevIns, 5, sizeof(*s), acpi_save_state, acpi_load_state);
    21862186    if (RT_FAILURE(rc))
    21872187        return rc;
  • trunk/src/VBox/Devices/PC/DevAPIC.cpp

    r21389 r22480  
    23572357 * @copydoc FNSSMDEVLOADEXEC
    23582358 */
    2359 static DECLCALLBACK(int) apicLoadExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSMHandle, uint32_t u32Version)
     2359static DECLCALLBACK(int) apicLoadExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSMHandle, uint32_t uVersion, uint32_t uPhase)
    23602360{
    23612361    APICDeviceInfo *dev = PDMINS_2_DATA(pDevIns, APICDeviceInfo *);
    2362     /* load all APICs data, @todo: is it correct? */
     2362    Assert(uPhase == SSM_PHASE_FINAL); NOREF(uPhase);
     2363
     2364    /* load all APICs data */ /** @todo: is it correct? */
    23632365    foreach_apic(dev, 0xffffffff,
    2364                  if (apic_load(pSSMHandle, apic, u32Version))
     2366                 if (apic_load(pSSMHandle, apic, uVersion))
    23652367                 {
    23662368                      AssertFailed();
     
    26402642     * Saved state.
    26412643     */
    2642     rc = PDMDevHlpSSMRegister(pDevIns, pDevIns->pDevReg->szDeviceName, iInstance, 2 /* version */,
    2643                               sizeof(*pThis), NULL, apicSaveExec, NULL, NULL, apicLoadExec, NULL);
     2644    rc = PDMDevHlpSSMRegister(pDevIns, 2 /* version */, sizeof(*pThis), apicSaveExec, apicLoadExec);
    26442645    if (RT_FAILURE(rc))
    26452646        return rc;
     
    28072808 * @copydoc FNSSMDEVLOADEXEC
    28082809 */
    2809 static DECLCALLBACK(int) ioapicLoadExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSMHandle, uint32_t u32Version)
     2810static DECLCALLBACK(int) ioapicLoadExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSMHandle, uint32_t uVersion, uint32_t uPhase)
    28102811{
    28112812    IOAPICState *s = PDMINS_2_DATA(pDevIns, IOAPICState *);
    28122813
    2813     if (ioapic_load(pSSMHandle, s, u32Version)) {
     2814    if (ioapic_load(pSSMHandle, s, uVersion)) {
    28142815        AssertFailed();
    28152816        return VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION;
    28162817    }
     2818    Assert(uPhase == SSM_PHASE_FINAL); NOREF(uPhase);
    28172819
    28182820    return VINF_SUCCESS;
     
    29192921    }
    29202922
    2921     rc = PDMDevHlpSSMRegister(pDevIns, pDevIns->pDevReg->szDeviceName, iInstance, 1 /* version */,
    2922                               sizeof(*s), NULL, ioapicSaveExec, NULL, NULL, ioapicLoadExec, NULL);
     2923    rc = PDMDevHlpSSMRegister(pDevIns, 1 /* version */, sizeof(*s), ioapicSaveExec, ioapicLoadExec);
    29232924    if (RT_FAILURE(rc))
    29242925        return rc;
  • trunk/src/VBox/Devices/PC/DevDMA.cpp

    r12978 r22480  
    846846}
    847847
    848 static void DMAReset (PPDMDEVINS pDevIns)
     848static void dmaReset (PPDMDEVINS pDevIns)
    849849{
    850850    DMAState *s = PDMINS_2_DATA (pDevIns, DMAState *);
     
    853853}
    854854
    855 static DECLCALLBACK(int) SaveExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSMHandle)
     855static DECLCALLBACK(int) dmaSaveExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSMHandle)
    856856{
    857857    DMAState *s = PDMINS_2_DATA (pDevIns, DMAState *);
     
    861861}
    862862
    863 static DECLCALLBACK(int) LoadExec (PPDMDEVINS pDevIns,
    864                                    PSSMHANDLE pSSMHandle,
    865                                    uint32_t u32Version)
     863static DECLCALLBACK(int) dmaLoadExec (PPDMDEVINS pDevIns,
     864                                      PSSMHANDLE pSSMHandle,
     865                                      uint32_t uVersion,
     866                                      uint32_t uPhase)
    866867{
    867868    DMAState *s = PDMINS_2_DATA (pDevIns, DMAState *);
    868869
    869     if (u32Version != 1) {
    870         AssertFailed ();
    871         return VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION;
    872     }
    873 
    874     dma_load (pSSMHandle, &s->dma_controllers[0], u32Version);
    875     return dma_load (pSSMHandle, &s->dma_controllers[1], u32Version);
     870    AssertMsgReturn (uVersion == 1, ("%d\n", uVersion), VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION);
     871    Assert (uPhase == SSM_PHASE_FINAL);
     872
     873    dma_load (pSSMHandle, &s->dma_controllers[0], uVersion);
     874    return dma_load (pSSMHandle, &s->dma_controllers[1], uVersion);
    876875}
    877876
     
    889888 *                      iInstance it's expected to be used a bit in this function.
    890889 */
    891 static DECLCALLBACK(int) DMAConstruct(PPDMDEVINS pDevIns,
     890static DECLCALLBACK(int) dmaConstruct(PPDMDEVINS pDevIns,
    892891                                      int iInstance,
    893892                                      PCFGMNODE pCfgHandle)
     
    932931    }
    933932
    934     rc = PDMDevHlpSSMRegister (pDevIns, pDevIns->pDevReg->szDeviceName, iInstance, 1, sizeof (*s),
    935                                NULL, SaveExec, NULL, NULL, LoadExec, NULL);
     933    rc = PDMDevHlpSSMRegister (pDevIns, 1 /*uVersion*/, sizeof (*s), dmaSaveExec, dmaLoadExec);
    936934    if (RT_FAILURE(rc))
    937935        return rc;
     
    964962    sizeof(DMAState),
    965963    /* pfnConstruct */
    966     DMAConstruct,
     964    dmaConstruct,
    967965    /* pfnDestruct */
    968966    NULL,
     
    974972    NULL,
    975973    /* pfnReset */
    976     DMAReset,
     974    dmaReset,
    977975    /* pfnSuspend */
    978976    NULL,
  • trunk/src/VBox/Devices/PC/DevPIC.cpp

    r20572 r22480  
    828828 * @param   pDevIns     The device instance.
    829829 * @param   pSSMHandle  The handle to the saved state.
    830  * @param   u32Version  The data unit version number.
    831  */
    832 static DECLCALLBACK(int) picLoadExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSMHandle, uint32_t u32Version)
     830 * @param   uVersion    The data unit version number.
     831 * @param   uPhase      The data phase.
     832 */
     833static DECLCALLBACK(int) picLoadExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSMHandle, uint32_t uVersion, uint32_t uPhase)
    833834{
    834835    PDEVPIC pThis = PDMINS_2_DATA(pDevIns, PDEVPIC);
    835836
    836     if (u32Version != 1)
     837    if (uVersion != 1)
    837838        return VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION;
     839    Assert(uPhase == SSM_PHASE_FINAL); NOREF(uPhase);
    838840
    839841    for (unsigned i = 0; i < RT_ELEMENTS(pThis->aPics); i++)
     
    10411043    }
    10421044
    1043     rc = PDMDevHlpSSMRegister(pDevIns, pDevIns->pDevReg->szDeviceName, iInstance, 1 /* version */, sizeof(*pThis),
    1044                               NULL, picSaveExec, NULL,
    1045                               NULL, picLoadExec, NULL);
     1045    rc = PDMDevHlpSSMRegister(pDevIns, 1 /* uVersion */, sizeof(*pThis), picSaveExec, picLoadExec);
    10461046    if (RT_FAILURE(rc))
    10471047        return rc;
  • trunk/src/VBox/Devices/PC/DevPit-i8254.cpp

    r20374 r22480  
    759759 * @param   pDevIns     The device instance.
    760760 * @param   pSSMHandle  The handle to the saved state.
    761  * @param   u32Version  The data unit version number.
    762  */
    763 static DECLCALLBACK(int) pitLoadExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSMHandle, uint32_t u32Version)
     761 * @param   uVersion    The data unit version number.
     762 * @param   uPhase      The data phase.
     763 */
     764static DECLCALLBACK(int) pitLoadExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSMHandle, uint32_t uVersion, uint32_t uPhase)
    764765{
    765766    PITState *pThis = PDMINS_2_DATA(pDevIns, PITState *);
    766     unsigned i;
    767 
    768     if (u32Version != PIT_SAVED_STATE_VERSION)
     767
     768    if (uVersion != PIT_SAVED_STATE_VERSION)
    769769        return VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION;
    770 
    771     for (i = 0; i < RT_ELEMENTS(pThis->channels); i++)
     770    Assert(uPhase == SSM_PHASE_FINAL); NOREF(uPhase);
     771
     772    for (unsigned i = 0; i < RT_ELEMENTS(pThis->channels); i++)
    772773    {
    773774        PITChannelState *s = &pThis->channels[i];
     
    10341035    }
    10351036
    1036     rc = PDMDevHlpSSMRegister(pDevIns, pDevIns->pDevReg->szDeviceName, iInstance, PIT_SAVED_STATE_VERSION, sizeof(*pThis),
    1037                                           NULL, pitSaveExec, NULL,
    1038                                           NULL, pitLoadExec, NULL);
     1037    rc = PDMDevHlpSSMRegister(pDevIns, PIT_SAVED_STATE_VERSION, sizeof(*pThis), pitSaveExec, pitLoadExec);
    10391038    if (RT_FAILURE(rc))
    10401039        return rc;
  • trunk/src/VBox/Devices/PC/DevRTC.cpp

    r20374 r22480  
    628628 * @param   pDevIns     The device instance.
    629629 * @param   pSSMHandle  The handle to the saved state.
    630  * @param   u32Version  The data unit version number.
    631  */
    632 static DECLCALLBACK(int) rtcLoadExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSMHandle, uint32_t u32Version)
     630 * @param   uVersion    The data unit version number.
     631 * @param   uPhase      The data phase.
     632 */
     633static DECLCALLBACK(int) rtcLoadExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSMHandle, uint32_t uVersion, uint32_t uPhase)
    633634{
    634635    RTCState *pThis = PDMINS_2_DATA(pDevIns, RTCState *);
    635636
    636     if (u32Version != 1)
     637    if (uVersion != 1)
    637638        return VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION;
     639    Assert(uPhase == SSM_PHASE_FINAL); NOREF(uPhase);
    638640
    639641    SSMR3GetMem(pSSMHandle, pThis->cmos_data, 128);
     
    916918    }
    917919
    918     rc = PDMDevHlpSSMRegister(pDevIns, pDevIns->pDevReg->szDeviceName, iInstance, 1 /* version */, sizeof(*pThis),
    919                               NULL, rtcSaveExec, NULL,
    920                               NULL, rtcLoadExec, NULL);
     920    rc = PDMDevHlpSSMRegister(pDevIns, 1 /* version */, sizeof(*pThis), rtcSaveExec, rtcLoadExec);
    921921    if (RT_FAILURE(rc))
    922922        return rc;
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