VirtualBox

Changeset 24268 in vbox


Ignore:
Timestamp:
Nov 2, 2009 3:33:38 PM (15 years ago)
Author:
vboxsync
Message:

SSM: Better tracking of load errors.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/SSM.cpp

    r24264 r24268  
    535535            /** The pass number of the current unit if in the load exec stage. */
    536536            uint32_t        uCurUnitPass;
    537             /** Whether SSMR3SetLoadError[V] has been called. */
    538             bool            fHaveSetError;
     537            /** Whether SSMR3SetLoadError[V] has been called.
     538             * @note Using ASMAtomicXchgBool because I'm very lazy. */
     539            bool volatile   fHaveSetError;
    539540            /** @} */
    540541
     
    76327633                            {
    76337634                                LogRel(("SSM: Unit '%s' read %lld bytes too much!\n", pszName, i64Diff));
    7634                                 if (!pSSM->u.Read.fHaveSetError)
     7635                                if (!ASMAtomicXchgBool(&pSSM->u.Read.fHaveSetError, true))
    76357636                                    rc = VMSetError(pVM, VERR_SSM_LOADED_TOO_MUCH, RT_SRC_POS,
    76367637                                                    N_("Unit '%s' read %lld bytes too much"), pszName, i64Diff);
     
    76447645                            LogRel(("SSM: Load exec failed for '%s' instance #%u ! (version %u)\n",
    76457646                                    pszName, UnitHdr.u32Instance, UnitHdr.u32Version));
    7646                             if (!pSSM->u.Read.fHaveSetError)
     7647                            if (!ASMAtomicXchgBool(&pSSM->u.Read.fHaveSetError, true))
    76477648                                VMSetError(pVM, rc, RT_SRC_POS, N_("Load exec failed for '%s' instance #%u (version %u)"),
    76487649                                           pszName, UnitHdr.u32Instance, UnitHdr.u32Version);
     
    78117812            LogRel(("SSM: Unit at %#llx (%lld): Invalid unit magic: %.*Rhxs!\n",
    78127813                    offUnit, offUnit, sizeof(UnitHdr.szMagic) - 1, &UnitHdr.szMagic[0]));
     7814            pSSM->u.Read.fHaveSetError = true;
    78137815            return VMSetError(pVM, VERR_SSM_INTEGRITY_UNIT_MAGIC, RT_SRC_POS,
    78147816                              N_("Unit at %#llx (%lld): Invalid unit magic"), offUnit, offUnit);
     
    79047906                LogRel(("SSM: LoadExec failed for '%s' instance #%u (version %u, pass %#x): %Rrc\n",
    79057907                        UnitHdr.szName, UnitHdr.u32Instance, UnitHdr.u32Version, UnitHdr.u32Pass, rc));
    7906                 if (!pSSM->u.Read.fHaveSetError)
     7908                if (!ASMAtomicXchgBool(&pSSM->u.Read.fHaveSetError, true))
    79077909                    rc = VMSetError(pVM, rc, RT_SRC_POS, N_("Failed to load unit '%s'"), UnitHdr.szName);
    79087910                return rc;
     
    79167918            LogRel(("SSM: Found no handler for unit '%s' instance #%u!\n", UnitHdr.szName, UnitHdr.u32Instance));
    79177919            if (pSSM->enmAfter != SSMAFTER_DEBUG_IT)
     7920            {
     7921                pSSM->u.Read.fHaveSetError = true;
    79187922                return VMSetError(pVM, VERR_SSM_INTEGRITY_UNIT_NOT_FOUND, RT_SRC_POS,
    79197923                                  N_("Found no handler for unit '%s' instance #%u"), UnitHdr.szName, UnitHdr.u32Instance);
     7924            }
    79207925            SSMR3SkipToEndOfUnit(pSSM);
    79217926            ssmR3DataReadFinishV2(pSSM);
     
    81278132                    LogRel(("SSM: LoadDone failed with rc=%Rrc for data unit '%s' instance #%u.\n",
    81288133                            rc, pUnit->szName, pUnit->u32Instance));
     8134                    if (!ASMAtomicXchgBool(&Handle.u.Read.fHaveSetError, true))
     8135                        VMSetError(pVM, rc, RT_SRC_POS, N_("LoadDone failed with rc=%Rrc for data unit '%s' instance #%u."),
     8136                                   rc, pUnit->szName, pUnit->u32Instance);
    81298137                    if (RT_SUCCESS_NP(Handle.rc))
    81308138                        Handle.rc = 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