Changeset 2396 in vbox for trunk/src/VBox
- Timestamp:
- Apr 27, 2007 12:54:06 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ConsoleImpl.cpp
r2393 r2396 5647 5647 pszArgs, strerror(iErr))); 5648 5648 LogFlowThisFunc(("rc=E_FAIL\n")); 5649 return setError(E_FAIL, "Failed to start the TAP interface setup script %s, error text: %s\n",5649 return setError(E_FAIL, tr ("Failed to run the host networking set up command %s: %s"), 5650 5650 pszArgs, strerror(iErr)); 5651 5651 } … … 5659 5659 Log(("The TAP interface setup script did not return the name of a TAP device.\n")); 5660 5660 LogFlowThisFunc(("rc=E_FAIL\n")); 5661 return setError(E_FAIL, "The TAP interface setup script did not return the name of a TAP device.\n");5661 return setError(E_FAIL, tr ("The host networking set up command did not supply an interface name")); 5662 5662 } 5663 5663 acBuffer[cBufSize - 1] = 0; … … 5668 5668 Log(("The TAP interface setup script terminated abnormally.\n")); 5669 5669 LogFlowThisFunc(("rc=E_FAIL\n")); 5670 return setError(E_FAIL, "The TAP interface setup script terminated abnormally.\n");5670 return setError(E_FAIL, tr ("The host networking set up command did not run correctly")); 5671 5671 } 5672 5672 if (WEXITSTATUS(rc) != 0) … … 5674 5674 Log(("The TAP interface setup script returned a non-zero exit code.\n")); 5675 5675 LogFlowThisFunc(("rc=E_FAIL\n")); 5676 return setError(E_FAIL, "The TAP interface setup script returned a non-zero exit code.\n");5676 return setError(E_FAIL, tr ("The host networking set up command returned a non-zero exit code")); 5677 5677 } 5678 5678 LogFlowThisFunc(("rc=S_OK\n")); … … 5760 5760 { 5761 5761 Log(("No setup application was supplied for the TAP interface.\n")); 5762 rc = setError(E_FAIL, "No setup application was supplied for the TAP interface.\n");5762 rc = setError(E_FAIL, tr ("No setup application was supplied for the host networking interface")); 5763 5763 } 5764 5764 else … … 5804 5804 AssertMsgFailed(("Configuration error: Failed to configure /dev/net/tun non blocking. errno=%d\n", errno)); 5805 5805 rcVBox = VERR_HOSTIF_BLOCKING; 5806 rc = setError(E_FAIL, "Failed to set /dev/net/tun to non blocking. errno=%d\n", errno); 5806 rc = setError(E_FAIL, tr ("could not set up the host networking device for non blocking access: %s"), 5807 strerror(errno)); 5807 5808 } 5808 5809 } … … 5811 5812 AssertMsgFailed(("Configuration error: Failed to configure /dev/net/tun. errno=%d\n", errno)); 5812 5813 rcVBox = VERR_HOSTIF_IOCTL; 5813 rc = setError(E_FAIL, "Failed to configure /dev/net/tun. errno = %d\n", errno); 5814 rc = setError(E_FAIL, tr ("Could not set up the host networking device: %s"), 5815 strerror(errno)); 5814 5816 } 5815 5817 } … … 5825 5827 break; 5826 5828 default: 5827 rc = setError(E_FAIL, "Failed to open /dev/net/tun rc = %Vrc\n", rcVBox);5829 rc = setError(E_FAIL, tr ("Could not set up the host networking device: %Vrc"), rcVBox); 5828 5830 break; 5829 5831 } … … 5846 5848 return rc; 5847 5849 } 5848 5849 #if 05850 /* Old code for this function. */5851 HRESULT Console::detachFromHostInterface(INetworkAdapter *networkAdapter)5852 {5853 /* sanity check */5854 AssertReturn (isLockedOnCurrentThread(), E_FAIL);5855 5856 HRESULT rc = S_OK;5857 #ifdef DEBUG5858 /* paranoia */5859 NetworkAttachmentType_T attachment;5860 networkAdapter->COMGETTER(AttachmentType)(&attachment);5861 Assert(attachment == NetworkAttachmentType_HostInterfaceNetworkAttachment);5862 #endif /* DEBUG */5863 5864 #ifdef VBOX_WITH_UNIXY_TAP_NETWORKING5865 5866 ULONG slot = 0;5867 rc = networkAdapter->COMGETTER(Slot)(&slot);5868 AssertComRC(rc);5869 5870 /* is there an open TAP device? */5871 if (maTapFD[slot] != NIL_RTFILE)5872 {5873 /*5874 * Execute term command and close the file handle.5875 */5876 Bstr tapTerminateApplication;5877 networkAdapter->COMGETTER(TAPTerminateApplication)(tapTerminateApplication.asOutParam());5878 if (tapTerminateApplication)5879 {5880 /*5881 * Create the argument list5882 */5883 const char *apszArgs[4];5884 /* 0. The program name. */5885 Utf8Str tapTermAppUtf8(tapTerminateApplication);5886 apszArgs[0] = tapTermAppUtf8.raw();5887 5888 /* 1. The file descriptor. */5889 char szFD[32];5890 RTStrPrintf(szFD, sizeof(szFD), "%RTfile", maTapFD[slot]);5891 apszArgs[1] = szFD;5892 5893 /* 2. Device name (optional). */5894 apszArgs[2] = maTAPDeviceName[slot].isEmpty() ? NULL : maTAPDeviceName[slot].raw();5895 5896 /* 3. The end. */5897 apszArgs[3] = NULL;5898 5899 /*5900 * Create the process and wait for it to complete.5901 */5902 RTPROCESS Process;5903 int rcVBox = RTProcCreate(apszArgs[0], &apszArgs[0], NULL, 0, &Process);5904 if (VBOX_SUCCESS(rcVBox))5905 {5906 /* wait for the process to exit */5907 RTPROCSTATUS ProcStatus;5908 rcVBox = RTProcWait(Process, RTPROCWAIT_FLAGS_BLOCK, &ProcStatus);5909 AssertRC(rcVBox);5910 /* ignore return code? */5911 }5912 else5913 AssertMsgFailed(("Configuration error: Failed to start terminate program \"%s\", rc=%Vra\n", apszArgs[0], rcVBox)); /** @todo last error candidate. */5914 if (VBOX_FAILURE(rcVBox))5915 rc = E_FAIL;5916 }5917 5918 /*5919 * Now we can close the file handle.5920 */5921 int rcVBox = RTFileClose(maTapFD[slot]);5922 AssertRC(rcVBox);5923 /* the TAP device name and handle are no longer valid */5924 maTapFD[slot] = NIL_RTFILE;5925 maTAPDeviceName[slot] = "";5926 }5927 #endif5928 return rc;5929 }5930 #endif5931 5850 5932 5851 /** … … 5978 5897 /* Build the command line. */ 5979 5898 char szCommand[4096]; 5980 RTStrPrintf(szCommand, sizeof(szCommand), "%s %RTfile %s", tapTermAppUtf8.raw(), 5981 maTapFD[slot], 5899 RTStrPrintf(szCommand, sizeof(szCommand), "%s %s", tapTermAppUtf8.raw(), 5982 5900 maTAPDeviceName[slot].isEmpty() ? "" : maTAPDeviceName[slot].raw()); 5983 5901 … … 5995 5913 { 5996 5914 Log(("The TAP interface clean up script terminated abnormally.\n")); 5997 rc = setError(E_FAIL, "The TAP interface clean up script terminated abnormally.\n");5915 rc = setError(E_FAIL, tr ("The TAP interface clean up script terminated abnormally")); 5998 5916 } 5999 5917 if (WEXITSTATUS(rc) != 0) 6000 5918 { 6001 5919 Log(("The TAP interface clean up script returned a non-zero exit code.\n")); 6002 rc = setError(E_FAIL, "The TAP interface clean up script returned a non-zero exit code.\n");5920 rc = setError(E_FAIL, tr ("The TAP interface clean up script returned a non-zero exit code")); 6003 5921 } 6004 5922 }
Note:
See TracChangeset
for help on using the changeset viewer.