Changeset 23801 in vbox for trunk/src/VBox/Main
- Timestamp:
- Oct 15, 2009 3:00:47 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 53543
- Location:
- trunk/src/VBox/Main
- Files:
-
- 9 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ConsoleImpl.cpp
r23703 r23801 228 228 mConfigConstructor(NULL), 229 229 mStartPaused(false), 230 m LiveMigrationTarget(FALSE)230 mTeleporterEnabled(FALSE) 231 231 {} 232 232 … … 236 236 Console::SharedFolderDataMap mSharedFolders; 237 237 bool mStartPaused; 238 BOOL m LiveMigrationTarget;238 BOOL mTeleporterEnabled; 239 239 240 240 typedef std::list< ComPtr<IMedium> > HardDiskList; … … 4614 4614 } 4615 4615 4616 /* test and clear the LiveMigrationTargetproperty */4617 BOOL f LiveMigrationTarget;4618 rc = mMachine->COMGETTER( LiveMigrationTarget)(&fLiveMigrationTarget);4616 /* test and clear the TeleporterEnabled property */ 4617 BOOL fTeleporterEnabled; 4618 rc = mMachine->COMGETTER(TeleporterEnabled)(&fTeleporterEnabled); 4619 4619 CheckComRCReturnRC(rc); 4620 if (f LiveMigrationTarget)4621 { 4622 rc = mMachine->COMSETTER( LiveMigrationTarget)(FALSE);4620 if (fTeleporterEnabled) 4621 { 4622 rc = mMachine->COMSETTER(TeleporterEnabled)(FALSE); 4623 4623 CheckComRCReturnRC(rc); 4624 4624 } … … 4630 4630 if (mMachineState == MachineState_Saved) 4631 4631 progressDesc = tr("Restoring virtual machine"); 4632 else if (f LiveMigrationTarget)4633 progressDesc = tr(" Migrating virtual machine");4632 else if (fTeleporterEnabled) 4633 progressDesc = tr("Teleporting virtual machine"); 4634 4634 else 4635 4635 progressDesc = tr("Starting virtual machine"); … … 4650 4650 if (mMachineState == MachineState_Saved) 4651 4651 task->mSavedStateFile = savedStateFile; 4652 task->m LiveMigrationTarget = fLiveMigrationTarget;4652 task->mTeleporterEnabled = fTeleporterEnabled; 4653 4653 4654 4654 /* Reset differencing hard disks for which autoReset is true */ … … 4732 4732 if (mMachineState == MachineState_Saved) 4733 4733 setMachineState(MachineState_Restoring); 4734 else if (f LiveMigrationTarget)4735 setMachineState(MachineState_ MigratingFrom);4734 else if (fTeleporterEnabled) 4735 setMachineState(MachineState_TeleportingFrom); 4736 4736 else 4737 4737 setMachineState(MachineState_Starting); … … 4799 4799 mMachineState == MachineState_Starting || 4800 4800 mMachineState == MachineState_Restoring || 4801 mMachineState == MachineState_ MigratingFrom || /** @todo LiveMigration ???*/4801 mMachineState == MachineState_TeleportingFrom || /** @todo Teleportation ???*/ 4802 4802 mMachineState == MachineState_Stopping, 4803 4803 ("Invalid machine state: %s\n", Global::stringifyMachineState(mMachineState))); … … 4814 4814 && ( mMachineState == MachineState_Starting 4815 4815 || mMachineState == MachineState_Restoring 4816 || mMachineState == MachineState_ MigratingFrom)4816 || mMachineState == MachineState_TeleportingFrom) 4817 4817 ) 4818 4818 mVMPoweredOff = true; … … 4825 4825 if ( mMachineState != MachineState_Saving 4826 4826 && mMachineState != MachineState_Restoring 4827 && mMachineState != MachineState_ MigratingFrom4827 && mMachineState != MachineState_TeleportingFrom 4828 4828 && mMachineState != MachineState_Stopping 4829 4829 ) … … 5511 5511 && that->mMachineState != MachineState_Saving 5512 5512 && that->mMachineState != MachineState_Restoring 5513 && that->mMachineState != MachineState_ MigratingFrom5513 && that->mMachineState != MachineState_TeleportingFrom 5514 5514 ) 5515 5515 { … … 5606 5606 that->setMachineState(MachineState_Saved); 5607 5607 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. */ 5610 5610 that->setMachineState(MachineState_PoweredOff); 5611 5611 break; … … 5617 5617 { 5618 5618 /** @todo state/live VMSTATE_SUSPENDING_LS. */ 5619 if ( 5619 if (aOldState == VMSTATE_SUSPENDING) 5620 5620 { 5621 5621 AutoWriteLock alock(that); … … 5647 5647 && aOldState == VMSTATE_POWERING_ON) 5648 5648 || ( ( that->mMachineState == MachineState_Restoring 5649 || that->mMachineState == MachineState_ MigratingFrom5649 || that->mMachineState == MachineState_TeleportingFrom 5650 5650 || that->mMachineState == MachineState_Paused) 5651 5651 && aOldState == VMSTATE_RESUMING)); … … 6212 6212 /** 6213 6213 * Process callback handler for VMR3LoadFromFile, VMR3LoadFromStream, VMR3Save 6214 * and VMR3 Migrate.6214 * and VMR3Teleport. 6215 6215 * 6216 6216 * @param pVM The VM handle. … … 6760 6760 } 6761 6761 } 6762 else if (task->m LiveMigrationTarget)6762 else if (task->mTeleporterEnabled) 6763 6763 { 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())); 6767 6767 if (RT_FAILURE(vrc)) 6768 6768 VMR3PowerOff(pVM); … … 6843 6843 if ( console->mMachineState == MachineState_Starting 6844 6844 || console->mMachineState == MachineState_Restoring 6845 || console->mMachineState == MachineState_ MigratingFrom6845 || console->mMachineState == MachineState_TeleportingFrom 6846 6846 ) 6847 6847 { -
trunk/src/VBox/Main/ConsoleImplTeleporter.cpp
r23793 r23801 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Console COM Class implementation, The Live MigrationPart.3 * VBox Console COM Class implementation, The Teleporter Part. 4 4 */ 5 5 … … 45 45 *******************************************************************************/ 46 46 /** 47 * Base class for the migrationstate.47 * Base class for the teleporter state. 48 48 * 49 49 * These classes are used as advanced structs, not as proper classes. 50 50 */ 51 class MigrationState51 class TeleporterState 52 52 { 53 53 public: … … 67 67 /** @} */ 68 68 69 MigrationState(Console *pConsole, PVM pVM, bool fIsSource)69 TeleporterState(Console *pConsole, PVM pVM, bool fIsSource) 70 70 : mptrConsole(pConsole) 71 71 , mpVM(pVM) … … 83 83 84 84 /** 85 * Migrationstate used by the source side.86 */ 87 class MigrationStateSrc : public MigrationState85 * Teleporter state used by the source side. 86 */ 87 class TeleporterStateSrc : public TeleporterState 88 88 { 89 89 public: … … 92 92 uint32_t muPort; 93 93 94 MigrationStateSrc(Console *pConsole, PVM pVM)95 : MigrationState(pConsole, pVM, true /*fIsSource*/)94 TeleporterStateSrc(Console *pConsole, PVM pVM) 95 : TeleporterState(pConsole, pVM, true /*fIsSource*/) 96 96 , muPort(UINT32_MAX) 97 97 { … … 101 101 102 102 /** 103 * Migrationstate used by the destiation side.104 */ 105 class MigrationStateDst : public MigrationState103 * Teleporter state used by the destiation side. 104 */ 105 class TeleporterStateTrg : public TeleporterState 106 106 { 107 107 public: … … 112 112 int mRc; 113 113 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*/) 116 116 , mpMachine(pMachine) 117 117 , mpvVMCallbackTask(NULL) … … 130 130 * stream ends. 131 131 */ 132 typedef struct MIGRATIONTCPHDR132 typedef struct TELEPORTERTCPHDR 133 133 { 134 134 /** Magic value. */ … … 137 137 * 0 indicates the end of the stream. */ 138 138 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) 142 142 /** The max block size. */ 143 #define MIGRATIONTCPHDR_MAX_SIZE UINT32_C(0x00fffff8)143 #define TELEPORTERTCPHDR_MAX_SIZE UINT32_C(0x00fffff8) 144 144 145 145 … … 147 147 * Global Variables * 148 148 *******************************************************************************/ 149 static const char g_szWelcome[] = "VirtualBox- LiveMigration-1.0\n";149 static const char g_szWelcome[] = "VirtualBox-Teleporter-1.0\n"; 150 150 151 151 … … 155 155 * @returns VBox status code. 156 156 * 157 * @param pState The live migrationstate structure.157 * @param pState The teleporter state structure. 158 158 * @param pszBuf The output buffer. 159 159 * @param cchBuf The size of the output buffer. 160 160 * 161 161 */ 162 static int migrationTcpReadLine(MigrationState *pState, char *pszBuf, size_t cchBuf)162 static int teleporterTcpReadLine(TeleporterState *pState, char *pszBuf, size_t cchBuf) 163 163 { 164 164 char *pszStart = pszBuf; … … 175 175 if (RT_FAILURE(rc)) 176 176 { 177 LogRel((" Migration: RTTcpRead -> %Rrc while reading string ('%s')\n", rc, pszStart));177 LogRel(("Teleporter: RTTcpRead -> %Rrc while reading string ('%s')\n", rc, pszStart)); 178 178 return rc; 179 179 } … … 183 183 if (cchBuf <= 1) 184 184 { 185 LogRel((" Migration: String buffer overflow: '%s'\n", pszStart));185 LogRel(("Teleporter: String buffer overflow: '%s'\n", pszStart)); 186 186 return VERR_BUFFER_OVERFLOW; 187 187 } … … 197 197 * 198 198 * @returns S_OK on ACK, E_FAIL+setError() on failure or NACK. 199 * @param pState The live migrationsource state.199 * @param pState The teleporter source state. 200 200 * @param pszWhich Which ACK is this this? 201 201 * @param pszNAckMsg Optional NACK message. … … 204 204 */ 205 205 HRESULT 206 Console:: migrationSrcReadACK(MigrationStateSrc *pState, const char *pszWhich,206 Console::teleporterSrcReadACK(TeleporterStateSrc *pState, const char *pszWhich, 207 207 const char *pszNAckMsg /*= NULL*/) 208 208 { 209 209 char szMsg[128]; 210 int vrc = migrationTcpReadLine(pState, szMsg, sizeof(szMsg));210 int vrc = teleporterTcpReadLine(pState, szMsg, sizeof(szMsg)); 211 211 if (RT_FAILURE(vrc)) 212 212 return setError(E_FAIL, tr("Failed reading ACK(%s): %Rrc"), pszWhich, vrc); … … 221 221 if (pszNAckMsg) 222 222 { 223 LogRel((" Migration: %s: NACK=%Rrc (%d)\n", pszWhich, vrc2, vrc2));223 LogRel(("Teleporter: %s: NACK=%Rrc (%d)\n", pszWhich, vrc2, vrc2)); 224 224 return setError(E_FAIL, pszNAckMsg); 225 225 } … … 238 238 * @returns S_OK on ACKed command, E_FAIL+setError() on failure. 239 239 * 240 * @param pState The live migrationsource state.240 * @param pState The teleporter source state. 241 241 * @param pszCommand The command. 242 242 * … … 244 244 */ 245 245 HRESULT 246 Console:: migrationSrcSubmitCommand(MigrationStateSrc *pState, const char *pszCommand)246 Console::teleporterSrcSubmitCommand(TeleporterStateSrc *pState, const char *pszCommand) 247 247 { 248 248 size_t cchCommand = strlen(pszCommand); … … 254 254 if (RT_FAILURE(vrc)) 255 255 return setError(E_FAIL, tr("Failed writing command '%s': %Rrc"), pszCommand, vrc); 256 return migrationSrcReadACK(pState, pszCommand);256 return teleporterSrcReadACK(pState, pszCommand); 257 257 } 258 258 … … 261 261 * @copydoc SSMSTRMOPS::pfnWrite 262 262 */ 263 static DECLCALLBACK(int) migrationTcpOpWrite(void *pvUser, uint64_t offStream, const void *pvBuf, size_t cbToWrite)264 { 265 MigrationState *pState = (MigrationState *)pvUser;263 static DECLCALLBACK(int) teleporterTcpOpWrite(void *pvUser, uint64_t offStream, const void *pvBuf, size_t cbToWrite) 264 { 265 TeleporterState *pState = (TeleporterState *)pvUser; 266 266 267 267 AssertReturn(cbToWrite > 0, VINF_SUCCESS); … … 271 271 { 272 272 /* 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); 276 276 int rc = RTTcpWrite(pState->mhSocket, &Hdr, sizeof(Hdr)); 277 277 if (RT_FAILURE(rc)) 278 278 { 279 LogRel((" Migration/TCP: Header write error: %Rrc\n", rc));279 LogRel(("Teleporter/TCP: Header write error: %Rrc\n", rc)); 280 280 return rc; 281 281 } … … 285 285 if (RT_FAILURE(rc)) 286 286 { 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)); 288 288 return rc; 289 289 } … … 308 308 * @returns VBox status code. 309 309 * 310 * @param pState The migrationstate data.311 */ 312 static int migrationTcpReadSelect(MigrationState *pState)310 * @param pState The teleporter state data. 311 */ 312 static int teleporterTcpReadSelect(TeleporterState *pState) 313 313 { 314 314 int rc; … … 319 319 { 320 320 pState->mfIOError = true; 321 LogRel((" Migration/TCP: Header select error: %Rrc\n", rc));321 LogRel(("Teleporter/TCP: Header select error: %Rrc\n", rc)); 322 322 break; 323 323 } … … 335 335 * @copydoc SSMSTRMOPS::pfnRead 336 336 */ 337 static DECLCALLBACK(int) migrationTcpOpRead(void *pvUser, uint64_t offStream, void *pvBuf, size_t cbToRead, size_t *pcbRead)338 { 339 MigrationState *pState = (MigrationState *)pvUser;337 static DECLCALLBACK(int) teleporterTcpOpRead(void *pvUser, uint64_t offStream, void *pvBuf, size_t cbToRead, size_t *pcbRead) 338 { 339 TeleporterState *pState = (TeleporterState *)pvUser; 340 340 AssertReturn(!pState->mfIsSource, VERR_INVALID_HANDLE); 341 341 … … 360 360 if (!pState->mcbReadBlock) 361 361 { 362 rc = migrationTcpReadSelect(pState);362 rc = teleporterTcpReadSelect(pState); 363 363 if (RT_FAILURE(rc)) 364 364 return rc; 365 MIGRATIONTCPHDR Hdr;365 TELEPORTERTCPHDR Hdr; 366 366 rc = RTTcpRead(pState->mhSocket, &Hdr, sizeof(Hdr), NULL); 367 367 if (RT_FAILURE(rc)) 368 368 { 369 369 pState->mfIOError = true; 370 LogRel((" Migration/TCP: Header read error: %Rrc\n", rc));370 LogRel(("Teleporter/TCP: Header read error: %Rrc\n", rc)); 371 371 return rc; 372 372 } 373 if ( Hdr.u32Magic != MIGRATIONTCPHDR_MAGIC374 || Hdr.cb > MIGRATIONTCPHDR_MAX_SIZE)373 if ( Hdr.u32Magic != TELEPORTERTCPHDR_MAGIC 374 || Hdr.cb > TELEPORTERTCPHDR_MAX_SIZE) 375 375 { 376 376 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)); 378 378 return VERR_IO_GEN_FAILURE; 379 379 } … … 393 393 * Read more data. 394 394 */ 395 rc = migrationTcpReadSelect(pState);395 rc = teleporterTcpReadSelect(pState); 396 396 if (RT_FAILURE(rc)) 397 397 return rc; … … 401 401 { 402 402 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)); 404 404 return rc; 405 405 } … … 425 425 * @copydoc SSMSTRMOPS::pfnSeek 426 426 */ 427 static DECLCALLBACK(int) migrationTcpOpSeek(void *pvUser, int64_t offSeek, unsigned uMethod, uint64_t *poffActual)427 static DECLCALLBACK(int) teleporterTcpOpSeek(void *pvUser, int64_t offSeek, unsigned uMethod, uint64_t *poffActual) 428 428 { 429 429 return VERR_NOT_SUPPORTED; … … 434 434 * @copydoc SSMSTRMOPS::pfnTell 435 435 */ 436 static DECLCALLBACK(uint64_t) migrationTcpOpTell(void *pvUser)437 { 438 MigrationState *pState = (MigrationState *)pvUser;436 static DECLCALLBACK(uint64_t) teleporterTcpOpTell(void *pvUser) 437 { 438 TeleporterState *pState = (TeleporterState *)pvUser; 439 439 return pState->moffStream; 440 440 } … … 444 444 * @copydoc SSMSTRMOPS::pfnSize 445 445 */ 446 static DECLCALLBACK(int) migrationTcpOpSize(void *pvUser, uint64_t *pcb)446 static DECLCALLBACK(int) teleporterTcpOpSize(void *pvUser, uint64_t *pcb) 447 447 { 448 448 return VERR_NOT_SUPPORTED; … … 453 453 * @copydoc SSMSTRMOPS::pfnClose 454 454 */ 455 static DECLCALLBACK(int) migrationTcpOpClose(void *pvUser)456 { 457 MigrationState *pState = (MigrationState *)pvUser;455 static DECLCALLBACK(int) teleporterTcpOpClose(void *pvUser) 456 { 457 TeleporterState *pState = (TeleporterState *)pvUser; 458 458 459 459 if (pState->mfIsSource) 460 460 { 461 MIGRATIONTCPHDR EofHdr = { MIGRATIONTCPHDR_MAGIC, 0 };461 TELEPORTERTCPHDR EofHdr = { TELEPORTERTCPHDR_MAGIC, 0 }; 462 462 int rc = RTTcpWrite(pState->mhSocket, &EofHdr, sizeof(EofHdr)); 463 463 if (RT_SUCCESS(rc)) … … 465 465 if (RT_FAILURE(rc)) 466 466 { 467 LogRel((" Migration/TCP: EOF Header write error: %Rrc\n", rc));467 LogRel(("Teleporter/TCP: EOF Header write error: %Rrc\n", rc)); 468 468 return rc; 469 469 } … … 482 482 * Method table for a TCP based stream. 483 483 */ 484 static SSMSTRMOPS const g_ migrationTcpOps =484 static SSMSTRMOPS const g_teleporterTcpOps = 485 485 { 486 486 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, 493 493 SSMSTRMOPS_VERSION 494 494 }; … … 498 498 * @copydoc FNRTTIMERLR 499 499 */ 500 static DECLCALLBACK(void) migrationTimeout(RTTIMERLR hTimerLR, void *pvUser, uint64_t iTick)500 static DECLCALLBACK(void) teleporterTimeout(RTTIMERLR hTimerLR, void *pvUser, uint64_t iTick) 501 501 { 502 502 /* This is harmless for any open connections. */ … … 506 506 507 507 /** 508 * Do the live migration.508 * Do the teleporter. 509 509 * 510 510 * @returns VBox status code. 511 * @param pState The migrationstate.511 * @param pState The teleporter state. 512 512 */ 513 513 HRESULT 514 Console:: migrationSrc(MigrationStateSrc *pState)514 Console::teleporterSrc(TeleporterStateSrc *pState) 515 515 { 516 516 AutoCaller autoCaller(this); … … 518 518 519 519 /* 520 * Wait for Console:: Migrateto change the state.520 * Wait for Console::Teleport to change the state. 521 521 */ 522 522 { AutoWriteLock autoLock(); } … … 554 554 555 555 /* ACK */ 556 hrc = migrationSrcReadACK(pState, "password", tr("Invalid password"));556 hrc = teleporterSrcReadACK(pState, "password", tr("Invalid password")); 557 557 if (FAILED(hrc)) 558 558 return hrc; … … 566 566 * Start loading the state. 567 567 */ 568 hrc = migrationSrcSubmitCommand(pState, "load");568 hrc = teleporterSrcSubmitCommand(pState, "load"); 569 569 if (FAILED(hrc)) 570 570 return hrc; 571 571 572 void *pvUser = static_cast<void *>(static_cast< MigrationState *>(pState));573 vrc = VMR3 Migrate(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); 574 574 if (vrc) 575 return setError(E_FAIL, tr("VMR3 Migrate-> %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"); 578 578 if (FAILED(hrc)) 579 579 return hrc; … … 582 582 * State fun? Automatic power off? 583 583 */ 584 hrc = migrationSrcSubmitCommand(pState, "done");584 hrc = teleporterSrcSubmitCommand(pState, "done"); 585 585 if (FAILED(hrc)) 586 586 return hrc; … … 595 595 * @returns VINF_SUCCESS (ignored). 596 596 * @param hThread The thread. 597 * @param pvUser Pointer to a MigrationStateSrc instance.597 * @param pvUser Pointer to a TeleporterStateSrc instance. 598 598 */ 599 599 /*static*/ DECLCALLBACK(int) 600 Console:: migrationSrcThreadWrapper(RTTHREAD hThread, void *pvUser)601 { 602 MigrationStateSrc *pState = (MigrationStateSrc *)pvUser;600 Console::teleporterSrcThreadWrapper(RTTHREAD hThread, void *pvUser) 601 { 602 TeleporterStateSrc *pState = (TeleporterStateSrc *)pvUser; 603 603 604 604 AutoVMCaller autoVMCaller(pState->mptrConsole); … … 606 606 607 607 if (SUCCEEDED(hrc)) 608 hrc = pState->mptrConsole-> migrationSrc(pState);608 hrc = pState->mptrConsole->teleporterSrc(pState); 609 609 610 610 pState->mptrProgress->notifyComplete(hrc); … … 665 665 666 666 /** 667 * Start live migrationto the specified target.667 * Start teleporter to the specified target. 668 668 * 669 669 * @returns COM status code. … … 675 675 */ 676 676 STDMETHODIMP 677 Console:: Migrate(IN_BSTR aHostname, ULONG aPort, IN_BSTR aPassword, IProgress **aProgress)677 Console::Teleport(IN_BSTR aHostname, ULONG aPort, IN_BSTR aPassword, IProgress **aProgress) 678 678 { 679 679 /* … … 709 709 * Note! The thread won't start working until we release the lock. 710 710 */ 711 LogFlowThisFunc(("Initiating LIVE MIGRATIONrequest...\n"));712 713 ComObjPtr<Progress> ptr MigrateProgress;714 HRESULT hrc = ptr MigrateProgress.createObject();711 LogFlowThisFunc(("Initiating TELEPORTER request...\n")); 712 713 ComObjPtr<Progress> ptrTelportationProgress; 714 HRESULT hrc = ptrTelportationProgress.createObject(); 715 715 CheckComRCReturnRC(hrc); 716 hrc = ptr MigrateProgress->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*/); 719 719 CheckComRCReturnRC(hrc); 720 720 721 MigrationStateSrc *pState = new MigrationStateSrc(this, mpVM);721 TeleporterStateSrc *pState = new TeleporterStateSrc(this, mpVM); 722 722 pState->mstrPassword = aPassword; 723 723 pState->mstrHostname = aHostname; 724 724 pState->muPort = aPort; 725 pState->mptrProgress = ptr MigrateProgress;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"); 729 729 if (RT_SUCCESS(vrc)) 730 730 { 731 731 hrc = setMachineState(MachineState_Saving); 732 732 if (SUCCEEDED(hrc)) 733 ptr MigrateProgress.queryInterfaceTo(aProgress);733 ptrTelportationProgress.queryInterfaceTo(aProgress); 734 734 else 735 ptr MigrateProgress->Cancel();735 ptrTelportationProgress->Cancel(); 736 736 } 737 737 else … … 747 747 /** 748 748 * Creates a TCP server that listens for the source machine and passes control 749 * over to Console:: migrationDstServeConnection().749 * over to Console::teleporterTrgServeConnection(). 750 750 * 751 751 * @returns VBox status code. … … 758 758 */ 759 759 int 760 Console:: migrationDst(PVM pVM, IMachine *pMachine, bool fStartPaused, void *pvVMCallbackTask)760 Console::teleporterTrg(PVM pVM, IMachine *pMachine, bool fStartPaused, void *pvVMCallbackTask) 761 761 { 762 762 /* … … 764 764 */ 765 765 ULONG uPort; 766 HRESULT hrc = pMachine->COMGETTER( LiveMigrationPort)(&uPort);766 HRESULT hrc = pMachine->COMGETTER(TeleporterPort)(&uPort); 767 767 if (FAILED(hrc)) 768 768 return VERR_GENERAL_FAILURE; 769 769 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 770 777 Bstr bstrPassword; 771 hrc = pMachine->COMGETTER( LiveMigrationPassword)(bstrPassword.asOutParam());778 hrc = pMachine->COMGETTER(TeleporterPassword)(bstrPassword.asOutParam()); 772 779 if (FAILED(hrc)) 773 780 return VERR_GENERAL_FAILURE; … … 775 782 strPassword.append('\n'); /* To simplify password checking. */ 776 783 777 Utf8Str strBind("");778 /** @todo Add a bind address property. */779 const char *pszBindAddress = strBind.isEmpty() ? NULL : strBind.c_str();780 781 782 784 /* 783 785 * Create the TCP server. … … 786 788 PRTTCPSERVER hServer; 787 789 if (uPort) 788 vrc = RTTcpServerCreateEx(psz BindAddress, uPort, &hServer);790 vrc = RTTcpServerCreateEx(pszAddress, uPort, &hServer); 789 791 else 790 792 { … … 792 794 { 793 795 uPort = RTRandU32Ex(cTries >= 8192 ? 49152 : 1024, 65534); 794 vrc = RTTcpServerCreateEx(psz BindAddress, uPort, &hServer);796 vrc = RTTcpServerCreateEx(pszAddress, uPort, &hServer); 795 797 if (vrc != VERR_NET_ADDRESS_IN_USE) 796 798 break; … … 798 800 if (RT_SUCCESS(vrc)) 799 801 { 800 HRESULT hrc = pMachine->COMSETTER( LiveMigrationPort)(uPort);802 HRESULT hrc = pMachine->COMSETTER(TeleporterPort)(uPort); 801 803 if (FAILED(hrc)) 802 804 { … … 804 806 return VERR_GENERAL_FAILURE; 805 807 } 808 /** @todo Should undo this upon return. */ 806 809 } 807 810 } … … 813 816 */ 814 817 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); 816 819 if (RT_SUCCESS(vrc)) 817 820 { … … 822 825 * Do the job, when it returns we're done. 823 826 */ 824 MigrationStateDstState(this, pVM, pMachine, &hTimerLR);827 TeleporterStateTrg State(this, pVM, pMachine, &hTimerLR); 825 828 State.mstrPassword = strPassword; 826 829 State.mhServer = hServer; 827 830 State.mpvVMCallbackTask = pvVMCallbackTask; 828 831 829 vrc = RTTcpServerListen(hServer, Console:: migrationDstServeConnection, &State);832 vrc = RTTcpServerListen(hServer, Console::teleporterTrgServeConnection, &State); 830 833 if (vrc == VERR_TCP_SERVER_STOP) 831 834 vrc = State.mRc; … … 839 842 else 840 843 { 841 LogRel((" Migration: RTTcpServerListen -> %Rrc\n", vrc));844 LogRel(("Teleporter: RTTcpServerListen -> %Rrc\n", vrc)); 842 845 } 843 846 } … … 851 854 852 855 853 static int migrationTcpWriteACK(MigrationStateDst*pState)856 static int teleporterTcpWriteACK(TeleporterStateTrg *pState) 854 857 { 855 858 int rc = RTTcpWrite(pState->mhSocket, "ACK\n", sizeof("ACK\n") - 1); 856 859 if (RT_FAILURE(rc)) 857 LogRel((" Migration: RTTcpWrite(,ACK,) -> %Rrc\n", rc));860 LogRel(("Teleporter: RTTcpWrite(,ACK,) -> %Rrc\n", rc)); 858 861 RTTcpFlush(pState->mhSocket); 859 862 return rc; … … 861 864 862 865 863 static int migrationTcpWriteNACK(MigrationStateDst*pState, int32_t rc2)866 static int teleporterTcpWriteNACK(TeleporterStateTrg *pState, int32_t rc2) 864 867 { 865 868 char szMsg[64]; … … 867 870 int rc = RTTcpWrite(pState->mhSocket, szMsg, cch); 868 871 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)); 870 873 RTTcpFlush(pState->mhSocket); 871 874 return rc; … … 877 880 */ 878 881 /*static*/ DECLCALLBACK(int) 879 Console:: migrationDstServeConnection(RTSOCKET Sock, void *pvUser)880 { 881 MigrationStateDst *pState = (MigrationStateDst*)pvUser;882 Console::teleporterTrgServeConnection(RTSOCKET Sock, void *pvUser) 883 { 884 TeleporterStateTrg *pState = (TeleporterStateTrg *)pvUser; 882 885 pState->mhSocket = Sock; 883 886 … … 888 891 if (RT_FAILURE(vrc)) 889 892 { 890 LogRel((" Migration: Failed to write welcome message: %Rrc\n", vrc));893 LogRel(("Teleporter: Failed to write welcome message: %Rrc\n", vrc)); 891 894 return VINF_SUCCESS; 892 895 } 893 896 894 897 /* 895 * Password (includes '\n', see migrationDst). If it's right, tell898 * Password (includes '\n', see teleporterTrg). If it's right, tell 896 899 * the TCP server to stop listening (frees up host resources and makes sure 897 900 * this is the last connection attempt). … … 907 910 { 908 911 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)); 910 913 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); 913 916 return VINF_SUCCESS; 914 917 } 915 918 off++; 916 919 } 917 vrc = migrationTcpWriteACK(pState);920 vrc = teleporterTcpWriteACK(pState); 918 921 if (RT_FAILURE(vrc)) 919 922 return vrc; … … 929 932 { 930 933 char szCmd[128]; 931 vrc = migrationTcpReadLine(pState, szCmd, sizeof(szCmd));934 vrc = teleporterTcpReadLine(pState, szCmd, sizeof(szCmd)); 932 935 if (RT_FAILURE(vrc)) 933 936 break; … … 935 938 if (!strcmp(szCmd, "load")) 936 939 { 937 vrc = migrationTcpWriteACK(pState);940 vrc = teleporterTcpWriteACK(pState); 938 941 if (RT_FAILURE(vrc)) 939 942 break; 940 943 941 944 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, 944 947 Console::stateProgressCallback, pState->mpvVMCallbackTask); 945 948 if (RT_FAILURE(vrc)) 946 949 { 947 LogRel((" Migration: VMR3LoadFromStream -> %Rrc\n", vrc));948 migrationTcpWriteNACK(pState, vrc);950 LogRel(("Teleporter: VMR3LoadFromStream -> %Rrc\n", vrc)); 951 teleporterTcpWriteNACK(pState, vrc); 949 952 break; 950 953 } … … 953 956 pState->mfStopReading = false; 954 957 size_t cbRead; 955 vrc = migrationTcpOpRead(pvUser, pState->moffStream, szCmd, 1, &cbRead);958 vrc = teleporterTcpOpRead(pvUser, pState->moffStream, szCmd, 1, &cbRead); 956 959 if (vrc != VERR_EOF) 957 960 { 958 LogRel((" Migration: Draining migrationTcpOpRead -> %Rrc\n", vrc));959 migrationTcpWriteNACK(pState, vrc);961 LogRel(("Teleporter: Draining teleporterTcpOpRead -> %Rrc\n", vrc)); 962 teleporterTcpWriteNACK(pState, vrc); 960 963 break; 961 964 } 962 965 963 vrc = migrationTcpWriteACK(pState);966 vrc = teleporterTcpWriteACK(pState); 964 967 if (RT_FAILURE(vrc)) 965 968 break; … … 969 972 else if (!strcmp(szCmd, "done")) 970 973 { 971 vrc = migrationTcpWriteACK(pState);974 vrc = teleporterTcpWriteACK(pState); 972 975 break; 973 976 } 974 977 else 975 978 { 976 LogRel((" Migration: Unknown command '%s' (%.*Rhxs)\n", szCmd, strlen(szCmd), szCmd));979 LogRel(("Teleporter: Unknown command '%s' (%.*Rhxs)\n", szCmd, strlen(szCmd), szCmd)); 977 980 vrc = VERR_NOT_IMPLEMENTED; 978 migrationTcpWriteNACK(pState, vrc);981 teleporterTcpWriteNACK(pState, vrc); 979 982 break; 980 983 } -
trunk/src/VBox/Main/Global.cpp
r23703 r23801 197 197 case MachineState_Saving: return "Saving"; 198 198 case MachineState_Restoring: return "Restoring"; 199 case MachineState_ MigratingFrom:return "MigratingFrom";199 case MachineState_TeleportingFrom: return "TeleportingFrom"; 200 200 case MachineState_Discarding: return "Discarding"; 201 201 case MachineState_SettingUp: return "SettingUp"; -
trunk/src/VBox/Main/MachineImpl.cpp
r23791 r23801 155 155 156 156 mNameSync = TRUE; 157 m LiveMigrationTarget= FALSE;158 m LiveMigrationPort = 0;157 mTeleporterEnabled = FALSE; 158 mTeleporterPort = 0; 159 159 160 160 /* mName, mOSTypeId, mSnapshotFolder, mSnapshotFolderFull are initialized in … … 1857 1857 1858 1858 STDMETHODIMP 1859 Machine::COMGETTER( LiveMigrationTarget)(BOOL *aEnabled)1859 Machine::COMGETTER(TeleporterEnabled)(BOOL *aEnabled) 1860 1860 { 1861 1861 CheckComArgOutPointerValid(aEnabled); … … 1866 1866 AutoReadLock alock(this); 1867 1867 1868 *aEnabled = mUserData->m LiveMigrationTarget;1868 *aEnabled = mUserData->mTeleporterEnabled; 1869 1869 1870 1870 return S_OK; … … 1872 1872 1873 1873 STDMETHODIMP 1874 Machine::COMSETTER( LiveMigrationTarget)(BOOL aEnabled)1874 Machine::COMSETTER(TeleporterEnabled)(BOOL aEnabled) 1875 1875 { 1876 1876 AutoCaller autoCaller(this); … … 1893 1893 1894 1894 mUserData.backup(); 1895 mUserData->m LiveMigrationTarget= aEnabled;1895 mUserData->mTeleporterEnabled = aEnabled; 1896 1896 1897 1897 return S_OK; … … 1899 1899 1900 1900 STDMETHODIMP 1901 Machine::COMGETTER( LiveMigrationPort)(ULONG *aPort)1901 Machine::COMGETTER(TeleporterPort)(ULONG *aPort) 1902 1902 { 1903 1903 CheckComArgOutPointerValid(aPort); … … 1908 1908 AutoReadLock alock(this); 1909 1909 1910 *aPort = mUserData->m LiveMigrationPort;1910 *aPort = mUserData->mTeleporterPort; 1911 1911 1912 1912 return S_OK; … … 1914 1914 1915 1915 STDMETHODIMP 1916 Machine::COMSETTER( LiveMigrationPort)(ULONG aPort)1916 Machine::COMSETTER(TeleporterPort)(ULONG aPort) 1917 1917 { 1918 1918 if (aPort >= _64K) … … 1928 1928 1929 1929 mUserData.backup(); 1930 mUserData->m LiveMigrationPort = aPort;1930 mUserData->mTeleporterPort = aPort; 1931 1931 1932 1932 return S_OK; … … 1934 1934 1935 1935 STDMETHODIMP 1936 Machine::COMGETTER( LiveMigrationPassword)(BSTR *aPassword)1937 { 1938 CheckComArgOutPointerValid(a Password);1936 Machine::COMGETTER(TeleporterAddress)(BSTR *aAddress) 1937 { 1938 CheckComArgOutPointerValid(aAddress); 1939 1939 1940 1940 AutoCaller autoCaller(this); … … 1943 1943 AutoReadLock alock(this); 1944 1944 1945 mUserData->m LiveMigrationPassword.cloneTo(aPassword);1945 mUserData->mTeleporterAddress.cloneTo(aAddress); 1946 1946 1947 1947 return S_OK; … … 1949 1949 1950 1950 STDMETHODIMP 1951 Machine::COMSETTER( LiveMigrationPassword)(IN_BSTR aPassword)1951 Machine::COMSETTER(TeleporterAddress)(IN_BSTR aAddress) 1952 1952 { 1953 1953 AutoCaller autoCaller(this); … … 1960 1960 1961 1961 mUserData.backup(); 1962 mUserData->mLiveMigrationPassword = aPassword; 1962 mUserData->mTeleporterAddress = aAddress; 1963 1964 return S_OK; 1965 } 1966 1967 STDMETHODIMP 1968 Machine::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 1982 STDMETHODIMP 1983 Machine::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; 1963 1995 1964 1996 return S_OK; … … 5044 5076 mData->mLastStateChange = mData->m_pMachineConfigFile->timeLastStateChange; 5045 5077 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; 5050 5083 5051 5084 /* … … 6041 6074 mData->m_pMachineConfigFile->fAborted = (mData->mMachineState == MachineState_Aborted); 6042 6075 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; 6046 6080 6047 6081 rc = saveHardware(mData->m_pMachineConfigFile->hardwareMachine); … … 9284 9318 case MachineState_Starting: 9285 9319 case MachineState_Restoring: 9286 case MachineState_ MigratingFrom:9320 case MachineState_TeleportingFrom: 9287 9321 case MachineState_Paused: 9288 9322 case MachineState_Running: … … 10160 10194 AssertReturn( mData->mMachineState == MachineState_Starting 10161 10195 || mData->mMachineState == MachineState_Restoring 10162 || mData->mMachineState == MachineState_ MigratingFrom, E_FAIL);10196 || mData->mMachineState == MachineState_TeleportingFrom, E_FAIL); 10163 10197 10164 10198 typedef std::list <ComPtr<IMedium> > MediaList; … … 10348 10382 && aMachineState == MachineState_Restoring) 10349 10383 || ( oldMachineState == MachineState_PoweredOff 10350 && aMachineState == MachineState_ MigratingFrom)10384 && aMachineState == MachineState_TeleportingFrom) 10351 10385 || ( oldMachineState < MachineState_Running /* any other OFF state */ 10352 10386 && aMachineState == MachineState_Starting) … … 10420 10454 if ( aMachineState == MachineState_Starting 10421 10455 || aMachineState == MachineState_Restoring 10422 || aMachineState == MachineState_ MigratingFrom10456 || aMachineState == MachineState_TeleportingFrom 10423 10457 ) 10424 10458 { -
trunk/src/VBox/Main/Makefile.kmk
r23742 r23801 462 462 463 463 464 if defined(VBOX_WITH_CROGL) || defined(VBOX_WITH_VIDEOHWACCEL) 464 if defined(VBOX_WITH_CROGL) || defined(VBOX_WITH_VIDEOHWACCEL) 465 465 ifneq ($(KBUILD_TARGET),darwin) 466 466 # … … 613 613 ConsoleImpl.cpp \ 614 614 ConsoleImpl2.cpp \ 615 ConsoleImpl -LiveMigration.cpp \615 ConsoleImplTeleporter.cpp \ 616 616 ConsoleVRDPServer.cpp \ 617 617 GuestImpl.cpp \ -
trunk/src/VBox/Main/cbinding/tstXPCOMCCall.c
r23703 r23801 84 84 case MachineState_Saving: return "Saving"; 85 85 case MachineState_Restoring: return "Restoring"; 86 case MachineState_ MigratingFrom: return "MigratingFrom";86 case MachineState_TeleportingFrom: return "TeleportingFrom"; 87 87 case MachineState_Discarding: return "Discarding"; 88 88 case MachineState_SettingUp: return "SettingUp"; -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r23791 r23801 473 473 <enum 474 474 name="MachineState" 475 uuid=" f532545d-9ae7-4402-8b5f-1ea7d778cfc7"475 uuid="0f4cc50c-e1cc-4cde-ae7a-e6164bac5ba2" 476 476 > 477 477 <desc> … … 673 673 </desc> 674 674 </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. 678 678 </desc> 679 679 </const> … … 778 778 <desc> 779 779 This setting determines whether VirtualBox will expose a synthetic CPU to the guest to allow 780 live migrationbetween host systems that differ significantly.780 teleporting between host systems that differ significantly. 781 781 </desc> 782 782 </const> … … 4072 4072 <interface 4073 4073 name="IMachine" extends="$unknown" 4074 uuid=" e8e1c6a9-679e-4a73-a1e5-d9a81027fbda"4074 uuid="d867a463-0f78-4ec7-a876-8da001464537" 4075 4075 wsmap="managed" 4076 4076 > … … 4528 4528 </attribute> 4529 4529 4530 <attribute name=" liveMigrationTarget" type="boolean">4531 <desc> 4532 When set to @a true, the virtual machine becomes a live migration4533 t arget. This can only set to @a true when the VM is in the @a4534 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. 4535 4535 4536 4536 This property is automatically set to @a false when the VM is powered … … 4539 4539 </attribute> 4540 4540 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. 4555 4564 </desc> 4556 4565 </attribute> … … 6079 6088 <interface 6080 6089 name="IConsole" extends="$unknown" 6081 uuid=" c47486e1-3d99-4212-b1c5-86451978999d"6090 uuid="03312360-0364-4b7a-ad71-1a8450133774" 6082 6091 wsmap="managed" 6083 6092 > … … 6817 6826 </method> 6818 6827 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. 6822 6831 6823 6832 TODO explain the details. … … 6828 6837 </desc> 6829 6838 <param name="hostname" type="wstring" dir="in"> 6830 <desc>The name or IP of the host to migrateto.</desc>6839 <desc>The name or IP of the host to teleport to.</desc> 6831 6840 </param> 6832 6841 <param name="tcpport" type="unsigned long" dir="in"> -
trunk/src/VBox/Main/include/ConsoleImpl.h
r23720 r23801 34 34 class Display; 35 35 class MachineDebugger; 36 class MigrationStateSrc;36 class TeleporterStateSrc; 37 37 class OUSBDevice; 38 38 class RemoteUSBDevice; … … 148 148 STDMETHOD(DiscardCurrentState) (IProgress **aProgress); 149 149 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); 151 151 STDMETHOD(RegisterCallback) (IConsoleCallback *aCallback); 152 152 STDMETHOD(UnregisterCallback)(IConsoleCallback *aCallback); … … 517 517 #endif 518 518 519 /** @name Live migrationsupport519 /** @name Teleporter support 520 520 * @{ */ 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); 527 527 /** @} */ 528 528 … … 632 632 }; 633 633 634 #endif // ____H_CONSOLEIMPL634 #endif // !____H_CONSOLEIMPL 635 635 /* vi: set tabstop=4 shiftwidth=4 expandtab: */ -
trunk/src/VBox/Main/include/MachineImpl.h
r23750 r23801 228 228 bool operator==(const UserData &that) const 229 229 { 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); 239 240 } 240 241 … … 245 246 Bstr mSnapshotFolder; 246 247 Bstr mSnapshotFolderFull; 247 BOOL mLiveMigrationTarget; 248 ULONG mLiveMigrationPort; 249 Bstr mLiveMigrationPassword; 248 BOOL mTeleporterEnabled; 249 ULONG mTeleporterPort; 250 Bstr mTeleporterAddress; 251 Bstr mTeleporterPassword; 250 252 }; 251 253 … … 560 562 STDMETHOD(COMSETTER(GuestPropertyNotificationPatterns))(IN_BSTR aPattern); 561 563 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); 568 572 569 573 // IMachine methods -
trunk/src/VBox/Main/xml/Settings.cpp
r23795 r23801 2203 2203 // constructor has called RTTimeNow(&timeLastStateChange) before 2204 2204 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 = ""; 2211 2216 2212 2217 // parse Hardware before the other elements because other things depend on it … … 2273 2278 : ConfigFileBase(pstrFilename), 2274 2279 fNameSync(true), 2275 f LiveMigrationTarget(false),2276 u LiveMigrationPort(0),2280 fTeleporterEnabled(false), 2281 uTeleporterPort(0), 2277 2282 fCurrentStateModified(true), 2278 2283 fAborted(false) … … 2873 2878 } 2874 2879 2875 #ifdef VBOX_WITH_LIVE_MIGRATION2876 2880 if ( m->sv < SettingsVersion_v1_9 2877 && ( fLiveMigrationTarget 2878 || uLiveMigrationPort 2879 || !strLiveMigrationPassword.isEmpty() 2881 && ( fTeleporterEnabled 2882 || uTeleporterPort 2883 || !strTeleporterAddress.isEmpty() 2884 || !strTeleporterPassword.isEmpty() 2880 2885 ) 2881 2886 ) 2882 2887 m->sv = SettingsVersion_v1_9; 2883 #endif2884 2888 } 2885 2889 … … 2921 2925 if (fAborted) 2922 2926 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. */ 2924 2928 if (m->sv >= SettingsVersion_v1_9) 2925 2929 { 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); 2932 2938 } 2933 2939 #endif
Note:
See TracChangeset
for help on using the changeset viewer.