- Timestamp:
- Nov 9, 2009 2:44:12 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 54602
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/SSM.cpp
r24292 r24508 7649 7649 pszName, UnitHdr.u32Instance, UnitHdr.u32Version)); 7650 7650 if (!ASMAtomicXchgBool(&pSSM->u.Read.fHaveSetError, true)) 7651 VMSetError(pVM, rc, RT_SRC_POS, N_("Load exec failed for '%s' instance #%u (version %u)"), 7652 pszName, UnitHdr.u32Instance, UnitHdr.u32Version); 7651 if (rc == VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION) 7652 VMSetError(pVM, rc, RT_SRC_POS, N_("Unsupported version %u of data unit '%s' (instance #%u)"), 7653 UnitHdr.u32Version, UnitHdr.szName, UnitHdr.u32Instance); 7654 else 7655 VMSetError(pVM, rc, RT_SRC_POS, N_("Load exec failed for '%s' instance #%u (version %u)"), 7656 pszName, UnitHdr.u32Instance, UnitHdr.u32Version); 7653 7657 break; 7654 7658 } … … 7910 7914 UnitHdr.szName, UnitHdr.u32Instance, UnitHdr.u32Version, UnitHdr.u32Pass, rc)); 7911 7915 if (!ASMAtomicXchgBool(&pSSM->u.Read.fHaveSetError, true)) 7912 rc = VMSetError(pVM, rc, RT_SRC_POS, N_("Failed to load unit '%s'"), UnitHdr.szName); 7916 if (rc == VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION) 7917 rc = VMSetError(pVM, rc, RT_SRC_POS, N_("Unsupported version %u of data unit '%s' (instance #%u, pass %#x)"), 7918 UnitHdr.u32Version, UnitHdr.szName, UnitHdr.u32Instance, UnitHdr.u32Pass); 7919 else 7920 rc = VMSetError(pVM, rc, RT_SRC_POS, N_("Failed to load unit '%s'"), UnitHdr.szName); 7913 7921 return rc; 7914 7922 } -
trunk/src/VBox/VMM/VM.cpp
r24474 r24508 1846 1846 pVM->vm.s.fTeleportedAndNotFullyResumedYet = fTeleporting; 1847 1847 1848 uint32_t cErrorsPriorToSave = VMR3GetErrorCount(pVM); 1848 1849 rc = SSMR3Load(pVM, pszFilename, pStreamOps, pvStreamOpsUser, SSMAFTER_RESUME, pfnProgress, pvProgressUser); 1849 1850 if (RT_SUCCESS(rc)) … … 1856 1857 pVM->vm.s.fTeleportedAndNotFullyResumedYet = false; 1857 1858 vmR3SetState(pVM, VMSTATE_LOAD_FAILURE, VMSTATE_LOADING); 1858 rc = VMSetError(pVM, rc, RT_SRC_POS, 1859 N_("Unable to restore the virtual machine's saved state from '%s'. It may be damaged or from an older version of VirtualBox. Please discard the saved state before starting the virtual machine"), 1860 pszFilename); 1859 if (cErrorsPriorToSave == VMR3GetErrorCount(pVM)) 1860 rc = VMSetError(pVM, rc, RT_SRC_POS, 1861 N_("Unable to restore the virtual machine's saved state from '%s'. " 1862 "It may be damaged or from an older version of VirtualBox. " 1863 "Please discard the saved state before starting the virtual machine"), 1864 pszFilename); 1861 1865 } 1862 1866 … … 3520 3524 PUVM pUVM = pVM->pUVM; 3521 3525 RTCritSectEnter(&pUVM->vm.s.AtErrorCritSect); 3526 ASMAtomicIncU32(&pUVM->vm.s.cRuntimeErrors); 3522 3527 for (PVMATERROR pCur = pUVM->vm.s.pAtError; pCur; pCur = pCur->pNext) 3523 3528 vmR3SetErrorWorkerDoCall(pVM, pCur, rc, RT_SRC_POS_ARGS, "%s", pszMessage); 3524 3529 RTCritSectLeave(&pUVM->vm.s.AtErrorCritSect); 3530 } 3531 3532 3533 /** 3534 * Gets the number of errors raised via VMSetError. 3535 * 3536 * This can be used avoid double error messages. 3537 * 3538 * @returns The error count. 3539 * @param pVM The VM handle. 3540 */ 3541 VMMR3DECL(uint32_t) VMR3GetErrorCount(PVM pVM) 3542 { 3543 return pVM->pUVM->vm.s.cErrors; 3525 3544 } 3526 3545 … … 3580 3599 bool fCalledSomeone = false; 3581 3600 RTCritSectEnter(&pUVM->vm.s.AtErrorCritSect); 3601 ASMAtomicIncU32(&pUVM->vm.s.cErrors); 3582 3602 for (PVMATERROR pCur = pUVM->vm.s.pAtError; pCur; pCur = pCur->pNext) 3583 3603 { … … 3773 3793 PUVM pUVM = pVM->pUVM; 3774 3794 RTCritSectEnter(&pUVM->vm.s.AtErrorCritSect); 3795 ASMAtomicIncU32(&pUVM->vm.s.cRuntimeErrors); 3775 3796 for (PVMATRUNTIMEERROR pCur = pUVM->vm.s.pAtRuntimeError; pCur; pCur = pCur->pNext) 3776 3797 { … … 3902 3923 3903 3924 /** 3925 * Gets the number of runtime errors raised via VMR3SetRuntimeError. 3926 * 3927 * This can be used avoid double error messages. 3928 * 3929 * @returns The runtime error count. 3930 * @param pVM The VM handle. 3931 */ 3932 VMMR3DECL(uint32_t) VMR3GetRuntimeErrorCount(PVM pVM) 3933 { 3934 return pVM->pUVM->vm.s.cRuntimeErrors; 3935 } 3936 3937 3938 /** 3904 3939 * Gets the ID virtual of the virtual CPU assoicated with the calling thread. 3905 3940 * -
trunk/src/VBox/VMM/VMInternal.h
r23915 r24508 228 228 /** List of registered error callbacks. */ 229 229 PVMATERROR *ppAtErrorNext; 230 230 /** The error message count. 231 * This is incremented every time an error is raised. */ 232 uint32_t volatile cErrors; 233 234 /** The runtime error message count. 235 * This is incremented every time a runtime error is raised. */ 236 uint32_t volatile cRuntimeErrors; 231 237 /** List of registered error callbacks. */ 232 238 PVMATRUNTIMEERROR pAtRuntimeError;
Note:
See TracChangeset
for help on using the changeset viewer.