Changeset 24508 in vbox
- Timestamp:
- Nov 9, 2009 2:44:12 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmapi.h
r24353 r24508 355 355 typedef FNVMATDTOR *PFNVMATDTOR; 356 356 357 VMMR3DECL(int) VMR3AtDtorRegister(PFNVMATDTOR pfnAtDtor, void *pvUser);358 VMMR3DECL(int) VMR3AtDtorDeregister(PFNVMATDTOR pfnAtDtor);359 VMMR3DECL(int) VMR3AtStateRegister(PVM pVM, PFNVMATSTATE pfnAtState, void *pvUser);360 VMMR3DECL(int) VMR3AtStateDeregister(PVM pVM, PFNVMATSTATE pfnAtState, void *pvUser);361 VMMR3DECL(VMSTATE) VMR3GetState(PVM pVM);357 VMMR3DECL(int) VMR3AtDtorRegister(PFNVMATDTOR pfnAtDtor, void *pvUser); 358 VMMR3DECL(int) VMR3AtDtorDeregister(PFNVMATDTOR pfnAtDtor); 359 VMMR3DECL(int) VMR3AtStateRegister(PVM pVM, PFNVMATSTATE pfnAtState, void *pvUser); 360 VMMR3DECL(int) VMR3AtStateDeregister(PVM pVM, PFNVMATSTATE pfnAtState, void *pvUser); 361 VMMR3DECL(VMSTATE) VMR3GetState(PVM pVM); 362 362 VMMR3DECL(const char *) VMR3GetStateName(VMSTATE enmState); 363 VMMR3DECL(bool) VMR3TeleportedAndNotFullyResumedYet(PVM pVM); 364 VMMR3DECL(int) VMR3AtErrorRegister(PVM pVM, PFNVMATERROR pfnAtError, void *pvUser); 365 VMMR3DECL(int) VMR3AtErrorRegisterU(PUVM pVM, PFNVMATERROR pfnAtError, void *pvUser); 366 VMMR3DECL(int) VMR3AtErrorDeregister(PVM pVM, PFNVMATERROR pfnAtError, void *pvUser); 367 VMMR3DECL(void) VMR3SetErrorWorker(PVM pVM); 368 VMMR3DECL(int) VMR3AtRuntimeErrorRegister(PVM pVM, PFNVMATRUNTIMEERROR pfnAtRuntimeError, void *pvUser); 369 VMMR3DECL(int) VMR3AtRuntimeErrorDeregister(PVM pVM, PFNVMATRUNTIMEERROR pfnAtRuntimeError, void *pvUser); 370 VMMR3DECL(int) VMR3SetRuntimeErrorWorker(PVM pVM); 371 VMMR3DECL(int) VMR3ReqCall(PVM pVM, VMCPUID idDstCpu, PVMREQ *ppReq, unsigned cMillies, uint32_t fFlags, PFNRT pfnFunction, unsigned cArgs, ...); 372 VMMR3DECL(int) VMR3ReqCallU(PUVM pUVM, VMCPUID idDstCpu, PVMREQ *ppReq, unsigned cMillies, unsigned fFlags, PFNRT pfnFunction, unsigned cArgs, ...); 373 VMMR3DECL(int) VMR3ReqCallVU(PUVM pUVM, VMCPUID idDstCpu, PVMREQ *ppReq, unsigned cMillies, unsigned fFlags, PFNRT pfnFunction, unsigned cArgs, va_list Args); 374 VMMR3DECL(int) VMR3ReqCallWait(PVM pVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...); 375 VMMR3DECL(int) VMR3ReqCallWaitU(PUVM pUVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...); 376 VMMR3DECL(int) VMR3ReqCallNoWait(PVM pVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...); 377 VMMR3DECL(int) VMR3ReqCallNoWaitU(PUVM pUVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...); 378 VMMR3DECL(int) VMR3ReqCallVoidWait(PVM pVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...); 379 VMMR3DECL(int) VMR3ReqCallVoidWaitU(PUVM pUVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...); 380 VMMR3DECL(int) VMR3ReqCallVoidNoWait(PVM pVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...); 381 VMMR3DECL(int) VMR3ReqCallVoidNoWaitU(PUVM pUVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...); 382 VMMR3DECL(int) VMR3ReqAlloc(PVM pVM, PVMREQ *ppReq, VMREQTYPE enmType, VMCPUID idDstCpu); 383 VMMR3DECL(int) VMR3ReqAllocU(PUVM pUVM, PVMREQ *ppReq, VMREQTYPE enmType, VMCPUID idDstCpu); 384 VMMR3DECL(int) VMR3ReqFree(PVMREQ pReq); 385 VMMR3DECL(int) VMR3ReqQueue(PVMREQ pReq, unsigned cMillies); 386 VMMR3DECL(int) VMR3ReqWait(PVMREQ pReq, unsigned cMillies); 387 VMMR3DECL(int) VMR3ReqProcessU(PUVM pUVM, VMCPUID idDstCpu); 388 VMMR3DECL(void) VMR3NotifyGlobalFFU(PUVM pUVM, uint32_t fFlags); 389 VMMR3DECL(void) VMR3NotifyCpuFFU(PUVMCPU pUVMCpu, uint32_t fFlags); 363 VMMR3DECL(bool) VMR3TeleportedAndNotFullyResumedYet(PVM pVM); 364 VMMR3DECL(int) VMR3AtErrorRegister(PVM pVM, PFNVMATERROR pfnAtError, void *pvUser); 365 VMMR3DECL(int) VMR3AtErrorRegisterU(PUVM pVM, PFNVMATERROR pfnAtError, void *pvUser); 366 VMMR3DECL(int) VMR3AtErrorDeregister(PVM pVM, PFNVMATERROR pfnAtError, void *pvUser); 367 VMMR3DECL(void) VMR3SetErrorWorker(PVM pVM); 368 VMMR3DECL(uint32_t) VMR3GetErrorCount(PVM pVM); 369 VMMR3DECL(int) VMR3AtRuntimeErrorRegister(PVM pVM, PFNVMATRUNTIMEERROR pfnAtRuntimeError, void *pvUser); 370 VMMR3DECL(int) VMR3AtRuntimeErrorDeregister(PVM pVM, PFNVMATRUNTIMEERROR pfnAtRuntimeError, void *pvUser); 371 VMMR3DECL(int) VMR3SetRuntimeErrorWorker(PVM pVM); 372 VMMR3DECL(uint32_t) VMR3GetRuntimeErrorCount(PVM pVM); 373 VMMR3DECL(int) VMR3ReqCall(PVM pVM, VMCPUID idDstCpu, PVMREQ *ppReq, unsigned cMillies, uint32_t fFlags, PFNRT pfnFunction, unsigned cArgs, ...); 374 VMMR3DECL(int) VMR3ReqCallU(PUVM pUVM, VMCPUID idDstCpu, PVMREQ *ppReq, unsigned cMillies, unsigned fFlags, PFNRT pfnFunction, unsigned cArgs, ...); 375 VMMR3DECL(int) VMR3ReqCallVU(PUVM pUVM, VMCPUID idDstCpu, PVMREQ *ppReq, unsigned cMillies, unsigned fFlags, PFNRT pfnFunction, unsigned cArgs, va_list Args); 376 VMMR3DECL(int) VMR3ReqCallWait(PVM pVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...); 377 VMMR3DECL(int) VMR3ReqCallWaitU(PUVM pUVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...); 378 VMMR3DECL(int) VMR3ReqCallNoWait(PVM pVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...); 379 VMMR3DECL(int) VMR3ReqCallNoWaitU(PUVM pUVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...); 380 VMMR3DECL(int) VMR3ReqCallVoidWait(PVM pVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...); 381 VMMR3DECL(int) VMR3ReqCallVoidWaitU(PUVM pUVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...); 382 VMMR3DECL(int) VMR3ReqCallVoidNoWait(PVM pVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...); 383 VMMR3DECL(int) VMR3ReqCallVoidNoWaitU(PUVM pUVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...); 384 VMMR3DECL(int) VMR3ReqAlloc(PVM pVM, PVMREQ *ppReq, VMREQTYPE enmType, VMCPUID idDstCpu); 385 VMMR3DECL(int) VMR3ReqAllocU(PUVM pUVM, PVMREQ *ppReq, VMREQTYPE enmType, VMCPUID idDstCpu); 386 VMMR3DECL(int) VMR3ReqFree(PVMREQ pReq); 387 VMMR3DECL(int) VMR3ReqQueue(PVMREQ pReq, unsigned cMillies); 388 VMMR3DECL(int) VMR3ReqWait(PVMREQ pReq, unsigned cMillies); 389 VMMR3DECL(int) VMR3ReqProcessU(PUVM pUVM, VMCPUID idDstCpu); 390 VMMR3DECL(void) VMR3NotifyGlobalFFU(PUVM pUVM, uint32_t fFlags); 391 VMMR3DECL(void) VMR3NotifyCpuFFU(PUVMCPU pUVMCpu, uint32_t fFlags); 390 392 /** @name Flags for VMR3NotifyCpuFFU and VMR3NotifyGlobalFFU. 391 393 * @{ */ -
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.