Changeset 61610 in vbox
- Timestamp:
- Jun 9, 2016 10:22:42 AM (9 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/ConsoleImpl.h
r59787 r61610 336 336 337 337 void notifyNatDnsChange(PUVM pUVM, const char *pszDevice, ULONG ulInstanceMax); 338 Utf8Str VRDPServerErrorToMsg(int vrc); 338 339 339 340 /** -
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r61536 r61610 5173 5173 5174 5174 /** 5175 * Check the return code of mConsoleVRDPServer->Launch. LogRel() the error reason and 5176 * return an error message appropriate for setError(). 5177 */ 5178 Utf8Str Console::VRDPServerErrorToMsg(int vrc) 5179 { 5180 Utf8Str errMsg; 5181 if (vrc == VERR_NET_ADDRESS_IN_USE) 5182 { 5183 Bstr bstr; 5184 mVRDEServer->GetVRDEProperty(Bstr("TCP/Ports").raw(), bstr.asOutParam()); 5185 errMsg = Utf8StrFmt(tr("VirtualBox Remote Desktop Extension server can't bind to the port(s): %s"), 5186 Utf8Str(bstr).c_str()); 5187 LogRel(("VRDE: Warning: failed to launch VRDE server (%Rrc): '%s'\n", vrc, errMsg.c_str())); 5188 } 5189 else if (vrc == VINF_NOT_SUPPORTED) 5190 { 5191 /* This means that the VRDE is not installed. */ 5192 LogRel(("VRDE: VirtualBox Remote Desktop Extension is not available.\n")); 5193 errMsg = Utf8Str("VirtualBox Remote Desktop Extension is not available"); 5194 } 5195 else if (RT_FAILURE(vrc)) 5196 { 5197 /* Fail if the server is installed but can't start. */ 5198 switch (vrc) 5199 { 5200 case VERR_FILE_NOT_FOUND: 5201 errMsg = Utf8StrFmt(tr("Could not find the VirtualBox Remote Desktop Extension library.")); 5202 break; 5203 default: 5204 errMsg = Utf8StrFmt(tr("Failed to launch the Remote Desktop Extension server (%Rrc)"), vrc); 5205 break; 5206 } 5207 LogRel(("VRDE: Failed: (%Rrc): %s\n", vrc, errMsg.c_str())); 5208 } 5209 5210 return errMsg; 5211 } 5212 5213 /** 5175 5214 * Called by IInternalSessionControl::OnVRDEServerChange(). 5176 5215 * … … 5225 5264 5226 5265 int vrc = mConsoleVRDPServer->Launch(); 5227 if (RT_FAILURE(vrc))5228 rc = setError(E_FAIL,5229 tr("Could not start the VRDP server (%Rrc)"), vrc);5266 Utf8Str errMsg = VRDPServerErrorToMsg(vrc); 5267 if (vrc != VINF_SUCCESS) 5268 rc = setError(E_FAIL, errMsg.c_str()); 5230 5269 else 5231 5270 mConsoleVRDPServer->EnableConnections(); … … 5254 5293 } 5255 5294 5295 LogRel(("RETURN %Rhrc\n", rc)); 5256 5296 return rc; 5257 5297 } … … 9558 9598 alock.acquire(); 9559 9599 9560 if (vrc == VERR_NET_ADDRESS_IN_USE) 9561 { 9562 Utf8Str errMsg; 9563 Bstr bstr; 9564 pConsole->mVRDEServer->GetVRDEProperty(Bstr("TCP/Ports").raw(), bstr.asOutParam()); 9565 Utf8Str ports = bstr; 9566 errMsg = Utf8StrFmt(tr("VirtualBox Remote Desktop Extension server can't bind to the port: %s"), 9567 ports.c_str()); 9568 LogRel(("VRDE: Warning: failed to launch VRDE server (%Rrc): '%s'\n", 9569 vrc, errMsg.c_str())); 9570 } 9571 else if (vrc == VINF_NOT_SUPPORTED) 9572 { 9573 /* This means that the VRDE is not installed. */ 9574 LogRel(("VRDE: VirtualBox Remote Desktop Extension is not available.\n")); 9575 } 9576 else if (RT_FAILURE(vrc)) 9577 { 9578 /* Fail, if the server is installed but can't start. */ 9579 Utf8Str errMsg; 9580 switch (vrc) 9581 { 9582 case VERR_FILE_NOT_FOUND: 9583 { 9584 /* VRDE library file is missing. */ 9585 errMsg = Utf8StrFmt(tr("Could not find the VirtualBox Remote Desktop Extension library.")); 9586 break; 9587 } 9588 default: 9589 errMsg = Utf8StrFmt(tr("Failed to launch Remote Desktop Extension server (%Rrc)"), 9590 vrc); 9591 } 9592 LogRel(("VRDE: Failed: (%Rrc), error message: '%s'\n", 9593 vrc, errMsg.c_str())); 9600 Utf8Str errMsg = pConsole->VRDPServerErrorToMsg(vrc); 9601 if ( RT_FAILURE(vrc) 9602 && vrc != VERR_NET_ADDRESS_IN_USE) /* this is not fatal */ 9594 9603 throw i_setErrorStatic(E_FAIL, errMsg.c_str()); 9595 }9596 9604 9597 9605 ComPtr<IMachine> pMachine = pConsole->i_machine(); … … 9855 9863 */ 9856 9864 AssertMsgFailed(("Missing error message during powerup for status code %Rrc\n", vrc)); 9857 task->mErrorMsg = Utf8StrFmt(tr("Failed to start VM execution (%Rrc)"), 9858 vrc); 9865 task->mErrorMsg = Utf8StrFmt(tr("Failed to start VM execution (%Rrc)"), vrc); 9859 9866 } 9860 9867
Note:
See TracChangeset
for help on using the changeset viewer.