Changeset 32206 in vbox for trunk/src/VBox
- Timestamp:
- Sep 2, 2010 2:13:13 PM (14 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/FTM.cpp
r32199 r32206 946 946 947 947 pVM->ftm.s.fDeltaLoadSaveActive = (fFullSync == false); 948 rc = VMR3LoadFromStream (pVM, &g_ftmR3TcpOps, pVM, NULL, NULL);948 rc = VMR3LoadFromStreamFT(pVM, &g_ftmR3TcpOps, pVM); 949 949 pVM->ftm.s.fDeltaLoadSaveActive = false; 950 950 RTSocketRelease(pVM->ftm.s.hSocket); -
trunk/src/VBox/VMM/VM.cpp
r32193 r32206 1932 1932 * @returns VBox status code. 1933 1933 * 1934 * @param pVM The VM handle. 1935 * @param pszFilename The name of the file. NULL if pStreamOps is used. 1936 * @param pStreamOps The stream methods. NULL if pszFilename is used. 1937 * @param pvStreamOpsUser The user argument to the stream methods. 1938 * @param pfnProgress Progress callback. Optional. 1939 * @param pvUser User argument for the progress callback. 1940 * @param fTeleporting Indicates whether we're teleporting or not. 1934 * @param pVM The VM handle. 1935 * @param pszFilename The name of the file. NULL if pStreamOps is used. 1936 * @param pStreamOps The stream methods. NULL if pszFilename is used. 1937 * @param pvStreamOpsUser The user argument to the stream methods. 1938 * @param pfnProgress Progress callback. Optional. 1939 * @param pvUser User argument for the progress callback. 1940 * @param fTeleporting Indicates whether we're teleporting or not. 1941 * @param fSkipStateChanges Set if we're supposed to skip state changes (FTM delta case) 1941 1942 * 1942 1943 * @thread EMT. 1943 1944 */ 1944 1945 static DECLCALLBACK(int) vmR3Load(PVM pVM, const char *pszFilename, PCSSMSTRMOPS pStreamOps, void *pvStreamOpsUser, 1945 PFNVMPROGRESS pfnProgress, void *pvProgressUser, bool fTeleporting) 1946 { 1946 PFNVMPROGRESS pfnProgress, void *pvProgressUser, bool fTeleporting, 1947 bool fSkipStateChanges) 1948 { 1949 int rc = VINF_SUCCESS; 1950 1947 1951 LogFlow(("vmR3Load: pVM=%p pszFilename=%p:{%s} pStreamOps=%p pvStreamOpsUser=%p pfnProgress=%p pvProgressUser=%p fTeleporting=%RTbool\n", 1948 1952 pVM, pszFilename, pszFilename, pStreamOps, pvStreamOpsUser, pfnProgress, pvProgressUser, fTeleporting)); … … 1956 1960 AssertPtrNull(pfnProgress); 1957 1961 1958 /* 1959 * Change the state and perform the load. 1960 * 1961 * Always perform a relocation round afterwards to make sure hypervisor 1962 * selectors and such are correct. 1963 */ 1964 int rc = vmR3TrySetState(pVM, "VMR3Load", 2, 1965 VMSTATE_LOADING, VMSTATE_CREATED, 1966 VMSTATE_LOADING, VMSTATE_SUSPENDED); 1967 if (RT_FAILURE(rc)) 1968 return rc; 1962 if (!fSkipStateChanges) 1963 { 1964 /* 1965 * Change the state and perform the load. 1966 * 1967 * Always perform a relocation round afterwards to make sure hypervisor 1968 * selectors and such are correct. 1969 */ 1970 rc = vmR3TrySetState(pVM, "VMR3Load", 2, 1971 VMSTATE_LOADING, VMSTATE_CREATED, 1972 VMSTATE_LOADING, VMSTATE_SUSPENDED); 1973 if (RT_FAILURE(rc)) 1974 return rc; 1975 } 1969 1976 pVM->vm.s.fTeleportedAndNotFullyResumedYet = fTeleporting; 1970 1977 … … 1974 1981 { 1975 1982 VMR3Relocate(pVM, 0 /*offDelta*/); 1976 vmR3SetState(pVM, VMSTATE_SUSPENDED, VMSTATE_LOADING); 1983 if (!fSkipStateChanges) 1984 vmR3SetState(pVM, VMSTATE_SUSPENDED, VMSTATE_LOADING); 1977 1985 } 1978 1986 else 1979 1987 { 1980 1988 pVM->vm.s.fTeleportedAndNotFullyResumedYet = false; 1981 vmR3SetState(pVM, VMSTATE_LOAD_FAILURE, VMSTATE_LOADING); 1989 if (!fSkipStateChanges) 1990 vmR3SetState(pVM, VMSTATE_LOAD_FAILURE, VMSTATE_LOADING); 1991 1982 1992 if (cErrorsPriorToSave == VMR3GetErrorCount(pVM)) 1983 1993 rc = VMSetError(pVM, rc, RT_SRC_POS, … … 2024 2034 * since there is no execution taking place when this call is allowed. 2025 2035 */ 2026 int rc = VMR3ReqCallWaitU(pVM->pUVM, 0 /*idDstCpu*/, (PFNRT)vmR3Load, 7,2036 int rc = VMR3ReqCallWaitU(pVM->pUVM, 0 /*idDstCpu*/, (PFNRT)vmR3Load, 8, 2027 2037 pVM, pszFilename, (uintptr_t)NULL /*pStreamOps*/, (uintptr_t)NULL /*pvStreamOpsUser*/, pfnProgress, pvUser, 2028 false /*fTeleporting*/ );2038 false /*fTeleporting*/, false /* fSkipStateChanges */); 2029 2039 LogFlow(("VMR3LoadFromFile: returns %Rrc\n", rc)); 2030 2040 return rc; … … 2063 2073 * since there is no execution taking place when this call is allowed. 2064 2074 */ 2065 int rc = VMR3ReqCallWaitU(pVM->pUVM, 0 /*idDstCpu*/, (PFNRT)vmR3Load, 7,2075 int rc = VMR3ReqCallWaitU(pVM->pUVM, 0 /*idDstCpu*/, (PFNRT)vmR3Load, 8, 2066 2076 pVM, (uintptr_t)NULL /*pszFilename*/, pStreamOps, pvStreamOpsUser, pfnProgress, pvProgressUser, 2067 true /*fTeleporting*/ );2077 true /*fTeleporting*/, false /* fSkipStateChanges */); 2068 2078 LogFlow(("VMR3LoadFromStream: returns %Rrc\n", rc)); 2069 2079 return rc; 2070 2080 } 2071 2081 2082 2083 /** 2084 * VMR3LoadFromFileFT for arbritrary file streams. 2085 * 2086 * @returns VBox status code. 2087 * 2088 * @param pVM The VM handle. 2089 * @param pStreamOps The stream methods. 2090 * @param pvStreamOpsUser The user argument to the stream methods. 2091 * @param pfnProgress Progress callback. Optional. 2092 * @param pvProgressUser User argument for the progress callback. 2093 * 2094 * @thread Any thread. 2095 * @vmstate Created, Suspended 2096 * @vmstateto Loading+Suspended 2097 */ 2098 VMMR3DECL(int) VMR3LoadFromStreamFT(PVM pVM, PCSSMSTRMOPS pStreamOps, void *pvStreamOpsUser) 2099 { 2100 LogFlow(("VMR3LoadFromStreamFT: pVM=%p pStreamOps=%p pvStreamOpsUser=%p\n", 2101 pVM, pStreamOps, pvStreamOpsUser)); 2102 2103 /* 2104 * Validate input. 2105 */ 2106 VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE); 2107 AssertPtrReturn(pStreamOps, VERR_INVALID_POINTER); 2108 2109 /* 2110 * Forward the request to EMT(0). No need to setup a rendezvous here 2111 * since there is no execution taking place when this call is allowed. 2112 */ 2113 int rc = VMR3ReqCallWaitU(pVM->pUVM, 0 /*idDstCpu*/, (PFNRT)vmR3Load, 8, 2114 pVM, (uintptr_t)NULL /*pszFilename*/, pStreamOps, pvStreamOpsUser, NULL, NULL, 2115 true /*fTeleporting*/, true /* fSkipStateChanges */); 2116 LogFlow(("VMR3LoadFromStream: returns %Rrc\n", rc)); 2117 return rc; 2118 } 2072 2119 2073 2120 /** -
trunk/src/VBox/VMM/include/internal/vm.h
r32193 r32206 22 22 23 23 VMMR3DECL(int) VMR3SaveFT(PVM pVM, PCSSMSTRMOPS pStreamOps, void *pvStreamOpsUser, bool *pfSuspended, bool fSkipStateChanges); 24 VMMR3DECL(int) VMR3LoadFromStreamFT(PVM pVM, PCSSMSTRMOPS pStreamOps, void *pvStreamOpsUser); 24 25 25 26 #endif
Note:
See TracChangeset
for help on using the changeset viewer.