VirtualBox

Changeset 23801 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Oct 15, 2009 3:00:47 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
53543
Message:

Main,VMM,Frontends,++: Teminology. Added a bind address for the (target) teleporter.

Location:
trunk/src/VBox/Main
Files:
9 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/ConsoleImpl.cpp

    r23703 r23801  
    228228          mConfigConstructor(NULL),
    229229          mStartPaused(false),
    230           mLiveMigrationTarget(FALSE)
     230          mTeleporterEnabled(FALSE)
    231231    {}
    232232
     
    236236    Console::SharedFolderDataMap mSharedFolders;
    237237    bool mStartPaused;
    238     BOOL mLiveMigrationTarget;
     238    BOOL mTeleporterEnabled;
    239239
    240240    typedef std::list< ComPtr<IMedium> > HardDiskList;
     
    46144614    }
    46154615
    4616     /* test and clear the LiveMigrationTarget property  */
    4617     BOOL fLiveMigrationTarget;
    4618     rc = mMachine->COMGETTER(LiveMigrationTarget)(&fLiveMigrationTarget);
     4616    /* test and clear the TeleporterEnabled property  */
     4617    BOOL fTeleporterEnabled;
     4618    rc = mMachine->COMGETTER(TeleporterEnabled)(&fTeleporterEnabled);
    46194619    CheckComRCReturnRC(rc);
    4620     if (fLiveMigrationTarget)
    4621     {
    4622         rc = mMachine->COMSETTER(LiveMigrationTarget)(FALSE);
     4620    if (fTeleporterEnabled)
     4621    {
     4622        rc = mMachine->COMSETTER(TeleporterEnabled)(FALSE);
    46234623        CheckComRCReturnRC(rc);
    46244624    }
     
    46304630    if (mMachineState == MachineState_Saved)
    46314631        progressDesc = tr("Restoring virtual machine");
    4632     else if (fLiveMigrationTarget)
    4633         progressDesc = tr("Migrating virtual machine");
     4632    else if (fTeleporterEnabled)
     4633        progressDesc = tr("Teleporting virtual machine");
    46344634    else
    46354635        progressDesc = tr("Starting virtual machine");
     
    46504650    if (mMachineState == MachineState_Saved)
    46514651        task->mSavedStateFile = savedStateFile;
    4652     task->mLiveMigrationTarget = fLiveMigrationTarget;
     4652    task->mTeleporterEnabled = fTeleporterEnabled;
    46534653
    46544654    /* Reset differencing hard disks for which autoReset is true */
     
    47324732    if (mMachineState == MachineState_Saved)
    47334733        setMachineState(MachineState_Restoring);
    4734     else if (fLiveMigrationTarget)
    4735         setMachineState(MachineState_MigratingFrom);
     4734    else if (fTeleporterEnabled)
     4735        setMachineState(MachineState_TeleportingFrom);
    47364736    else
    47374737        setMachineState(MachineState_Starting);
     
    47994799              mMachineState == MachineState_Starting ||
    48004800              mMachineState == MachineState_Restoring ||
    4801               mMachineState == MachineState_MigratingFrom || /** @todo LiveMigration ???*/
     4801              mMachineState == MachineState_TeleportingFrom || /** @todo Teleportation ???*/
    48024802              mMachineState == MachineState_Stopping,
    48034803              ("Invalid machine state: %s\n", Global::stringifyMachineState(mMachineState)));
     
    48144814        && (   mMachineState == MachineState_Starting
    48154815            || mMachineState == MachineState_Restoring
    4816             || mMachineState == MachineState_MigratingFrom)
     4816            || mMachineState == MachineState_TeleportingFrom)
    48174817       )
    48184818        mVMPoweredOff = true;
     
    48254825    if (   mMachineState != MachineState_Saving
    48264826        && mMachineState != MachineState_Restoring
    4827         && mMachineState != MachineState_MigratingFrom
     4827        && mMachineState != MachineState_TeleportingFrom
    48284828        && mMachineState != MachineState_Stopping
    48294829       )
     
    55115511                && that->mMachineState != MachineState_Saving
    55125512                && that->mMachineState != MachineState_Restoring
    5513                 && that->mMachineState != MachineState_MigratingFrom
     5513                && that->mMachineState != MachineState_TeleportingFrom
    55145514               )
    55155515            {
     
    56065606                    that->setMachineState(MachineState_Saved);
    56075607                    break;
    5608                 case MachineState_MigratingFrom:
    5609                     /* Migration failed or was cancelled.  Back to powered off. */
     5608                case MachineState_TeleportingFrom:
     5609                    /* Teleportation failed or was cancelled.  Back to powered off. */
    56105610                    that->setMachineState(MachineState_PoweredOff);
    56115611                    break;
     
    56175617        {
    56185618            /** @todo state/live VMSTATE_SUSPENDING_LS. */
    5619             if ( aOldState == VMSTATE_SUSPENDING)
     5619            if (aOldState == VMSTATE_SUSPENDING)
    56205620            {
    56215621                AutoWriteLock alock(that);
     
    56475647                           && aOldState == VMSTATE_POWERING_ON)
    56485648                       || (   (   that->mMachineState == MachineState_Restoring
    5649                                || that->mMachineState == MachineState_MigratingFrom
     5649                               || that->mMachineState == MachineState_TeleportingFrom
    56505650                               || that->mMachineState == MachineState_Paused)
    56515651                           && aOldState == VMSTATE_RESUMING));
     
    62126212/**
    62136213 * Process callback handler for VMR3LoadFromFile, VMR3LoadFromStream, VMR3Save
    6214  * and VMR3Migrate.
     6214 * and VMR3Teleport.
    62156215 *
    62166216 * @param   pVM         The VM handle.
     
    67606760                    }
    67616761                }
    6762                 else if (task->mLiveMigrationTarget)
     6762                else if (task->mTeleporterEnabled)
    67636763                {
    6764                     /* -> ConsoleImpl-LiveMigration.cpp */
    6765                     vrc = console->migrationDst(pVM, pMachine, task->mStartPaused,
    6766                                                 static_cast<VMProgressTask*>(task.get()));
     6764                    /* -> ConsoleImplTeleporter.cpp */
     6765                    vrc = console->teleporterTrg(pVM, pMachine, task->mStartPaused,
     6766                                                 static_cast<VMProgressTask*>(task.get()));
    67676767                    if (RT_FAILURE(vrc))
    67686768                        VMR3PowerOff(pVM);
     
    68436843    if (   console->mMachineState == MachineState_Starting
    68446844        || console->mMachineState == MachineState_Restoring
    6845         || console->mMachineState == MachineState_MigratingFrom
     6845        || console->mMachineState == MachineState_TeleportingFrom
    68466846       )
    68476847    {
  • trunk/src/VBox/Main/ConsoleImplTeleporter.cpp

    r23793 r23801  
    11/* $Id$ */
    22/** @file
    3  * VBox Console COM Class implementation, The Live Migration Part.
     3 * VBox Console COM Class implementation, The Teleporter Part.
    44 */
    55
     
    4545*******************************************************************************/
    4646/**
    47  * Base class for the migration state.
     47 * Base class for the teleporter state.
    4848 *
    4949 * These classes are used as advanced structs, not as proper classes.
    5050 */
    51 class MigrationState
     51class TeleporterState
    5252{
    5353public:
     
    6767    /** @} */
    6868
    69     MigrationState(Console *pConsole, PVM pVM, bool fIsSource)
     69    TeleporterState(Console *pConsole, PVM pVM, bool fIsSource)
    7070        : mptrConsole(pConsole)
    7171        , mpVM(pVM)
     
    8383
    8484/**
    85  * Migration state used by the source side.
    86  */
    87 class MigrationStateSrc : public MigrationState
     85 * Teleporter state used by the source side.
     86 */
     87class TeleporterStateSrc : public TeleporterState
    8888{
    8989public:
     
    9292    uint32_t            muPort;
    9393
    94     MigrationStateSrc(Console *pConsole, PVM pVM)
    95         : MigrationState(pConsole, pVM, true /*fIsSource*/)
     94    TeleporterStateSrc(Console *pConsole, PVM pVM)
     95        : TeleporterState(pConsole, pVM, true /*fIsSource*/)
    9696        , muPort(UINT32_MAX)
    9797    {
     
    101101
    102102/**
    103  * Migration state used by the destiation side.
    104  */
    105 class MigrationStateDst : public MigrationState
     103 * Teleporter state used by the destiation side.
     104 */
     105class TeleporterStateTrg : public TeleporterState
    106106{
    107107public:
     
    112112    int                 mRc;
    113113
    114     MigrationStateDst(Console *pConsole, PVM pVM, IMachine *pMachine, PRTTIMERLR phTimerLR)
    115         : MigrationState(pConsole, pVM, false /*fIsSource*/)
     114    TeleporterStateTrg(Console *pConsole, PVM pVM, IMachine *pMachine, PRTTIMERLR phTimerLR)
     115        : TeleporterState(pConsole, pVM, false /*fIsSource*/)
    116116        , mpMachine(pMachine)
    117117        , mpvVMCallbackTask(NULL)
     
    130130 * stream ends.
    131131 */
    132 typedef struct MIGRATIONTCPHDR
     132typedef struct TELEPORTERTCPHDR
    133133{
    134134    /** Magic value. */
     
    137137     * 0 indicates the end of the stream. */
    138138    uint32_t    cb;
    139 } MIGRATIONTCPHDR;
    140 /** Magic value for MIGRATIONTCPHDR::u32Magic. (Egberto Gismonti Amin) */
    141 #define MIGRATIONTCPHDR_MAGIC       UINT32_C(0x19471205)
     139} TELEPORTERTCPHDR;
     140/** Magic value for TELEPORTERTCPHDR::u32Magic. (Egberto Gismonti Amin) */
     141#define TELEPORTERTCPHDR_MAGIC       UINT32_C(0x19471205)
    142142/** The max block size. */
    143 #define MIGRATIONTCPHDR_MAX_SIZE    UINT32_C(0x00fffff8)
     143#define TELEPORTERTCPHDR_MAX_SIZE    UINT32_C(0x00fffff8)
    144144
    145145
     
    147147*   Global Variables                                                           *
    148148*******************************************************************************/
    149 static const char g_szWelcome[] = "VirtualBox-LiveMigration-1.0\n";
     149static const char g_szWelcome[] = "VirtualBox-Teleporter-1.0\n";
    150150
    151151
     
    155155 * @returns VBox status code.
    156156 *
    157  * @param   pState      The live migration state structure.
     157 * @param   pState      The teleporter state structure.
    158158 * @param   pszBuf      The output buffer.
    159159 * @param   cchBuf      The size of the output buffer.
    160160 *
    161161 */
    162 static int migrationTcpReadLine(MigrationState *pState, char *pszBuf, size_t cchBuf)
     162static int teleporterTcpReadLine(TeleporterState *pState, char *pszBuf, size_t cchBuf)
    163163{
    164164    char       *pszStart = pszBuf;
     
    175175        if (RT_FAILURE(rc))
    176176        {
    177             LogRel(("Migration: RTTcpRead -> %Rrc while reading string ('%s')\n", rc, pszStart));
     177            LogRel(("Teleporter: RTTcpRead -> %Rrc while reading string ('%s')\n", rc, pszStart));
    178178            return rc;
    179179        }
     
    183183        if (cchBuf <= 1)
    184184        {
    185             LogRel(("Migration: String buffer overflow: '%s'\n", pszStart));
     185            LogRel(("Teleporter: String buffer overflow: '%s'\n", pszStart));
    186186            return VERR_BUFFER_OVERFLOW;
    187187        }
     
    197197 *
    198198 * @returns S_OK on ACK, E_FAIL+setError() on failure or NACK.
    199  * @param   pState              The live migration source state.
     199 * @param   pState              The teleporter source state.
    200200 * @param   pszWhich            Which ACK is this this?
    201201 * @param   pszNAckMsg          Optional NACK message.
     
    204204 */
    205205HRESULT
    206 Console::migrationSrcReadACK(MigrationStateSrc *pState, const char *pszWhich,
     206Console::teleporterSrcReadACK(TeleporterStateSrc *pState, const char *pszWhich,
    207207                             const char *pszNAckMsg /*= NULL*/)
    208208{
    209209    char szMsg[128];
    210     int vrc = migrationTcpReadLine(pState, szMsg, sizeof(szMsg));
     210    int vrc = teleporterTcpReadLine(pState, szMsg, sizeof(szMsg));
    211211    if (RT_FAILURE(vrc))
    212212        return setError(E_FAIL, tr("Failed reading ACK(%s): %Rrc"), pszWhich, vrc);
     
    221221                if (pszNAckMsg)
    222222                {
    223                     LogRel(("Migration: %s: NACK=%Rrc (%d)\n", pszWhich, vrc2, vrc2));
     223                    LogRel(("Teleporter: %s: NACK=%Rrc (%d)\n", pszWhich, vrc2, vrc2));
    224224                    return setError(E_FAIL, pszNAckMsg);
    225225                }
     
    238238 * @returns S_OK on ACKed command, E_FAIL+setError() on failure.
    239239 *
    240  * @param   pState              The live migration source state.
     240 * @param   pState              The teleporter source state.
    241241 * @param   pszCommand          The command.
    242242 *
     
    244244 */
    245245HRESULT
    246 Console::migrationSrcSubmitCommand(MigrationStateSrc *pState, const char *pszCommand)
     246Console::teleporterSrcSubmitCommand(TeleporterStateSrc *pState, const char *pszCommand)
    247247{
    248248    size_t cchCommand = strlen(pszCommand);
     
    254254    if (RT_FAILURE(vrc))
    255255        return setError(E_FAIL, tr("Failed writing command '%s': %Rrc"), pszCommand, vrc);
    256     return migrationSrcReadACK(pState, pszCommand);
     256    return teleporterSrcReadACK(pState, pszCommand);
    257257}
    258258
     
    261261 * @copydoc SSMSTRMOPS::pfnWrite
    262262 */
    263 static DECLCALLBACK(int) migrationTcpOpWrite(void *pvUser, uint64_t offStream, const void *pvBuf, size_t cbToWrite)
    264 {
    265     MigrationState *pState = (MigrationState *)pvUser;
     263static DECLCALLBACK(int) teleporterTcpOpWrite(void *pvUser, uint64_t offStream, const void *pvBuf, size_t cbToWrite)
     264{
     265    TeleporterState *pState = (TeleporterState *)pvUser;
    266266
    267267    AssertReturn(cbToWrite > 0, VINF_SUCCESS);
     
    271271    {
    272272        /* Write block header. */
    273         MIGRATIONTCPHDR Hdr;
    274         Hdr.u32Magic = MIGRATIONTCPHDR_MAGIC;
    275         Hdr.cb       = RT_MIN(cbToWrite, MIGRATIONTCPHDR_MAX_SIZE);
     273        TELEPORTERTCPHDR Hdr;
     274        Hdr.u32Magic = TELEPORTERTCPHDR_MAGIC;
     275        Hdr.cb       = RT_MIN(cbToWrite, TELEPORTERTCPHDR_MAX_SIZE);
    276276        int rc = RTTcpWrite(pState->mhSocket, &Hdr, sizeof(Hdr));
    277277        if (RT_FAILURE(rc))
    278278        {
    279             LogRel(("Migration/TCP: Header write error: %Rrc\n", rc));
     279            LogRel(("Teleporter/TCP: Header write error: %Rrc\n", rc));
    280280            return rc;
    281281        }
     
    285285        if (RT_FAILURE(rc))
    286286        {
    287             LogRel(("Migration/TCP: Data write error: %Rrc (cb=%#x)\n", rc, Hdr.cb));
     287            LogRel(("Teleporter/TCP: Data write error: %Rrc (cb=%#x)\n", rc, Hdr.cb));
    288288            return rc;
    289289        }
     
    308308 * @returns VBox status code.
    309309 *
    310  * @param   pState          The migration state data.
    311  */
    312 static int migrationTcpReadSelect(MigrationState *pState)
     310 * @param   pState          The teleporter state data.
     311 */
     312static int teleporterTcpReadSelect(TeleporterState *pState)
    313313{
    314314    int rc;
     
    319319        {
    320320            pState->mfIOError = true;
    321             LogRel(("Migration/TCP: Header select error: %Rrc\n", rc));
     321            LogRel(("Teleporter/TCP: Header select error: %Rrc\n", rc));
    322322            break;
    323323        }
     
    335335 * @copydoc SSMSTRMOPS::pfnRead
    336336 */
    337 static DECLCALLBACK(int) migrationTcpOpRead(void *pvUser, uint64_t offStream, void *pvBuf, size_t cbToRead, size_t *pcbRead)
    338 {
    339     MigrationState *pState = (MigrationState *)pvUser;
     337static DECLCALLBACK(int) teleporterTcpOpRead(void *pvUser, uint64_t offStream, void *pvBuf, size_t cbToRead, size_t *pcbRead)
     338{
     339    TeleporterState *pState = (TeleporterState *)pvUser;
    340340    AssertReturn(!pState->mfIsSource, VERR_INVALID_HANDLE);
    341341
     
    360360        if (!pState->mcbReadBlock)
    361361        {
    362             rc = migrationTcpReadSelect(pState);
     362            rc = teleporterTcpReadSelect(pState);
    363363            if (RT_FAILURE(rc))
    364364                return rc;
    365             MIGRATIONTCPHDR Hdr;
     365            TELEPORTERTCPHDR Hdr;
    366366            rc = RTTcpRead(pState->mhSocket, &Hdr, sizeof(Hdr), NULL);
    367367            if (RT_FAILURE(rc))
    368368            {
    369369                pState->mfIOError = true;
    370                 LogRel(("Migration/TCP: Header read error: %Rrc\n", rc));
     370                LogRel(("Teleporter/TCP: Header read error: %Rrc\n", rc));
    371371                return rc;
    372372            }
    373             if (   Hdr.u32Magic != MIGRATIONTCPHDR_MAGIC
    374                 || Hdr.cb > MIGRATIONTCPHDR_MAX_SIZE)
     373            if (   Hdr.u32Magic != TELEPORTERTCPHDR_MAGIC
     374                || Hdr.cb > TELEPORTERTCPHDR_MAX_SIZE)
    375375            {
    376376                pState->mfIOError = true;
    377                 LogRel(("Migration/TCP: Invalid block: u32Magic=%#x cb=%#x\n", Hdr.u32Magic, Hdr.cb));
     377                LogRel(("Teleporter/TCP: Invalid block: u32Magic=%#x cb=%#x\n", Hdr.u32Magic, Hdr.cb));
    378378                return VERR_IO_GEN_FAILURE;
    379379            }
     
    393393         * Read more data.
    394394         */
    395         rc = migrationTcpReadSelect(pState);
     395        rc = teleporterTcpReadSelect(pState);
    396396        if (RT_FAILURE(rc))
    397397            return rc;
     
    401401        {
    402402            pState->mfIOError = true;
    403             LogRel(("Migration/TCP: Data read error: %Rrc (cb=%#x)\n", rc, cb));
     403            LogRel(("Teleporter/TCP: Data read error: %Rrc (cb=%#x)\n", rc, cb));
    404404            return rc;
    405405        }
     
    425425 * @copydoc SSMSTRMOPS::pfnSeek
    426426 */
    427 static DECLCALLBACK(int) migrationTcpOpSeek(void *pvUser, int64_t offSeek, unsigned uMethod, uint64_t *poffActual)
     427static DECLCALLBACK(int) teleporterTcpOpSeek(void *pvUser, int64_t offSeek, unsigned uMethod, uint64_t *poffActual)
    428428{
    429429    return VERR_NOT_SUPPORTED;
     
    434434 * @copydoc SSMSTRMOPS::pfnTell
    435435 */
    436 static DECLCALLBACK(uint64_t) migrationTcpOpTell(void *pvUser)
    437 {
    438     MigrationState *pState = (MigrationState *)pvUser;
     436static DECLCALLBACK(uint64_t) teleporterTcpOpTell(void *pvUser)
     437{
     438    TeleporterState *pState = (TeleporterState *)pvUser;
    439439    return pState->moffStream;
    440440}
     
    444444 * @copydoc SSMSTRMOPS::pfnSize
    445445 */
    446 static DECLCALLBACK(int) migrationTcpOpSize(void *pvUser, uint64_t *pcb)
     446static DECLCALLBACK(int) teleporterTcpOpSize(void *pvUser, uint64_t *pcb)
    447447{
    448448    return VERR_NOT_SUPPORTED;
     
    453453 * @copydoc SSMSTRMOPS::pfnClose
    454454 */
    455 static DECLCALLBACK(int) migrationTcpOpClose(void *pvUser)
    456 {
    457     MigrationState *pState = (MigrationState *)pvUser;
     455static DECLCALLBACK(int) teleporterTcpOpClose(void *pvUser)
     456{
     457    TeleporterState *pState = (TeleporterState *)pvUser;
    458458
    459459    if (pState->mfIsSource)
    460460    {
    461         MIGRATIONTCPHDR EofHdr = { MIGRATIONTCPHDR_MAGIC, 0 };
     461        TELEPORTERTCPHDR EofHdr = { TELEPORTERTCPHDR_MAGIC, 0 };
    462462        int rc = RTTcpWrite(pState->mhSocket, &EofHdr, sizeof(EofHdr));
    463463        if (RT_SUCCESS(rc))
     
    465465        if (RT_FAILURE(rc))
    466466        {
    467             LogRel(("Migration/TCP: EOF Header write error: %Rrc\n", rc));
     467            LogRel(("Teleporter/TCP: EOF Header write error: %Rrc\n", rc));
    468468            return rc;
    469469        }
     
    482482 * Method table for a TCP based stream.
    483483 */
    484 static SSMSTRMOPS const g_migrationTcpOps =
     484static SSMSTRMOPS const g_teleporterTcpOps =
    485485{
    486486    SSMSTRMOPS_VERSION,
    487     migrationTcpOpWrite,
    488     migrationTcpOpRead,
    489     migrationTcpOpSeek,
    490     migrationTcpOpTell,
    491     migrationTcpOpSize,
    492     migrationTcpOpClose,
     487    teleporterTcpOpWrite,
     488    teleporterTcpOpRead,
     489    teleporterTcpOpSeek,
     490    teleporterTcpOpTell,
     491    teleporterTcpOpSize,
     492    teleporterTcpOpClose,
    493493    SSMSTRMOPS_VERSION
    494494};
     
    498498 * @copydoc FNRTTIMERLR
    499499 */
    500 static DECLCALLBACK(void) migrationTimeout(RTTIMERLR hTimerLR, void *pvUser, uint64_t iTick)
     500static DECLCALLBACK(void) teleporterTimeout(RTTIMERLR hTimerLR, void *pvUser, uint64_t iTick)
    501501{
    502502    /* This is harmless for any open connections. */
     
    506506
    507507/**
    508  * Do the live migration.
     508 * Do the teleporter.
    509509 *
    510510 * @returns VBox status code.
    511  * @param   pState              The migration state.
     511 * @param   pState              The teleporter state.
    512512 */
    513513HRESULT
    514 Console::migrationSrc(MigrationStateSrc *pState)
     514Console::teleporterSrc(TeleporterStateSrc *pState)
    515515{
    516516    AutoCaller autoCaller(this);
     
    518518
    519519    /*
    520      * Wait for Console::Migrate to change the state.
     520     * Wait for Console::Teleport to change the state.
    521521     */
    522522    { AutoWriteLock autoLock(); }
     
    554554
    555555    /* ACK */
    556     hrc = migrationSrcReadACK(pState, "password", tr("Invalid password"));
     556    hrc = teleporterSrcReadACK(pState, "password", tr("Invalid password"));
    557557    if (FAILED(hrc))
    558558        return hrc;
     
    566566     * Start loading the state.
    567567     */
    568     hrc = migrationSrcSubmitCommand(pState, "load");
     568    hrc = teleporterSrcSubmitCommand(pState, "load");
    569569    if (FAILED(hrc))
    570570        return hrc;
    571571
    572     void *pvUser = static_cast<void *>(static_cast<MigrationState *>(pState));
    573     vrc = VMR3Migrate(pState->mpVM, &g_migrationTcpOps, pvUser, NULL/** @todo progress*/, pvUser);
     572    void *pvUser = static_cast<void *>(static_cast<TeleporterState *>(pState));
     573    vrc = VMR3Teleport(pState->mpVM, &g_teleporterTcpOps, pvUser, NULL/** @todo progress*/, pvUser);
    574574    if (vrc)
    575         return setError(E_FAIL, tr("VMR3Migrate -> %Rrc"), vrc);
    576 
    577     hrc = migrationSrcReadACK(pState, "load-complete");
     575        return setError(E_FAIL, tr("VMR3Teleport -> %Rrc"), vrc);
     576
     577    hrc = teleporterSrcReadACK(pState, "load-complete");
    578578    if (FAILED(hrc))
    579579        return hrc;
     
    582582     * State fun? Automatic power off?
    583583     */
    584     hrc = migrationSrcSubmitCommand(pState, "done");
     584    hrc = teleporterSrcSubmitCommand(pState, "done");
    585585    if (FAILED(hrc))
    586586        return hrc;
     
    595595 * @returns VINF_SUCCESS (ignored).
    596596 * @param   hThread             The thread.
    597  * @param   pvUser              Pointer to a MigrationStateSrc instance.
     597 * @param   pvUser              Pointer to a TeleporterStateSrc instance.
    598598 */
    599599/*static*/ DECLCALLBACK(int)
    600 Console::migrationSrcThreadWrapper(RTTHREAD hThread, void *pvUser)
    601 {
    602     MigrationStateSrc *pState = (MigrationStateSrc *)pvUser;
     600Console::teleporterSrcThreadWrapper(RTTHREAD hThread, void *pvUser)
     601{
     602    TeleporterStateSrc *pState = (TeleporterStateSrc *)pvUser;
    603603
    604604    AutoVMCaller autoVMCaller(pState->mptrConsole);
     
    606606
    607607    if (SUCCEEDED(hrc))
    608         hrc = pState->mptrConsole->migrationSrc(pState);
     608        hrc = pState->mptrConsole->teleporterSrc(pState);
    609609
    610610    pState->mptrProgress->notifyComplete(hrc);
     
    665665
    666666/**
    667  * Start live migration to the specified target.
     667 * Start teleporter to the specified target.
    668668 *
    669669 * @returns COM status code.
     
    675675 */
    676676STDMETHODIMP
    677 Console::Migrate(IN_BSTR aHostname, ULONG aPort, IN_BSTR aPassword, IProgress **aProgress)
     677Console::Teleport(IN_BSTR aHostname, ULONG aPort, IN_BSTR aPassword, IProgress **aProgress)
    678678{
    679679    /*
     
    709709     * Note! The thread won't start working until we release the lock.
    710710     */
    711     LogFlowThisFunc(("Initiating LIVE MIGRATION request...\n"));
    712 
    713     ComObjPtr<Progress> ptrMigrateProgress;
    714     HRESULT hrc = ptrMigrateProgress.createObject();
     711    LogFlowThisFunc(("Initiating TELEPORTER request...\n"));
     712
     713    ComObjPtr<Progress> ptrTelportationProgress;
     714    HRESULT hrc = ptrTelportationProgress.createObject();
    715715    CheckComRCReturnRC(hrc);
    716     hrc = ptrMigrateProgress->init(static_cast<IConsole *>(this),
    717                                    Bstr(tr("Live Migration")),
    718                                    TRUE /*aCancelable*/);
     716    hrc = ptrTelportationProgress->init(static_cast<IConsole *>(this),
     717                                        Bstr(tr("Teleporter")),
     718                                        TRUE /*aCancelable*/);
    719719    CheckComRCReturnRC(hrc);
    720720
    721     MigrationStateSrc *pState = new MigrationStateSrc(this, mpVM);
     721    TeleporterStateSrc *pState = new TeleporterStateSrc(this, mpVM);
    722722    pState->mstrPassword = aPassword;
    723723    pState->mstrHostname = aHostname;
    724724    pState->muPort       = aPort;
    725     pState->mptrProgress = ptrMigrateProgress;
    726 
    727     int vrc = RTThreadCreate(NULL, Console::migrationSrcThreadWrapper, (void *)pState, 0 /*cbStack*/,
    728                              RTTHREADTYPE_EMULATION, 0 /*fFlags*/, "Migrate");
     725    pState->mptrProgress = ptrTelportationProgress;
     726
     727    int vrc = RTThreadCreate(NULL, Console::teleporterSrcThreadWrapper, (void *)pState, 0 /*cbStack*/,
     728                             RTTHREADTYPE_EMULATION, 0 /*fFlags*/, "Teleport");
    729729    if (RT_SUCCESS(vrc))
    730730    {
    731731        hrc = setMachineState(MachineState_Saving);
    732732        if (SUCCEEDED(hrc))
    733             ptrMigrateProgress.queryInterfaceTo(aProgress);
     733            ptrTelportationProgress.queryInterfaceTo(aProgress);
    734734        else
    735             ptrMigrateProgress->Cancel();
     735            ptrTelportationProgress->Cancel();
    736736    }
    737737    else
     
    747747/**
    748748 * Creates a TCP server that listens for the source machine and passes control
    749  * over to Console::migrationDstServeConnection().
     749 * over to Console::teleporterTrgServeConnection().
    750750 *
    751751 * @returns VBox status code.
     
    758758 */
    759759int
    760 Console::migrationDst(PVM pVM, IMachine *pMachine, bool fStartPaused, void *pvVMCallbackTask)
     760Console::teleporterTrg(PVM pVM, IMachine *pMachine, bool fStartPaused, void *pvVMCallbackTask)
    761761{
    762762    /*
     
    764764     */
    765765    ULONG uPort;
    766     HRESULT hrc = pMachine->COMGETTER(LiveMigrationPort)(&uPort);
     766    HRESULT hrc = pMachine->COMGETTER(TeleporterPort)(&uPort);
    767767    if (FAILED(hrc))
    768768        return VERR_GENERAL_FAILURE;
    769769
     770    Bstr bstrAddress;
     771    hrc = pMachine->COMGETTER(TeleporterAddress)(bstrAddress.asOutParam());
     772    if (FAILED(hrc))
     773        return VERR_GENERAL_FAILURE;
     774    Utf8Str strAddress(bstrAddress);
     775    const char *pszAddress = strAddress.isEmpty() ? NULL : strAddress.c_str();
     776
    770777    Bstr bstrPassword;
    771     hrc = pMachine->COMGETTER(LiveMigrationPassword)(bstrPassword.asOutParam());
     778    hrc = pMachine->COMGETTER(TeleporterPassword)(bstrPassword.asOutParam());
    772779    if (FAILED(hrc))
    773780        return VERR_GENERAL_FAILURE;
     
    775782    strPassword.append('\n');           /* To simplify password checking. */
    776783
    777     Utf8Str strBind("");
    778     /** @todo Add a bind address property. */
    779     const char *pszBindAddress = strBind.isEmpty() ? NULL : strBind.c_str();
    780 
    781 
    782784    /*
    783785     * Create the TCP server.
     
    786788    PRTTCPSERVER hServer;
    787789    if (uPort)
    788         vrc = RTTcpServerCreateEx(pszBindAddress, uPort, &hServer);
     790        vrc = RTTcpServerCreateEx(pszAddress, uPort, &hServer);
    789791    else
    790792    {
     
    792794        {
    793795            uPort = RTRandU32Ex(cTries >= 8192 ? 49152 : 1024, 65534);
    794             vrc = RTTcpServerCreateEx(pszBindAddress, uPort, &hServer);
     796            vrc = RTTcpServerCreateEx(pszAddress, uPort, &hServer);
    795797            if (vrc != VERR_NET_ADDRESS_IN_USE)
    796798                break;
     
    798800        if (RT_SUCCESS(vrc))
    799801        {
    800             HRESULT hrc = pMachine->COMSETTER(LiveMigrationPort)(uPort);
     802            HRESULT hrc = pMachine->COMSETTER(TeleporterPort)(uPort);
    801803            if (FAILED(hrc))
    802804            {
     
    804806                return VERR_GENERAL_FAILURE;
    805807            }
     808/** @todo Should undo this upon return. */
    806809        }
    807810    }
     
    813816     */
    814817    RTTIMERLR hTimerLR;
    815     vrc = RTTimerLRCreateEx(&hTimerLR, 0 /*ns*/, RTTIMER_FLAGS_CPU_ANY, migrationTimeout, hServer);
     818    vrc = RTTimerLRCreateEx(&hTimerLR, 0 /*ns*/, RTTIMER_FLAGS_CPU_ANY, teleporterTimeout, hServer);
    816819    if (RT_SUCCESS(vrc))
    817820    {
     
    822825             * Do the job, when it returns we're done.
    823826             */
    824             MigrationStateDst State(this, pVM, pMachine, &hTimerLR);
     827            TeleporterStateTrg State(this, pVM, pMachine, &hTimerLR);
    825828            State.mstrPassword      = strPassword;
    826829            State.mhServer          = hServer;
    827830            State.mpvVMCallbackTask = pvVMCallbackTask;
    828831
    829             vrc = RTTcpServerListen(hServer, Console::migrationDstServeConnection, &State);
     832            vrc = RTTcpServerListen(hServer, Console::teleporterTrgServeConnection, &State);
    830833            if (vrc == VERR_TCP_SERVER_STOP)
    831834                vrc = State.mRc;
     
    839842            else
    840843            {
    841                 LogRel(("Migration: RTTcpServerListen -> %Rrc\n", vrc));
     844                LogRel(("Teleporter: RTTcpServerListen -> %Rrc\n", vrc));
    842845            }
    843846        }
     
    851854
    852855
    853 static int migrationTcpWriteACK(MigrationStateDst *pState)
     856static int teleporterTcpWriteACK(TeleporterStateTrg *pState)
    854857{
    855858    int rc = RTTcpWrite(pState->mhSocket, "ACK\n", sizeof("ACK\n") - 1);
    856859    if (RT_FAILURE(rc))
    857         LogRel(("Migration: RTTcpWrite(,ACK,) -> %Rrc\n", rc));
     860        LogRel(("Teleporter: RTTcpWrite(,ACK,) -> %Rrc\n", rc));
    858861    RTTcpFlush(pState->mhSocket);
    859862    return rc;
     
    861864
    862865
    863 static int migrationTcpWriteNACK(MigrationStateDst *pState, int32_t rc2)
     866static int teleporterTcpWriteNACK(TeleporterStateTrg *pState, int32_t rc2)
    864867{
    865868    char    szMsg[64];
     
    867870    int rc = RTTcpWrite(pState->mhSocket, szMsg, cch);
    868871    if (RT_FAILURE(rc))
    869         LogRel(("Migration: RTTcpWrite(,%s,%zu) -> %Rrc\n", szMsg, cch, rc));
     872        LogRel(("Teleporter: RTTcpWrite(,%s,%zu) -> %Rrc\n", szMsg, cch, rc));
    870873    RTTcpFlush(pState->mhSocket);
    871874    return rc;
     
    877880 */
    878881/*static*/ DECLCALLBACK(int)
    879 Console::migrationDstServeConnection(RTSOCKET Sock, void *pvUser)
    880 {
    881     MigrationStateDst *pState = (MigrationStateDst *)pvUser;
     882Console::teleporterTrgServeConnection(RTSOCKET Sock, void *pvUser)
     883{
     884    TeleporterStateTrg *pState = (TeleporterStateTrg *)pvUser;
    882885    pState->mhSocket = Sock;
    883886
     
    888891    if (RT_FAILURE(vrc))
    889892    {
    890         LogRel(("Migration: Failed to write welcome message: %Rrc\n", vrc));
     893        LogRel(("Teleporter: Failed to write welcome message: %Rrc\n", vrc));
    891894        return VINF_SUCCESS;
    892895    }
    893896
    894897    /*
    895      * Password (includes '\n', see migrationDst).  If it's right, tell
     898     * Password (includes '\n', see teleporterTrg).  If it's right, tell
    896899     * the TCP server to stop listening (frees up host resources and makes sure
    897900     * this is the last connection attempt).
     
    907910        {
    908911            if (RT_FAILURE(vrc))
    909                 LogRel(("Migration: Password read failure (off=%u): %Rrc\n", off, vrc));
     912                LogRel(("Teleporter: Password read failure (off=%u): %Rrc\n", off, vrc));
    910913            else
    911                 LogRel(("Migration: Invalid password (off=%u)\n", off));
    912             migrationTcpWriteNACK(pState, VERR_AUTHENTICATION_FAILURE);
     914                LogRel(("Teleporter: Invalid password (off=%u)\n", off));
     915            teleporterTcpWriteNACK(pState, VERR_AUTHENTICATION_FAILURE);
    913916            return VINF_SUCCESS;
    914917        }
    915918        off++;
    916919    }
    917     vrc = migrationTcpWriteACK(pState);
     920    vrc = teleporterTcpWriteACK(pState);
    918921    if (RT_FAILURE(vrc))
    919922        return vrc;
     
    929932    {
    930933        char szCmd[128];
    931         vrc = migrationTcpReadLine(pState, szCmd, sizeof(szCmd));
     934        vrc = teleporterTcpReadLine(pState, szCmd, sizeof(szCmd));
    932935        if (RT_FAILURE(vrc))
    933936            break;
     
    935938        if (!strcmp(szCmd, "load"))
    936939        {
    937             vrc = migrationTcpWriteACK(pState);
     940            vrc = teleporterTcpWriteACK(pState);
    938941            if (RT_FAILURE(vrc))
    939942                break;
    940943
    941944            pState->moffStream = 0;
    942             void *pvUser = static_cast<void *>(static_cast<MigrationState *>(pState));
    943             vrc = VMR3LoadFromStream(pState->mpVM, &g_migrationTcpOps, pvUser,
     945            void *pvUser = static_cast<void *>(static_cast<TeleporterState *>(pState));
     946            vrc = VMR3LoadFromStream(pState->mpVM, &g_teleporterTcpOps, pvUser,
    944947                                     Console::stateProgressCallback, pState->mpvVMCallbackTask);
    945948            if (RT_FAILURE(vrc))
    946949            {
    947                 LogRel(("Migration: VMR3LoadFromStream -> %Rrc\n", vrc));
    948                 migrationTcpWriteNACK(pState, vrc);
     950                LogRel(("Teleporter: VMR3LoadFromStream -> %Rrc\n", vrc));
     951                teleporterTcpWriteNACK(pState, vrc);
    949952                break;
    950953            }
     
    953956            pState->mfStopReading = false;
    954957            size_t cbRead;
    955             vrc = migrationTcpOpRead(pvUser, pState->moffStream, szCmd, 1, &cbRead);
     958            vrc = teleporterTcpOpRead(pvUser, pState->moffStream, szCmd, 1, &cbRead);
    956959            if (vrc != VERR_EOF)
    957960            {
    958                 LogRel(("Migration: Draining migrationTcpOpRead -> %Rrc\n", vrc));
    959                 migrationTcpWriteNACK(pState, vrc);
     961                LogRel(("Teleporter: Draining teleporterTcpOpRead -> %Rrc\n", vrc));
     962                teleporterTcpWriteNACK(pState, vrc);
    960963                break;
    961964            }
    962965
    963             vrc = migrationTcpWriteACK(pState);
     966            vrc = teleporterTcpWriteACK(pState);
    964967            if (RT_FAILURE(vrc))
    965968                break;
     
    969972        else if (!strcmp(szCmd, "done"))
    970973        {
    971             vrc = migrationTcpWriteACK(pState);
     974            vrc = teleporterTcpWriteACK(pState);
    972975            break;
    973976        }
    974977        else
    975978        {
    976             LogRel(("Migration: Unknown command '%s' (%.*Rhxs)\n", szCmd, strlen(szCmd), szCmd));
     979            LogRel(("Teleporter: Unknown command '%s' (%.*Rhxs)\n", szCmd, strlen(szCmd), szCmd));
    977980            vrc = VERR_NOT_IMPLEMENTED;
    978             migrationTcpWriteNACK(pState, vrc);
     981            teleporterTcpWriteNACK(pState, vrc);
    979982            break;
    980983        }
  • trunk/src/VBox/Main/Global.cpp

    r23703 r23801  
    197197        case MachineState_Saving:       return "Saving";
    198198        case MachineState_Restoring:    return "Restoring";
    199         case MachineState_MigratingFrom:return "MigratingFrom";
     199        case MachineState_TeleportingFrom: return "TeleportingFrom";
    200200        case MachineState_Discarding:   return "Discarding";
    201201        case MachineState_SettingUp:    return "SettingUp";
  • trunk/src/VBox/Main/MachineImpl.cpp

    r23791 r23801  
    155155
    156156    mNameSync = TRUE;
    157     mLiveMigrationTarget = FALSE;
    158     mLiveMigrationPort = 0;
     157    mTeleporterEnabled = FALSE;
     158    mTeleporterPort = 0;
    159159
    160160    /* mName, mOSTypeId, mSnapshotFolder, mSnapshotFolderFull are initialized in
     
    18571857
    18581858STDMETHODIMP
    1859 Machine::COMGETTER(LiveMigrationTarget)(BOOL *aEnabled)
     1859Machine::COMGETTER(TeleporterEnabled)(BOOL *aEnabled)
    18601860{
    18611861    CheckComArgOutPointerValid(aEnabled);
     
    18661866    AutoReadLock alock(this);
    18671867
    1868     *aEnabled = mUserData->mLiveMigrationTarget;
     1868    *aEnabled = mUserData->mTeleporterEnabled;
    18691869
    18701870    return S_OK;
     
    18721872
    18731873STDMETHODIMP
    1874 Machine::COMSETTER(LiveMigrationTarget)(BOOL aEnabled)
     1874Machine::COMSETTER(TeleporterEnabled)(BOOL aEnabled)
    18751875{
    18761876    AutoCaller autoCaller(this);
     
    18931893
    18941894    mUserData.backup();
    1895     mUserData->mLiveMigrationTarget = aEnabled;
     1895    mUserData->mTeleporterEnabled = aEnabled;
    18961896
    18971897    return S_OK;
     
    18991899
    19001900STDMETHODIMP
    1901 Machine::COMGETTER(LiveMigrationPort)(ULONG *aPort)
     1901Machine::COMGETTER(TeleporterPort)(ULONG *aPort)
    19021902{
    19031903    CheckComArgOutPointerValid(aPort);
     
    19081908    AutoReadLock alock(this);
    19091909
    1910     *aPort = mUserData->mLiveMigrationPort;
     1910    *aPort = mUserData->mTeleporterPort;
    19111911
    19121912    return S_OK;
     
    19141914
    19151915STDMETHODIMP
    1916 Machine::COMSETTER(LiveMigrationPort)(ULONG aPort)
     1916Machine::COMSETTER(TeleporterPort)(ULONG aPort)
    19171917{
    19181918    if (aPort >= _64K)
     
    19281928
    19291929    mUserData.backup();
    1930     mUserData->mLiveMigrationPort = aPort;
     1930    mUserData->mTeleporterPort = aPort;
    19311931
    19321932    return S_OK;
     
    19341934
    19351935STDMETHODIMP
    1936 Machine::COMGETTER(LiveMigrationPassword)(BSTR *aPassword)
    1937 {
    1938     CheckComArgOutPointerValid(aPassword);
     1936Machine::COMGETTER(TeleporterAddress)(BSTR *aAddress)
     1937{
     1938    CheckComArgOutPointerValid(aAddress);
    19391939
    19401940    AutoCaller autoCaller(this);
     
    19431943    AutoReadLock alock(this);
    19441944
    1945     mUserData->mLiveMigrationPassword.cloneTo(aPassword);
     1945    mUserData->mTeleporterAddress.cloneTo(aAddress);
    19461946
    19471947    return S_OK;
     
    19491949
    19501950STDMETHODIMP
    1951 Machine::COMSETTER(LiveMigrationPassword)(IN_BSTR aPassword)
     1951Machine::COMSETTER(TeleporterAddress)(IN_BSTR aAddress)
    19521952{
    19531953    AutoCaller autoCaller(this);
     
    19601960
    19611961    mUserData.backup();
    1962     mUserData->mLiveMigrationPassword = aPassword;
     1962    mUserData->mTeleporterAddress = aAddress;
     1963
     1964    return S_OK;
     1965}
     1966
     1967STDMETHODIMP
     1968Machine::COMGETTER(TeleporterPassword)(BSTR *aPassword)
     1969{
     1970    CheckComArgOutPointerValid(aPassword);
     1971
     1972    AutoCaller autoCaller(this);
     1973    CheckComRCReturnRC(autoCaller.rc());
     1974
     1975    AutoReadLock alock(this);
     1976
     1977    mUserData->mTeleporterPassword.cloneTo(aPassword);
     1978
     1979    return S_OK;
     1980}
     1981
     1982STDMETHODIMP
     1983Machine::COMSETTER(TeleporterPassword)(IN_BSTR aPassword)
     1984{
     1985    AutoCaller autoCaller(this);
     1986    CheckComRCReturnRC(autoCaller.rc());
     1987
     1988    AutoWriteLock alock(this);
     1989
     1990    HRESULT rc = checkStateDependency(MutableStateDep);
     1991    CheckComRCReturnRC(rc);
     1992
     1993    mUserData.backup();
     1994    mUserData->mTeleporterPassword = aPassword;
    19631995
    19641996    return S_OK;
     
    50445076        mData->mLastStateChange = mData->m_pMachineConfigFile->timeLastStateChange;
    50455077
    5046         /* Live migration */
    5047         mUserData->mLiveMigrationTarget = mData->m_pMachineConfigFile->fLiveMigrationTarget;
    5048         mUserData->mLiveMigrationPort = mData->m_pMachineConfigFile->uLiveMigrationPort;
    5049         mUserData->mLiveMigrationPassword = mData->m_pMachineConfigFile->strLiveMigrationPassword;
     5078        /* teleportation */
     5079        mUserData->mTeleporterEnabled  = mData->m_pMachineConfigFile->fTeleporterEnabled;
     5080        mUserData->mTeleporterPort     = mData->m_pMachineConfigFile->uTeleporterPort;
     5081        mUserData->mTeleporterAddress  = mData->m_pMachineConfigFile->strTeleporterAddress;
     5082        mUserData->mTeleporterPassword = mData->m_pMachineConfigFile->strTeleporterPassword;
    50505083
    50515084        /*
     
    60416074        mData->m_pMachineConfigFile->fAborted = (mData->mMachineState == MachineState_Aborted);
    60426075
    6043         mData->m_pMachineConfigFile->fLiveMigrationTarget = !!mUserData->mLiveMigrationTarget;
    6044         mData->m_pMachineConfigFile->uLiveMigrationPort = mUserData->mLiveMigrationPort;
    6045         mData->m_pMachineConfigFile->strLiveMigrationPassword = mUserData->mLiveMigrationPassword;
     6076        mData->m_pMachineConfigFile->fTeleporterEnabled    = !!mUserData->mTeleporterEnabled;
     6077        mData->m_pMachineConfigFile->uTeleporterPort       = mUserData->mTeleporterPort;
     6078        mData->m_pMachineConfigFile->strTeleporterAddress  = mUserData->mTeleporterAddress;
     6079        mData->m_pMachineConfigFile->strTeleporterPassword = mUserData->mTeleporterPassword;
    60466080
    60476081        rc = saveHardware(mData->m_pMachineConfigFile->hardwareMachine);
     
    92849318        case MachineState_Starting:
    92859319        case MachineState_Restoring:
    9286         case MachineState_MigratingFrom:
     9320        case MachineState_TeleportingFrom:
    92879321        case MachineState_Paused:
    92889322        case MachineState_Running:
     
    1016010194    AssertReturn(   mData->mMachineState == MachineState_Starting
    1016110195                 || mData->mMachineState == MachineState_Restoring
    10162                  || mData->mMachineState == MachineState_MigratingFrom, E_FAIL);
     10196                 || mData->mMachineState == MachineState_TeleportingFrom, E_FAIL);
    1016310197
    1016410198    typedef std::list <ComPtr<IMedium> > MediaList;
     
    1034810382            && aMachineState   == MachineState_Restoring)
    1034910383        || (   oldMachineState == MachineState_PoweredOff
    10350             && aMachineState   == MachineState_MigratingFrom)
     10384            && aMachineState   == MachineState_TeleportingFrom)
    1035110385        || (   oldMachineState <  MachineState_Running /* any other OFF state */
    1035210386            && aMachineState   == MachineState_Starting)
     
    1042010454    if (   aMachineState == MachineState_Starting
    1042110455        || aMachineState == MachineState_Restoring
    10422         || aMachineState == MachineState_MigratingFrom
     10456        || aMachineState == MachineState_TeleportingFrom
    1042310457       )
    1042410458    {
  • trunk/src/VBox/Main/Makefile.kmk

    r23742 r23801  
    462462
    463463
    464 if defined(VBOX_WITH_CROGL) || defined(VBOX_WITH_VIDEOHWACCEL) 
     464if defined(VBOX_WITH_CROGL) || defined(VBOX_WITH_VIDEOHWACCEL)
    465465 ifneq ($(KBUILD_TARGET),darwin)
    466466  #
     
    613613        ConsoleImpl.cpp \
    614614        ConsoleImpl2.cpp \
    615         ConsoleImpl-LiveMigration.cpp \
     615        ConsoleImplTeleporter.cpp \
    616616        ConsoleVRDPServer.cpp \
    617617        GuestImpl.cpp \
  • trunk/src/VBox/Main/cbinding/tstXPCOMCCall.c

    r23703 r23801  
    8484        case MachineState_Saving:              return "Saving";
    8585        case MachineState_Restoring:           return "Restoring";
    86         case MachineState_MigratingFrom:       return "MigratingFrom";
     86        case MachineState_TeleportingFrom:     return "TeleportingFrom";
    8787        case MachineState_Discarding:          return "Discarding";
    8888        case MachineState_SettingUp:           return "SettingUp";
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r23791 r23801  
    473473  <enum
    474474    name="MachineState"
    475     uuid="f532545d-9ae7-4402-8b5f-1ea7d778cfc7"
     475    uuid="0f4cc50c-e1cc-4cde-ae7a-e6164bac5ba2"
    476476  >
    477477    <desc>
     
    673673      </desc>
    674674    </const>
    675     <const name="MigratingFrom"         value="11">
    676       <desc>
    677         Migrating the machine state from another host or process.
     675    <const name="TeleportingFrom"       value="11">
     676      <desc>
     677        Teleporting the machine state from another host or process.
    678678      </desc>
    679679    </const>
     
    778778      <desc>
    779779        This setting determines whether VirtualBox will expose a synthetic CPU to the guest to allow
    780         live migration between host systems that differ significantly.
     780        teleporting between host systems that differ significantly.
    781781      </desc>
    782782    </const>
     
    40724072  <interface
    40734073     name="IMachine" extends="$unknown"
    4074      uuid="e8e1c6a9-679e-4a73-a1e5-d9a81027fbda"
     4074     uuid="d867a463-0f78-4ec7-a876-8da001464537"
    40754075     wsmap="managed"
    40764076     >
     
    45284528    </attribute>
    45294529
    4530     <attribute name="liveMigrationTarget" type="boolean">
    4531       <desc>
    4532         When set to @a true, the virtual machine becomes a live migration
    4533         target.  This can only set to @a true when the VM is in the @a
    4534         PoweredOff or @a Aborted state.
     4530    <attribute name="teleporterEnabled" type="boolean">
     4531      <desc>
     4532        When set to @a true, the virtual machine becomes a target teleporter
     4533        the next time it is powered on.  This can only set to @a true when the
     4534        VM is in the @a PoweredOff or @a Aborted state.
    45354535
    45364536        This property is automatically set to @a false when the VM is powered
     
    45394539    </attribute>
    45404540
    4541     <attribute name="liveMigrationPort" type="unsigned long">
    4542       <desc>
    4543         The TCP port used for live migration.  This can only be set when the
    4544         VM is in the @a PoweredOff state.
    4545 
    4546         0 means the port is automatically selected and the source machine will
    4547         have to be told where to connected after the destination has been
    4548         started.
    4549       </desc>
    4550     </attribute>
    4551 
    4552     <attribute name="liveMigrationPassword" type="wstring">
    4553       <desc>
    4554         The password the live migration target will check for.
     4541    <attribute name="teleporterPort" type="unsigned long">
     4542      <desc>
     4543        The TCP port the target teleporter will listen for incoming
     4544        teleportations on.
     4545
     4546        0 means the port is automatically selected upon power on.  The actual
     4547        value can be read from this property while the machine is waiting for
     4548        incoming teleportations.
     4549      </desc>
     4550    </attribute>
     4551
     4552    <attribute name="teleporterAddress" type="wstring">
     4553      <desc>
     4554        The address the target teleporter will listen on.  If set to an empty
     4555        string, it will listen on all addresses.
     4556      </desc>
     4557    </attribute>
     4558
     4559    <attribute name="teleporterPassword" type="wstring">
     4560      <desc>
     4561        The password the to check for on the target teleporter.  This is just a
     4562        very basic measure to prevent simple hacks and operators accidentally
     4563        beaming a virtual machine to the wrong place.
    45554564      </desc>
    45564565    </attribute>
     
    60796088  <interface
    60806089     name="IConsole" extends="$unknown"
    6081      uuid="c47486e1-3d99-4212-b1c5-86451978999d"
     6090     uuid="03312360-0364-4b7a-ad71-1a8450133774"
    60826091     wsmap="managed"
    60836092     >
     
    68176826    </method>
    68186827
    6819     <method name="migrate">
    6820       <desc>
    6821         Migrate the VM to a different host machine.
     6828    <method name="teleport">
     6829      <desc>
     6830        Teleport the VM to a different host machine or process.
    68226831
    68236832        TODO explain the details.
     
    68286837      </desc>
    68296838      <param name="hostname" type="wstring" dir="in">
    6830         <desc>The name or IP of the host to migrate to.</desc>
     6839        <desc>The name or IP of the host to teleport to.</desc>
    68316840      </param>
    68326841      <param name="tcpport" type="unsigned long" dir="in">
  • trunk/src/VBox/Main/include/ConsoleImpl.h

    r23720 r23801  
    3434class Display;
    3535class MachineDebugger;
    36 class MigrationStateSrc;
     36class TeleporterStateSrc;
    3737class OUSBDevice;
    3838class RemoteUSBDevice;
     
    148148    STDMETHOD(DiscardCurrentState) (IProgress **aProgress);
    149149    STDMETHOD(DiscardCurrentSnapshotAndState) (IProgress **aProgress);
    150     STDMETHOD(Migrate)(IN_BSTR aHostname, ULONG aPort, IN_BSTR aPassword, IProgress **aProgress);
     150    STDMETHOD(Teleport)(IN_BSTR aHostname, ULONG aPort, IN_BSTR aPassword, IProgress **aProgress);
    151151    STDMETHOD(RegisterCallback) (IConsoleCallback *aCallback);
    152152    STDMETHOD(UnregisterCallback)(IConsoleCallback *aCallback);
     
    517517#endif
    518518
    519     /** @name Live migration support
     519    /** @name Teleporter support
    520520     * @{ */
    521     static DECLCALLBACK(int)    migrationSrcThreadWrapper(RTTHREAD hThread, void *pvUser);
    522     HRESULT                     migrationSrc(MigrationStateSrc *pState);
    523     HRESULT                     migrationSrcReadACK(MigrationStateSrc *pState, const char *pszWhich, const char *pszNAckMsg = NULL);
    524     HRESULT                     migrationSrcSubmitCommand(MigrationStateSrc *pState, const char *pszCommand);
    525     int                         migrationDst(PVM pVM, IMachine *pMachine, bool fStartPaused, void *pvVMCallbackTask);
    526     static DECLCALLBACK(int)    migrationDstServeConnection(RTSOCKET Sock, void *pvUser);
     521    static DECLCALLBACK(int)    teleporterSrcThreadWrapper(RTTHREAD hThread, void *pvUser);
     522    HRESULT                     teleporterSrc(TeleporterStateSrc *pState);
     523    HRESULT                     teleporterSrcReadACK(TeleporterStateSrc *pState, const char *pszWhich, const char *pszNAckMsg = NULL);
     524    HRESULT                     teleporterSrcSubmitCommand(TeleporterStateSrc *pState, const char *pszCommand);
     525    int                         teleporterTrg(PVM pVM, IMachine *pMachine, bool fStartPaused, void *pvVMCallbackTask);
     526    static DECLCALLBACK(int)    teleporterTrgServeConnection(RTSOCKET Sock, void *pvUser);
    527527    /** @} */
    528528
     
    632632};
    633633
    634 #endif // ____H_CONSOLEIMPL
     634#endif // !____H_CONSOLEIMPL
    635635/* vi: set tabstop=4 shiftwidth=4 expandtab: */
  • trunk/src/VBox/Main/include/MachineImpl.h

    r23750 r23801  
    228228        bool operator==(const UserData &that) const
    229229        {
    230             return this == &that ||
    231                    (mName == that.mName &&
    232                     mNameSync == that.mNameSync &&
    233                     mDescription == that.mDescription &&
    234                     mOSTypeId == that.mOSTypeId &&
    235                     mSnapshotFolderFull == that.mSnapshotFolderFull &&
    236                     mLiveMigrationTarget == that.mLiveMigrationTarget &&
    237                     mLiveMigrationPort == that.mLiveMigrationPort &&
    238                     mLiveMigrationPassword == that.mLiveMigrationPassword);
     230            return this == &that
     231                || (   mName                 == that.mName
     232                    && mNameSync             == that.mNameSync
     233                    && mDescription          == that.mDescription
     234                    && mOSTypeId             == that.mOSTypeId
     235                    && mSnapshotFolderFull   == that.mSnapshotFolderFull
     236                    && mTeleporterEnabled    == that.mTeleporterEnabled
     237                    && mTeleporterPort       == that.mTeleporterPort
     238                    && mTeleporterAddress    == that.mTeleporterAddress
     239                    && mTeleporterPassword   == that.mTeleporterPassword);
    239240        }
    240241
     
    245246        Bstr    mSnapshotFolder;
    246247        Bstr    mSnapshotFolderFull;
    247         BOOL    mLiveMigrationTarget;
    248         ULONG   mLiveMigrationPort;
    249         Bstr    mLiveMigrationPassword;
     248        BOOL    mTeleporterEnabled;
     249        ULONG   mTeleporterPort;
     250        Bstr    mTeleporterAddress;
     251        Bstr    mTeleporterPassword;
    250252    };
    251253
     
    560562    STDMETHOD(COMSETTER(GuestPropertyNotificationPatterns))(IN_BSTR aPattern);
    561563    STDMETHOD(COMGETTER(StorageControllers))(ComSafeArrayOut(IStorageController *, aStorageControllers));
    562     STDMETHOD(COMGETTER(LiveMigrationTarget))(BOOL *aEnabled);
    563     STDMETHOD(COMSETTER(LiveMigrationTarget))(BOOL aEnabled);
    564     STDMETHOD(COMGETTER(LiveMigrationPort))(ULONG *aPort);
    565     STDMETHOD(COMSETTER(LiveMigrationPort))(ULONG aPort);
    566     STDMETHOD(COMGETTER(LiveMigrationPassword))(BSTR *aPassword);
    567     STDMETHOD(COMSETTER(LiveMigrationPassword))(IN_BSTR aPassword);
     564    STDMETHOD(COMGETTER(TeleporterEnabled))(BOOL *aEnabled);
     565    STDMETHOD(COMSETTER(TeleporterEnabled))(BOOL aEnabled);
     566    STDMETHOD(COMGETTER(TeleporterPort))(ULONG *aPort);
     567    STDMETHOD(COMSETTER(TeleporterPort))(ULONG aPort);
     568    STDMETHOD(COMGETTER(TeleporterAddress))(BSTR *aAddress);
     569    STDMETHOD(COMSETTER(TeleporterAddress))(IN_BSTR aAddress);
     570    STDMETHOD(COMGETTER(TeleporterPassword))(BSTR *aPassword);
     571    STDMETHOD(COMSETTER(TeleporterPassword))(IN_BSTR aPassword);
    568572
    569573    // IMachine methods
  • trunk/src/VBox/Main/xml/Settings.cpp

    r23795 r23801  
    22032203            // constructor has called RTTimeNow(&timeLastStateChange) before
    22042204
    2205         if (!elmMachine.getAttributeValue("liveMigrationTarget", fLiveMigrationTarget))
    2206             fLiveMigrationTarget = false;
    2207         if (!elmMachine.getAttributeValue("liveMigrationPort", uLiveMigrationPort))
    2208             uLiveMigrationPort = 0;
    2209         if (!elmMachine.getAttributeValue("liveMigrationPassword", strLiveMigrationPassword))
    2210             strLiveMigrationPassword = "";
     2205        if (!elmMachine.getAttributeValue("teleporterEnabled", fTeleporterEnabled) /** @todo Teleportation: remove liveMigration* in a couple of days. */
     2206         && !elmMachine.getAttributeValue("liveMigrationTarget", fTeleporterEnabled))
     2207            fTeleporterEnabled = false;
     2208        if (!elmMachine.getAttributeValue("teleporterPort", uTeleporterPort)
     2209         && !elmMachine.getAttributeValue("liveMigrationPort", uTeleporterPort))
     2210            uTeleporterPort = 0;
     2211        if (!elmMachine.getAttributeValue("teleporterAddress", strTeleporterAddress))
     2212            strTeleporterAddress = "";
     2213        if (!elmMachine.getAttributeValue("teleporterPassword", strTeleporterPassword)
     2214         && !elmMachine.getAttributeValue("liveMigrationPassword", strTeleporterPassword))
     2215            strTeleporterPassword = "";
    22112216
    22122217        // parse Hardware before the other elements because other things depend on it
     
    22732278    : ConfigFileBase(pstrFilename),
    22742279      fNameSync(true),
    2275       fLiveMigrationTarget(false),
    2276       uLiveMigrationPort(0),
     2280      fTeleporterEnabled(false),
     2281      uTeleporterPort(0),
    22772282      fCurrentStateModified(true),
    22782283      fAborted(false)
     
    28732878    }
    28742879
    2875 #ifdef VBOX_WITH_LIVE_MIGRATION
    28762880    if (    m->sv < SettingsVersion_v1_9
    2877         &&  (   fLiveMigrationTarget
    2878              || uLiveMigrationPort
    2879              || !strLiveMigrationPassword.isEmpty()
     2881        &&  (   fTeleporterEnabled
     2882             || uTeleporterPort
     2883             || !strTeleporterAddress.isEmpty()
     2884             || !strTeleporterPassword.isEmpty()
    28802885            )
    28812886       )
    28822887        m->sv = SettingsVersion_v1_9;
    2883 #endif
    28842888}
    28852889
     
    29212925        if (fAborted)
    29222926            pelmMachine->setAttribute("aborted", fAborted);
    2923 #ifdef VBOX_WITH_LIVE_MIGRATION /** @todo LiveMigration: Checkout how the file format versioning is done. */
     2927#ifdef VBOX_WITH_LIVE_MIGRATION /** @todo Teleportation: Enable in a bit. */
    29242928        if (m->sv >= SettingsVersion_v1_9)
    29252929        {
    2926             if (fLiveMigrationTarget)
    2927                 pelmMachine->setAttribute("liveMigrationTarget", true);
    2928             if (uLiveMigrationPort)
    2929                 pelmMachine->setAttribute("liveMigrationPort", uLiveMigrationPort);
    2930             if (!strLiveMigrationPassword.isEmpty())
    2931                 pelmMachine->setAttribute("liveMigrationPassword", strLiveMigrationPassword);
     2930            if (fTeleporterEnabled)
     2931                pelmMachine->setAttribute("teleporterEnabled", true);
     2932            if (uTeleporterPort)
     2933                pelmMachine->setAttribute("teleporterPort", uTeleporterPort);
     2934            if (!strTeleporterAddress.isEmpty())
     2935                pelmMachine->setAttribute("teleporterAddress", strTeleporterAddress);
     2936            if (!strTeleporterPassword.isEmpty())
     2937                pelmMachine->setAttribute("teleporterPassword", strTeleporterPassword);
    29322938        }
    29332939#endif
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette