VirtualBox

Changeset 32206 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Sep 2, 2010 2:13:13 PM (14 years ago)
Author:
vboxsync
Message:

FT: no state changes for loading either

Location:
trunk/src/VBox/VMM
Files:
3 edited

Legend:

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

    r32199 r32206  
    946946
    947947            pVM->ftm.s.fDeltaLoadSaveActive = (fFullSync == false);
    948             rc = VMR3LoadFromStream(pVM, &g_ftmR3TcpOps, pVM, NULL, NULL);
     948            rc = VMR3LoadFromStreamFT(pVM, &g_ftmR3TcpOps, pVM);
    949949            pVM->ftm.s.fDeltaLoadSaveActive = false;
    950950            RTSocketRelease(pVM->ftm.s.hSocket);
  • trunk/src/VBox/VMM/VM.cpp

    r32193 r32206  
    19321932 * @returns VBox status code.
    19331933 *
    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)
    19411942 *
    19421943 * @thread  EMT.
    19431944 */
    19441945static 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
    19471951    LogFlow(("vmR3Load: pVM=%p pszFilename=%p:{%s} pStreamOps=%p pvStreamOpsUser=%p pfnProgress=%p pvProgressUser=%p fTeleporting=%RTbool\n",
    19481952             pVM, pszFilename, pszFilename, pStreamOps, pvStreamOpsUser, pfnProgress, pvProgressUser, fTeleporting));
     
    19561960    AssertPtrNull(pfnProgress);
    19571961
    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    }
    19691976    pVM->vm.s.fTeleportedAndNotFullyResumedYet = fTeleporting;
    19701977
     
    19741981    {
    19751982        VMR3Relocate(pVM, 0 /*offDelta*/);
    1976         vmR3SetState(pVM, VMSTATE_SUSPENDED, VMSTATE_LOADING);
     1983        if (!fSkipStateChanges)
     1984            vmR3SetState(pVM, VMSTATE_SUSPENDED, VMSTATE_LOADING);
    19771985    }
    19781986    else
    19791987    {
    19801988        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
    19821992        if (cErrorsPriorToSave == VMR3GetErrorCount(pVM))
    19831993            rc = VMSetError(pVM, rc, RT_SRC_POS,
     
    20242034     * since there is no execution taking place when this call is allowed.
    20252035     */
    2026     int rc = VMR3ReqCallWaitU(pVM->pUVM, 0 /*idDstCpu*/, (PFNRT)vmR3Load, 7,
     2036    int rc = VMR3ReqCallWaitU(pVM->pUVM, 0 /*idDstCpu*/, (PFNRT)vmR3Load, 8,
    20272037                              pVM, pszFilename, (uintptr_t)NULL /*pStreamOps*/, (uintptr_t)NULL /*pvStreamOpsUser*/, pfnProgress, pvUser,
    2028                               false /*fTeleporting*/);
     2038                              false /*fTeleporting*/, false /* fSkipStateChanges */);
    20292039    LogFlow(("VMR3LoadFromFile: returns %Rrc\n", rc));
    20302040    return rc;
     
    20632073     * since there is no execution taking place when this call is allowed.
    20642074     */
    2065     int rc = VMR3ReqCallWaitU(pVM->pUVM, 0 /*idDstCpu*/, (PFNRT)vmR3Load, 7,
     2075    int rc = VMR3ReqCallWaitU(pVM->pUVM, 0 /*idDstCpu*/, (PFNRT)vmR3Load, 8,
    20662076                              pVM, (uintptr_t)NULL /*pszFilename*/, pStreamOps, pvStreamOpsUser, pfnProgress, pvProgressUser,
    2067                               true /*fTeleporting*/);
     2077                              true /*fTeleporting*/, false /* fSkipStateChanges */);
    20682078    LogFlow(("VMR3LoadFromStream: returns %Rrc\n", rc));
    20692079    return rc;
    20702080}
    20712081
     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 */
     2098VMMR3DECL(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}
    20722119
    20732120/**
  • trunk/src/VBox/VMM/include/internal/vm.h

    r32193 r32206  
    2222
    2323VMMR3DECL(int) VMR3SaveFT(PVM pVM, PCSSMSTRMOPS pStreamOps, void *pvStreamOpsUser, bool *pfSuspended, bool fSkipStateChanges);
     24VMMR3DECL(int) VMR3LoadFromStreamFT(PVM pVM, PCSSMSTRMOPS pStreamOps, void *pvStreamOpsUser);
    2425
    2526#endif
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