Changeset 29927 in vbox
- Timestamp:
- May 31, 2010 6:40:56 PM (14 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
-
ConsoleImpl.cpp (modified) (1 diff)
-
ConsoleImplTeleporter.cpp (modified) (4 diffs)
-
idl/VirtualBox.xidl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ConsoleImpl.cpp
r29864 r29927 5230 5230 else 5231 5231 progressDesc = tr("Starting virtual machine"); 5232 rc = powerupProgress->init(static_cast<IConsole *>(this), 5233 progressDesc, 5234 fTeleporterEnabled /* aCancelable */); 5232 if (mMachineState == MachineState_Saved || !fTeleporterEnabled) 5233 rc = powerupProgress->init(static_cast<IConsole *>(this), 5234 progressDesc, 5235 FALSE /* aCancelable */); 5236 else 5237 rc = powerupProgress->init(static_cast<IConsole *>(this), 5238 progressDesc, 5239 TRUE /* aCancelable */, 5240 3 /* cOperations */, 5241 10 /* ulTotalOperationsWeight */, 5242 Bstr(tr("Teleporting virtual machine")), 5243 1 /* ulFirstOperationWeight */, 5244 NULL); 5235 5245 if (FAILED(rc)) 5236 5246 return rc; -
trunk/src/VBox/Main/ConsoleImplTeleporter.cpp
r29882 r29927 1060 1060 theState.mhServer = hServer; 1061 1061 1062 bool fPowerOff ;1062 bool fPowerOff = true; 1063 1063 void *pvUser = static_cast<void *>(static_cast<TeleporterState *>(&theState)); 1064 1064 if (pProgress->setCancelCallback(teleporterProgressCancelCallback, pvUser)) 1065 1065 { 1066 1066 LogRel(("Teleporter: Waiting for incoming VM...\n")); 1067 vrc = RTTcpServerListen(hServer, Console::teleporterTrgServeConnection, &theState); 1068 pProgress->setCancelCallback(NULL, NULL); 1069 1070 fPowerOff = false; 1071 if (vrc == VERR_TCP_SERVER_STOP) 1067 hrc = pProgress->SetNextOperation(Bstr(tr("Waiting for incoming VM")), 1); 1068 if (SUCCEEDED(hrc)) 1072 1069 { 1073 vrc = theState.mRc;1074 /* Power off the VM on failure unless the state callback1075 already did that. */ 1076 if ( RT_FAILURE(vrc))1070 vrc = RTTcpServerListen(hServer, Console::teleporterTrgServeConnection, &theState); 1071 pProgress->setCancelCallback(NULL, NULL); 1072 1073 if (vrc == VERR_TCP_SERVER_STOP) 1077 1074 { 1078 VMSTATE enmVMState = VMR3GetState(pVM); 1079 if ( enmVMState != VMSTATE_OFF 1080 && enmVMState != VMSTATE_POWERING_OFF) 1081 fPowerOff = true; 1075 vrc = theState.mRc; 1076 /* Power off the VM on failure unless the state callback 1077 already did that. */ 1078 fPowerOff = false; 1079 if (RT_FAILURE(vrc)) 1080 { 1081 VMSTATE enmVMState = VMR3GetState(pVM); 1082 if ( enmVMState != VMSTATE_OFF 1083 && enmVMState != VMSTATE_POWERING_OFF) 1084 fPowerOff = true; 1085 } 1082 1086 } 1083 } 1084 else if (vrc == VERR_TCP_SERVER_SHUTDOWN) 1085 { 1086 BOOL fCancelled = TRUE; 1087 hrc = pProgress->COMGETTER(Canceled)(&fCancelled); 1088 if (FAILED(hrc) || fCancelled) 1087 else if (vrc == VERR_TCP_SERVER_SHUTDOWN) 1089 1088 { 1090 setError(E_FAIL, tr("Teleporting canceled")); 1091 vrc = VERR_SSM_CANCELLED; 1089 BOOL fCancelled = TRUE; 1090 hrc = pProgress->COMGETTER(Canceled)(&fCancelled); 1091 if (FAILED(hrc) || fCancelled) 1092 { 1093 setError(E_FAIL, tr("Teleporting canceled")); 1094 vrc = VERR_SSM_CANCELLED; 1095 } 1096 else 1097 { 1098 setError(E_FAIL, tr("Teleporter timed out waiting for incoming connection")); 1099 vrc = VERR_TIMEOUT; 1100 } 1101 LogRel(("Teleporter: RTTcpServerListen aborted - %Rrc\n", vrc)); 1092 1102 } 1093 1103 else 1094 1104 { 1095 setError(E_FAIL, tr("Teleporter timed out waiting for incoming connection"));1096 vrc = VERR_ TIMEOUT;1105 LogRel(("Teleporter: Unexpected RTTcpServerListen rc: %Rrc\n", vrc)); 1106 vrc = VERR_IPE_UNEXPECTED_STATUS; 1097 1107 } 1098 LogRel(("Teleporter: RTTcpServerListen aborted - %Rrc\n", vrc));1099 fPowerOff = true;1100 1108 } 1101 1109 else 1102 1110 { 1103 LogRel(("Teleporter: Unexpected RTTcpServerListen rc: %Rrc\n", vrc)); 1104 vrc = VERR_IPE_UNEXPECTED_STATUS; 1105 fPowerOff = true; 1111 LogThisFunc(("SetNextOperation failed, %Rhrc\n", hrc)); 1112 vrc = Global::vboxStatusCodeFromCOM(hrc); 1106 1113 } 1107 1114 } … … 1110 1117 LogThisFunc(("Canceled - check point #1\n")); 1111 1118 vrc = VERR_SSM_CANCELLED; 1112 fPowerOff = true;1113 1119 } 1114 1120 … … 1229 1235 if (RT_FAILURE(vrc)) 1230 1236 return VINF_SUCCESS; 1231 LogRel(("Teleporter: Incoming VM!\n")); 1237 1238 /* 1239 * Update the progress bar, with peer name if available. 1240 */ 1241 HRESULT hrc; 1242 RTNETADDR Addr; 1243 vrc = RTTcpGetPeerAddress(Sock, &Addr); 1244 if (RT_SUCCESS(vrc)) 1245 { 1246 LogRel(("Teleporter: Incoming VM from %RTnaddr!\n", &Addr)); 1247 hrc = pState->mptrProgress->SetNextOperation(Bstr(Utf8StrFmt(tr("Teleporting VM from %RTnaddr"), &Addr)), 8); 1248 } 1249 else 1250 { 1251 LogRel(("Teleporter: Incoming VM!\n")); 1252 hrc = pState->mptrProgress->SetNextOperation(Bstr(tr("Teleporting VM")), 8); 1253 } 1254 AssertMsg(SUCCEEDED(hrc) || hrc == E_FAIL, ("%Rhrc\n", hrc)); 1232 1255 1233 1256 /* … … 1292 1315 else if (!strcmp(szCmd, "lock-media")) 1293 1316 { 1294 HRESULThrc = pState->mpControl->LockMedia();1317 hrc = pState->mpControl->LockMedia(); 1295 1318 if (SUCCEEDED(hrc)) 1296 1319 { -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r29909 r29927 6851 6851 been saved. 6852 6852 6853 If the machine <link to="IMachine::teleporterEnabled"/> property is 6854 enabled on the machine being powered up, the machine will wait for an 6855 incoming teleportation in the <link to="MachineState_TeleportingIn"/> 6856 state. The returned progress object will have at least three 6857 operations where the last three are defined as: (1) powering up and 6858 starting TCP server, (2) waiting for incoming teleportations, and 6859 (3) perform teleportation. These operations will be reflected as the 6860 last three operations of the progress objected returned by 6861 <link to="IVirtualBox::openRemoteSession"/> as well. 6862 6853 6863 <note> 6854 6864 Unless you are trying to write a new VirtualBox front-end that
Note:
See TracChangeset
for help on using the changeset viewer.

