VirtualBox

Changeset 32169 in vbox


Ignore:
Timestamp:
Sep 1, 2010 9:21:30 AM (14 years ago)
Author:
vboxsync
Message:

FT updates

Location:
trunk
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmapi.h

    r31895 r32169  
    332332typedef FNVMPROGRESS *PFNVMPROGRESS;
    333333
    334 VMMR3DECL(int)  VMR3Save(PVM pVM, const char *pszFilename, PCSSMSTRMOPS pStreamOps, void *pvStreamOpsUser, bool fContinueAfterwards, PFNVMPROGRESS pfnProgress, void *pvUser, bool *pfSuspended);
     334VMMR3DECL(int)  VMR3Save(PVM pVM, const char *pszFilename, bool fContinueAfterwards, PFNVMPROGRESS pfnProgress, void *pvUser, bool *pfSuspended);
    335335VMMR3DECL(int)  VMR3Teleport(PVM pVM, uint32_t cMsDowntime, PCSSMSTRMOPS pStreamOps, void *pvStreamOpsUser, PFNVMPROGRESS pfnProgress, void *pvProgressUser, bool *pfSuspended);
    336336VMMR3DECL(int)  VMR3LoadFromFile(PVM pVM, const char *pszFilename, PFNVMPROGRESS pfnProgress, void *pvUser);
  • trunk/src/VBox/Frontends/VBoxBFE/VMControl.cpp

    r31895 r32169  
    133133    rc = VMR3ReqCallWait(gpVM, VMCPUID_ANY,
    134134                         (PFNRT)VMR3Save, 7, gpVM, g_pszStateFile,
    135                          NULL /* pStreamOps */,
    136                          NULL /* pvStreamOpsUser */,
    137135                         false /*fContinueAftewards*/, &callProgressInfo, (uintptr_t)NULL);
    138136    AssertRC(rc);
  • trunk/src/VBox/Main/ConsoleImpl.cpp

    r32105 r32169  
    78117811            int vrc = VMR3Save(that->mpVM,
    78127812                               strSavedStateFile.c_str(),
    7813                                NULL /* pStreamOps */,
    7814                                NULL /* pvStreamOpsUser */,
    78157813                               true /*fContinueAfterwards*/,
    78167814                               Console::stateProgressCallback,
     
    80728070    int vrc = VMR3Save(that->mpVM,
    80738071                       task->mSavedStateFile.c_str(),
    8074                         NULL /* pStreamOps */,
    8075                         NULL /* pvStreamOpsUser */,
    80768072                       false, /*fContinueAfterwards*/
    80778073                       Console::stateProgressCallback,
  • trunk/src/VBox/VMM/FTM.cpp

    r32158 r32169  
    3838#include <iprt/semaphore.h>
    3939#include <iprt/asm.h>
     40
     41#include <include/internal/vm.h>
    4042
    4143/*******************************************************************************
     
    613615        rc = VMR3Suspend(pVM);
    614616        AssertRCReturn(rc, rc);
     617        /** Hack alert as EM is responsible for dealing with the suspend state. We must do this here ourselves, but only for this EMT.*/
     618        if (VM_IS_EMT(pVM))
     619            TMR3NotifySuspend(pVM, VMMGetCpu(pVM));  /* Stop the virtual time. */
    615620    }
    616621
     
    639644
    640645        pVM->ftm.s.fDeltaLoadSaveActive = (fFullSync == false);
    641         rc = VMR3Save(pVM, NULL /* pszFilename */, &g_ftmR3TcpOps, pVM, true /* fContinueAfterwards */, NULL, NULL, &fSuspended);
     646        rc = VMR3SaveFT(pVM, &g_ftmR3TcpOps, pVM, &fSuspended);
    642647        pVM->ftm.s.fDeltaLoadSaveActive = false;
    643648        AssertRC(rc);
     
    664669        rc = VMR3Resume(pVM);
    665670        AssertRCReturn(rc, rc);
     671
     672        /** Hack alert as EM is responsible for dealing with the suspend state. We must do this here ourselves, but only for this EMT.*/
     673        if (VM_IS_EMT(pVM))
     674            TMR3NotifyResume(pVM, VMMGetCpu(pVM));  /* Stop the virtual time. */
    666675    }
    667676    return VINF_SUCCESS;
  • trunk/src/VBox/VMM/VM.cpp

    r32097 r32169  
    17611761 *              RunningLS+SuspeningLS+SuspendedLS+Saving+Suspended.
    17621762 */
    1763 VMMR3DECL(int) VMR3Save(PVM pVM, const char *pszFilename, PCSSMSTRMOPS pStreamOps, void *pvStreamOpsUser,
    1764                         bool fContinueAfterwards, PFNVMPROGRESS pfnProgress, void *pvUser, bool *pfSuspended)
     1763VMMR3DECL(int) VMR3Save(PVM pVM, const char *pszFilename, bool fContinueAfterwards, PFNVMPROGRESS pfnProgress, void *pvUser, bool *pfSuspended)
    17651764{
    17661765    LogFlow(("VMR3Save: pVM=%p pszFilename=%p:{%s} fContinueAfterwards=%RTbool pfnProgress=%p pvUser=%p pfSuspended=%p\n",
     
    17741773    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
    17751774    VM_ASSERT_OTHER_THREAD(pVM);
    1776     AssertReturn(VALID_PTR(pszFilename) || pStreamOps, VERR_INVALID_POINTER);
    1777     AssertReturn(pStreamOps || *pszFilename, VERR_INVALID_PARAMETER);
     1775    AssertReturn(VALID_PTR(pszFilename), VERR_INVALID_POINTER);
     1776    AssertReturn(*pszFilename, VERR_INVALID_PARAMETER);
    17781777    AssertPtrNullReturn(pfnProgress, VERR_INVALID_POINTER);
    17791778
     
    17831782    SSMAFTER enmAfter = fContinueAfterwards ? SSMAFTER_CONTINUE : SSMAFTER_DESTROY;
    17841783    int rc = vmR3SaveTeleport(pVM, 250 /*cMsMaxDowntime*/,
    1785                               pszFilename, pStreamOps, pvStreamOpsUser,
     1784                              pszFilename, NULL /* pStreamOps */, NULL /* pvStreamOpsUser */,
    17861785                              enmAfter, pfnProgress, pvUser, pfSuspended);
     1786    LogFlow(("VMR3Save: returns %Rrc (*pfSuspended=%RTbool)\n", rc, *pfSuspended));
     1787    return rc;
     1788}
     1789
     1790/**
     1791 * Save current VM state (used by FTM)
     1792 *
     1793 * Can be used for both saving the state and creating snapshots.
     1794 *
     1795 * When called for a VM in the Running state, the saved state is created live
     1796 * and the VM is only suspended when the final part of the saving is preformed.
     1797 * The VM state will not be restored to Running in this case and it's up to the
     1798 * caller to call VMR3Resume if this is desirable.  (The rational is that the
     1799 * caller probably wish to reconfigure the disks before resuming the VM.)
     1800 *
     1801 * @returns VBox status code.
     1802 *
     1803 * @param   pVM                 The VM which state should be saved.
     1804 * @param   pStreamOps          The stream methods.
     1805 * @param   pvStreamOpsUser     The user argument to the stream methods.
     1806 * @param   pfSuspended         Set if we suspended the VM.
     1807 *
     1808 * @thread      Any
     1809 * @vmstate     Suspended or Running
     1810 * @vmstateto   Saving+Suspended or
     1811 *              RunningLS+SuspeningLS+SuspendedLS+Saving+Suspended.
     1812 */
     1813VMMR3DECL(int) VMR3SaveFT(PVM pVM, PCSSMSTRMOPS pStreamOps, void *pvStreamOpsUser, bool *pfSuspended)
     1814{
     1815    LogFlow(("VMR3SaveFT: pVM=%p pStreamOps=%p pvSteamOpsUser=%p pfSuspended=%p\n",
     1816             pVM, pStreamOps, pvStreamOpsUser, pfSuspended));
     1817
     1818    /*
     1819     * Validate input.
     1820     */
     1821    AssertPtr(pfSuspended);
     1822    *pfSuspended = false;
     1823    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
     1824    AssertReturn(pStreamOps, VERR_INVALID_PARAMETER);
     1825
     1826    /*
     1827     * Join paths with VMR3Teleport.
     1828     */
     1829    int rc = vmR3SaveTeleport(pVM, 250 /*cMsMaxDowntime*/,
     1830                              NULL, pStreamOps, pvStreamOpsUser,
     1831                              SSMAFTER_CONTINUE, NULL, NULL, pfSuspended);
    17871832    LogFlow(("VMR3Save: returns %Rrc (*pfSuspended=%RTbool)\n", rc, *pfSuspended));
    17881833    return 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