VirtualBox

Changeset 81509 in vbox for trunk/src/VBox/Devices/EFI


Ignore:
Timestamp:
Oct 24, 2019 8:56:40 AM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
134237
Message:

DevEFI,DevFlash: Always save the content to the NVRAM/flash file. bugref:6940

Location:
trunk/src/VBox/Devices/EFI
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/EFI/DevEFI.cpp

    r81505 r81509  
    262262    /** Filename of the file containing the NVRAM store. */
    263263    char                    *pszNvramFile;
    264     /** Flag whether the NVRAM state was saved using SSM. */
    265     bool                    fNvramStateSaved;
    266264
    267265    /**
     
    19791977    nvramFlushDeviceVariableList(pThisCC);
    19801978
    1981     if (   !pThisCC->fNvramStateSaved
    1982         && pThisCC->pszNvramFile)
     1979    if (pThisCC->pszNvramFile)
    19831980    {
    19841981        int rc = flashR3SaveToFile(&pThis->Flash, pDevIns, pThisCC->pszNvramFile);
    19851982        if (RT_FAILURE(rc))
    1986             LogRel(("EFI: Failed to save flash file to '%s' -> %Rrc\n", pThisCC->pszNvramFile, rc));
     1983            LogRel(("EFI: Failed to save flash file to '%s': %Rrc\n", pThisCC->pszNvramFile, rc));
    19871984    }
    19881985
  • trunk/src/VBox/Devices/EFI/DevFlash.cpp

    r81502 r81509  
    3838
    3939
    40 /*********************************************************************************************************************************
    41 *   Defined Constants And Macros                                                                                                 *
    42 *********************************************************************************************************************************/
    43 
    4440
    4541/*********************************************************************************************************************************
     
    5551    /** The guest physical memory base address. */
    5652    RTGCPHYS            GCPhysFlashBase;
    57     /** When set, indicates the state was saved. */
    58     bool                fStateSaved;
    5953    /** The file conaining the flash content. */
    6054    char                *pszFlashFile;
    6155} DEVFLASH;
    62 
    6356/** Pointer to the Flash device state. */
    6457typedef DEVFLASH *PDEVFLASH;
     
    9689{
    9790    PDEVFLASH pThis = PDMINS_2_DATA(pDevIns, PDEVFLASH);
    98 
    99     int rc = flashR3SaveExec(&pThis->Core, pDevIns, pSSM);
    100     if (RT_SUCCESS(rc))
    101         pThis->fStateSaved = true;
    102 
    103     return rc;
     91    return flashR3SaveExec(&pThis->Core, pDevIns, pSSM);
    10492}
    10593
     
    133121static DECLCALLBACK(int) flashDestruct(PPDMDEVINS pDevIns)
    134122{
    135     PDEVFLASH pThis = PDMINS_2_DATA(pDevIns, PDEVFLASH);
    136     int rc;
    137 
    138     if (!pThis->fStateSaved)
    139     {
    140         rc = flashR3SaveToFile(&pThis->Core, pDevIns, pThis->pszFlashFile);
    141         if (RT_FAILURE(rc))
    142             LogRel(("Flash: Failed to save flash file"));
    143     }
     123    PDMDEV_CHECK_VERSIONS_RETURN_QUIET(pDevIns);
     124    PDEVFLASH pThis = PDMINS_2_DATA(pDevIns, PDEVFLASH);
     125
     126    int rc = flashR3SaveToFile(&pThis->Core, pDevIns, pThis->pszFlashFile);
     127    if (RT_FAILURE(rc))
     128        LogRel(("Flash: Failed to save flash file: %Rrc\n", rc));
    144129
    145130    if (pThis->pszFlashFile)
     
    158143static DECLCALLBACK(int) flashConstruct(PPDMDEVINS pDevIns, int iInstance, PCFGMNODE pCfg)
    159144{
     145    PDMDEV_CHECK_VERSIONS_RETURN(pDevIns);
    160146    RT_NOREF1(iInstance);
    161     PDMDEV_CHECK_VERSIONS_RETURN(pDevIns);
    162147    PDEVFLASH pThis = PDMINS_2_DATA(pDevIns, PDEVFLASH);
    163148    Assert(iInstance == 0);
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