VirtualBox

Changeset 66151 in vbox


Ignore:
Timestamp:
Mar 16, 2017 10:55:05 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
114057
Message:

DevPcBios.cpp: Fixed incorrect SSMR3GetStruct call (corrupted pThis on the stack, leaving pThis->fNewShutdownPort untouched). Style fixes. Untested.

File:
1 edited

Legend:

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

    r66150 r66151  
    344344}
    345345
    346 /**
    347  * Execute state save operation.
    348  *
    349  * @returns VBox status code.
    350  * @param   pDevIns         Device instance which registered the data unit.
    351  * @param   pSSM            SSM operation handle.
     346
     347/**
     348 * @callback_method_impl{FNSSMDEVSAVEXEC}
    352349 */
    353350static DECLCALLBACK(int) pcbiosSaveExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSM)
     
    360357
    361358/**
    362  * Prepare state load operation.
    363  *
    364  * @returns VBox status code.
    365  * @param   pDevIns         Device instance which registered the data unit.
    366  * @param   pSSM            SSM operation handle.
     359 * @callback_method_impl{FNSSMDEVLOADPREP,
     360 *      Clears the fNewShutdownPort flag prior to loading the state, so that old
     361 *      saved VM states keeps using the old port address (no pcbios state).}
    367362 */
    368363static DECLCALLBACK(int) pcbiosLoadPrep(PPDMDEVINS pDevIns, PSSMHANDLE pSSM)
     
    370365    RT_NOREF(pSSM);
    371366    PDEVPCBIOS pThis = PDMINS_2_DATA(pDevIns, PDEVPCBIOS);
     367
    372368    /* Since there are legacy saved state files without any SSM data for PCBIOS
    373369     * this is the only way to handle them correctly. */
     
    377373}
    378374
    379 /**
    380  * Execute state load operation.
    381  *
    382  * @returns VBox status code.
    383  * @param   pDevIns         Device instance which registered the data unit.
    384  * @param   pSSM            SSM operation handle.
    385  * @param   uVersion        Data layout version.
    386  * @param   uPass           The data pass.
     375
     376/**
     377 * @callback_method_impl{FNSSMDEVLOADEXEC}
    387378 */
    388379static DECLCALLBACK(int) pcbiosLoadExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass)
     
    394385    Assert(uPass == SSM_PASS_FINAL); NOREF(uPass);
    395386
    396     SSMR3GetStruct(pSSM, &pThis, g_aPcBiosFields);
    397 
    398     return VINF_SUCCESS;
    399 }
    400 
    401 /**
    402  * Finish state load operation.
    403  *
    404  * @returns VBox status code.
    405  * @param   pDevIns         Device instance which registered the data unit.
    406  * @param   pSSM            SSM operation handle.
     387    return SSMR3GetStruct(pSSM, pThis, g_aPcBiosFields);
     388}
     389
     390
     391/**
     392 * @callback_method_impl{FNSSMDEVLOADDONE,
     393 *      Updates the shutdown port registration to match the flag loaded (or not).}
    407394 */
    408395static DECLCALLBACK(int) pcbiosLoadDone(PPDMDEVINS pDevIns, PSSMHANDLE pSSM)
     
    410397    RT_NOREF(pSSM);
    411398    PDEVPCBIOS pThis = PDMINS_2_DATA(pDevIns, PDEVPCBIOS);
    412 
    413     /* Update the shutdown port registration to match the flag. */
    414399    return pcbiosRegisterShutdown(pDevIns, pThis, pThis->fNewShutdownPort);
    415400}
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette