VirtualBox

儲存庫 vbox 的更動 55259


忽略:
時間撮記:
2015-4-14 下午05:59:42 (10 年 以前)
作者:
vboxsync
svn:sync-xref-src-repo-rev:
99572
訊息:

Main/Serial+Devices/Serial: new TCP backend for serial port. Contributed by Alexey Eromenko. Thanks!
Frontends/VirtualBox+VBoxManage: adapted accordingly

位置:
trunk
檔案:
修改 19 筆資料

圖例:

未更動
新增
刪除
  • trunk/doc/manual/en_US/user_BasicConcepts.xml

    r55150 r55259  
    11381138                      identify the virtual machine but may be freely
    11391139                      chosen.</para>
    1140                       <para>For forwarding serial traffic, you can use a helper
    1141                       program called VMware Serial Line Gateway, available for
    1142                       download at
    1143                                   <literal> <ulink
    1144                       url="http://www.l4ka.org/91.php">http://www.l4ka.org/91.php</ulink>
    1145                       </literal>. This tool provides a fixed server mode named
    1146                       pipe at
    1147                       <computeroutput>\\.\pipe\vmwaredebug</computeroutput>
    1148                       and connects incoming TCP connections on port 567 with
    1149                       the named pipe.</para>
    11501140                    </listitem>
    11511141
     
    11871177                </para>
    11881178              </listitem>
     1179
     1180              <listitem>
     1181                <para>TCP Socket: useful for forwarding serial traffic over TCP/IP, acting as a server,
     1182                   or it can act as a TCP client connecting to other servers.
     1183                   It allows remote machine to connect via TCP directly to guest's serial port.
     1184                </para>
     1185                <para>TCP Server: use "create socket" mode, and type in only the <emphasis role="bold">
     1186                  <computeroutput>port</computeroutput></emphasis> number.
     1187                   Typically 23 or 2023. Note that on UNIX-like systems you will have to use port
     1188                   number over 1024 for normal users.
     1189                </para>
     1190                <para>
     1191                   The client can use software such as "Putty" or command-line "telnet" to access TCP Server.
     1192                </para>
     1193                <para>TCP Client: to create a virtual null-modem cable over the Internet or LAN,
     1194                   the other side can connect via TCP by specifying <emphasis role="bold">
     1195                   <computeroutput>hostname:port</computeroutput></emphasis>.
     1196                   TCP socket will act in client mode, if you remove "create socket" mode.
     1197                </para>
     1198              </listitem>
     1199
    11891200            </itemizedlist></para>
    11901201        </listitem>
  • trunk/doc/manual/en_US/user_VBoxManage.xml

    r55172 r55259  
    10231023                </listitem>
    10241024
     1025                <listitem>
     1026                  <para><computeroutput>tcpserver
     1027                  &lt;port&gt;</computeroutput>: This
     1028                  tells VirtualBox to create a TCP socket on the host with TCP
     1029                  <computeroutput>&lt;port&gt;</computeroutput> and
     1030                  connect the virtual serial device to it. Note that UNIX-like
     1031                  systems require ports over 1024 for normal users.</para>
     1032                </listitem>
     1033
     1034                <listitem>
     1035                  <para><computeroutput>tcpclient
     1036                  &lt;hostname:port&gt;</computeroutput>: This operates just like
     1037                  <computeroutput>tcpserver ...</computeroutput>, except that the
     1038                  TCP socket is not created by VirtualBox,
     1039                  but assumed to exist already.</para>
     1040                </listitem>
     1041               
    10251042                <listitem>
    10261043                  <para><computeroutput>&lt;devicename&gt;</computeroutput>:
  • trunk/include/VBox/log.h

    r55255 r55259  
    204204    /** Host SCSI driver group. */
    205205    LOG_GROUP_DRV_SCSIHOST,
     206    /** TCP socket stream driver group. */
     207    LOG_GROUP_DRV_TCP,
    206208    /** Async transport driver group */
    207209    LOG_GROUP_DRV_TRANSPORT_ASYNC,
     
    849851    "DRV_SCSI",     \
    850852    "DRV_SCSIHOST", \
     853    "DRV_TELNETSERVER", \
    851854    "DRV_TRANSPORT_ASYNC", \
    852855    "DRV_TUN",      \
  • trunk/src/VBox/Devices/Makefile.kmk

    r54768 r55259  
    178178        Serial/DrvChar.cpp \
    179179        Serial/DrvNamedPipe.cpp \
     180        Serial/DrvTCP.cpp \
    180181        Serial/DrvRawFile.cpp \
    181182        Storage/DrvBlock.cpp \
  • trunk/src/VBox/Devices/build/VBoxDD.cpp

    r54426 r55259  
    55
    66/*
    7  * Copyright (C) 2006-2014 Oracle Corporation
     7 * Copyright (C) 2006-2015 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    338338    if (RT_FAILURE(rc))
    339339        return rc;
     340    rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvTCP);
     341    if (RT_FAILURE(rc))
     342        return rc;
    340343    rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvRawFile);
    341344    if (RT_FAILURE(rc))
  • trunk/src/VBox/Devices/build/VBoxDD.h

    r53523 r55259  
    55
    66/*
    7  * Copyright (C) 2006-2014 Oracle Corporation
     7 * Copyright (C) 2006-2015 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    147147extern const PDMDRVREG g_DrvChar;
    148148extern const PDMDRVREG g_DrvNamedPipe;
     149extern const PDMDRVREG g_DrvTCP;
    149150extern const PDMDRVREG g_DrvRawFile;
    150151extern const PDMDRVREG g_DrvHostParallel;
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp

    r55169 r55259  
    273273                     "                                             server <pipe>|\n"
    274274                     "                                             client <pipe>|\n"
     275                     "                                             tcpserver <port>|\n"
     276                     "                                             tcpclient <hostname:port>|\n"
    275277                     "                                             file <file>|\n"
    276278                     "                                             <devicename>]\n"
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp

    r55214 r55259  
    14031403                    case PortMode_RawFile:
    14041404                        if (details == VMINFO_MACHINEREADABLE)
    1405                             RTPrintf("uartmode%d=\"%ls\"\n", currentUART + 1,
     1405                            RTPrintf("uartmode%d=\"file,%ls\"\n", currentUART + 1,
    14061406                                     path.raw());
    14071407                        else
    14081408                            RTPrintf(", attached to raw file '%ls'\n",
    14091409                                     path.raw());
     1410                        break;
     1411                    case PortMode_TCP:
     1412                        if (details == VMINFO_MACHINEREADABLE)
     1413                            RTPrintf("uartmode%d=\"%s,%ls\"\n", currentUART + 1,
     1414                                     fServer ? "tcpserver" : "tcpclient", path.raw());
     1415                        else
     1416                            RTPrintf(", attached to tcp (%s) '%ls'\n",
     1417                                     fServer ? "server" : "client", path.raw());
    14101418                        break;
    14111419                    case PortMode_HostPipe:
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp

    r55234 r55259  
    55
    66/*
    7  * Copyright (C) 2006-2014 Oracle Corporation
     7 * Copyright (C) 2006-2015 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    19971997                else if (   !RTStrICmp(ValueUnion.psz, "server")
    19981998                         || !RTStrICmp(ValueUnion.psz, "client")
     1999                         || !RTStrICmp(ValueUnion.psz, "tcpserver")
     2000                         || !RTStrICmp(ValueUnion.psz, "tcpclient")
    19992001                         || !RTStrICmp(ValueUnion.psz, "file"))
    20002002                {
     
    20172019                    {
    20182020                        CHECK_ERROR(uart, COMSETTER(HostMode)(PortMode_HostPipe));
     2021                        CHECK_ERROR(uart, COMSETTER(Server)(FALSE));
     2022                    }
     2023                    else if (!RTStrICmp(pszMode, "tcpserver"))
     2024                    {
     2025                        CHECK_ERROR(uart, COMSETTER(HostMode)(PortMode_TCP));
     2026                        CHECK_ERROR(uart, COMSETTER(Server)(TRUE));
     2027                    }
     2028                    else if (!RTStrICmp(pszMode, "tcpclient"))
     2029                    {
     2030                        CHECK_ERROR(uart, COMSETTER(HostMode)(PortMode_TCP));
    20192031                        CHECK_ERROR(uart, COMSETTER(Server)(FALSE));
    20202032                    }
  • trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendCOM.cpp

    r55214 r55259  
    372372        case KPortMode_HostDevice:   return QApplication::translate("VBoxGlobal", "Host Device", "PortMode");
    373373        case KPortMode_RawFile:      return QApplication::translate("VBoxGlobal", "Raw File", "PortMode");
     374        case KPortMode_TCP:          return QApplication::translate("VBoxGlobal", "TCP", "PortMode");
    374375        AssertMsgFailed(("No text for %d", mode)); break;
    375376    }
     
    564565    list.insert(QApplication::translate("VBoxGlobal", "Host Device", "PortMode"),  KPortMode_HostDevice);
    565566    list.insert(QApplication::translate("VBoxGlobal", "Raw File", "PortMode"),     KPortMode_RawFile);
     567    list.insert(QApplication::translate("VBoxGlobal", "TCP", "PortMode"),          KPortMode_TCP);
    566568    if (!list.contains(strMode))
    567569    {
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp

    r54644 r55259  
    55
    66/*
    7  * Copyright (C) 2006-2014 Oracle Corporation
     7 * Copyright (C) 2006-2015 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    13231323                if (mode == KPortMode_HostPipe ||
    13241324                    mode == KPortMode_HostDevice ||
     1325                    mode == KPortMode_TCP ||
    13251326                    mode == KPortMode_RawFile)
    13261327                    data += QString ("%1 (<nobr>%2</nobr>)")
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsElements.cpp

    r55140 r55259  
    808808                    KPortMode mode = port.GetHostMode();
    809809                    QString data = vboxGlobal().toCOMPortName(port.GetIRQ(), port.GetIOBase()) + ", ";
    810                     if (mode == KPortMode_HostPipe || mode == KPortMode_HostDevice || mode == KPortMode_RawFile)
     810                    if (mode == KPortMode_HostPipe || mode == KPortMode_HostDevice ||
     811                        mode == KPortMode_RawFile || mode == KPortMode_TCP)
    811812                        data += QString("%1 (%2)").arg(gpConverter->toString(mode)).arg(QDir::toNativeSeparators(port.GetPath()));
    812813                    else
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSerial.cpp

    r52730 r55259  
    55
    66/*
    7  * Copyright (C) 2006-2012 Oracle Corporation
     7 * Copyright (C) 2006-2015 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    6363    mCbMode->addItem (""); /* KPortMode_HostDevice */
    6464    mCbMode->addItem (""); /* KPortMode_RawFile */
     65    mCbMode->addItem (""); /* KPortMode_TCP */
    6566
    6667    /* Setup connections */
     
    9495    mLbMode->setEnabled(m_pParent->isMachineOffline());
    9596    mCbMode->setEnabled(m_pParent->isMachineOffline());
    96     mCbPipe->setEnabled(mode == KPortMode_HostPipe && m_pParent->isMachineOffline());
     97    mCbPipe->setEnabled((mode == KPortMode_HostPipe || mode == KPortMode_TCP)
     98      && m_pParent->isMachineOffline());
    9799    mLbPath->setEnabled(m_pParent->isMachineOffline());
    98100    mLePath->setEnabled(mode != KPortMode_Disconnected && m_pParent->isMachineOffline());
     
    167169    mCbNumber->setItemText (mCbNumber->count() - 1, vboxGlobal().toCOMPortName (0, 0));
    168170
     171    mCbMode->setItemText (4, gpConverter->toString (KPortMode_TCP));
    169172    mCbMode->setItemText (3, gpConverter->toString (KPortMode_RawFile));
    170173    mCbMode->setItemText (2, gpConverter->toString (KPortMode_HostDevice));
     
    205208{
    206209    KPortMode mode = gpConverter->fromString<KPortMode> (aText);
    207     mCbPipe->setEnabled (mode == KPortMode_HostPipe);
     210    mCbPipe->setEnabled (mode == KPortMode_HostPipe || mode == KPortMode_TCP);
    208211    mLePath->setEnabled (mode != KPortMode_Disconnected);
    209212
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSerial.ui

    r48576 r55259  
    33 VBox frontends: Qt4 GUI ("VirtualBox"):
    44
    5  Copyright (C) 2008-2012 Oracle Corporation
     5 Copyright (C) 2008-2015 Oracle Corporation
    66
    77 This file is part of VirtualBox Open Source Edition (OSE), as
     
    177177       <widget class="QCheckBox" name="mCbPipe" >
    178178        <property name="whatsThis" >
    179          <string>If checked, the pipe specified in the &lt;b>Port Path&lt;/b> field will be created by the virtual machine when it starts. Otherwise, the virtual machine will assume that the pipe exists and try to use it.</string>
    180         </property>
    181         <property name="text" >
    182          <string>&amp;Create Pipe</string>
     179         <string>If checked, the pipe or socket specified in the &lt;b>Port Path&lt;/b> field will be created by the virtual machine when it starts. Otherwise, the virtual machine will assume that the pipe or socket exists and try to use it.</string>
     180        </property>
     181        <property name="text" >
     182         <string>&amp;Connect to existing pipe/socket</string>
    183183        </property>
    184184       </widget>
     
    187187       <widget class="QLabel" name="mLbPath" >
    188188        <property name="text" >
    189          <string>Port/File &amp;Path:</string>
     189         <string>&amp;Path/Address:</string>
    190190        </property>
    191191        <property name="alignment" >
     
    200200       <widget class="QLineEdit" name="mLePath" >
    201201        <property name="whatsThis" >
    202          <string>Holds the path to the serial port's pipe on the host when the port is working in &lt;b>Host Pipe&lt;/b> mode, or the host serial device name when the port is working in &lt;b>Host Device&lt;/b> mode.</string>
     202         <string>In &lt;b>Host Pipe&lt;/b> mode: Holds the path to the serial port's pipe on the host, examples:
     203"\\.\pipe\myvbox" or "/tmp/myvbox", for Windows and UNIX-like systems respectively.
     204In &lt;b>Host Device&lt;/b> mode: Holds the host serial device name; examples: "COM1" or "/dev/ttyS0".
     205In &lt;b>Raw file&lt;/b> mode: file-path on the host system, where serial output will be dumped.
     206In &lt;b>TCP&lt;/b> mode: Holds TCP "port" when in server mode, or "hostname:port" or when in client mode.
     207</string>
    203208        </property>
    204209       </widget>
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r55255 r55259  
    1641916419  <enum
    1642016420    name="PortMode"
    16421     uuid="533b5fe3-0185-4197-86a7-17e37dd39d76"
     16421    uuid="7485fcfd-d603-470a-87af-26d33beb7de9"
    1642216422    >
    1642316423    <desc>
     
    1643716437    <const name="RawFile"           value="3">
    1643816438      <desc>Virtual device is attached to a raw file.</desc>
     16439    </const>
     16440    <const name="TCP"               value="4">
     16441      <desc>Virtual device is attached to a TCP socket.</desc>
    1643916442    </const>
    1644016443  </enum>
     
    1650716510        Flag whether this serial port acts as a server (creates a new pipe on
    1650816511        the host) or as a client (uses the existing pipe). This attribute is
    16509         used only when <link to="#hostMode"/> is PortMode_HostPipe.
     16512        used only when <link to="#hostMode"/> is PortMode_HostPipe or PortMode_TCP.
    1651016513      </desc>
    1651116514    </attribute>
     
    1651416517      <desc>
    1651516518        Path to the serial port's pipe on the host when <link to="ISerialPort::hostMode"/> is
    16516         PortMode_HostPipe, or the host serial device name when
    16517         <link to="ISerialPort::hostMode"/> is PortMode_HostDevice. For both
    16518         cases, setting a @c null or empty string as the attribute's value
    16519         is an error. Otherwise, the value of this property is ignored.
     16519        PortMode_HostPipe, the host serial device name when
     16520        <link to="ISerialPort::hostMode"/> is PortMode_HostDevice or the TCP
     16521       <b>port</b> (server) or <b>hostname:port</b> (client) when
     16522        <link to="ISerialPort::hostMode"/> is PortMode_TCP.
     16523        For those cases, setting a @c null or empty string as the attribute's
     16524        value is an error. Otherwise, the value of this property is ignored.
    1652016525      </desc>
    1652116526    </attribute>
  • trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp

    r55180 r55259  
    1010
    1111/*
    12  * Copyright (C) 2006-2014 Oracle Corporation
     12 * Copyright (C) 2006-2015 Oracle Corporation
    1313 *
    1414 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    25282528                    InsertConfigString(pLunL1,  "DevicePath", bstr);
    25292529                }
     2530                else if (eHostMode == PortMode_TCP)
     2531                {
     2532                    InsertConfigString(pLunL0,  "Driver", "Char");
     2533                    InsertConfigNode(pLunL0,    "AttachedDriver", &pLunL1);
     2534                    InsertConfigString(pLunL1,  "Driver", "TCP");
     2535                    InsertConfigNode(pLunL1,    "Config", &pLunL2);
     2536                    InsertConfigString(pLunL2,  "Location", bstr);
     2537                    InsertConfigInteger(pLunL2, "IsServer", fServer);
     2538                }
    25302539                else if (eHostMode == PortMode_RawFile)
    25312540                {
     
    27172726                    LogRel(("Audio: Automatically setting host audio backend to OSS\n"));
    27182727                    /* Manually set backend to OSS for now. */
    2719                     InsertConfigString(pLunL1, "Driver", "OSSAudio"); 
     2728                    InsertConfigString(pLunL1, "Driver", "OSSAudio");
    27202729# else
    27212730                    InsertConfigString(pCfg, "AudioDriver", "solaudio");
  • trunk/src/VBox/Main/src-server/SerialPortImpl.cpp

    r54971 r55259  
    258258                                    m->bd->ulSlot);
    259259                break;
     260            case PortMode_TCP:
     261                if (m->bd->strPath.isEmpty())
     262                    return setError(E_INVALIDARG,
     263                                    tr("Cannot set the host device mode of the serial port %d "
     264                                       "because the server address or TCP port is invalid"),
     265                                    m->bd->ulSlot);
     266                break;
    260267            case PortMode_Disconnected:
    261268                break;
     
    637644    if (    (    m->bd->portMode == PortMode_HostDevice
    638645              || m->bd->portMode == PortMode_HostPipe
     646              || m->bd->portMode == PortMode_TCP
    639647              || m->bd->portMode == PortMode_RawFile
    640648            ) && str.isEmpty()
     
    642650        return setError(E_INVALIDARG,
    643651                        tr("Path of the serial port %d may not be empty or null in "
    644                            "host pipe or host device mode"),
     652                           "host pipe, host device or TCP mode"),
    645653                        m->bd->ulSlot);
    646654
  • trunk/src/VBox/Main/xml/Settings.cpp

    r55232 r55259  
    25652565        else if (strPortMode == "Disconnected")
    25662566            port.portMode = PortMode_Disconnected;
     2567        else if (strPortMode == "TCP")
     2568            port.portMode = PortMode_TCP;
    25672569        else
    25682570            throw ConfigFileError(this, pelmPort, N_("Invalid value '%s' in UART/Port/@hostMode attribute"), strPortMode.c_str());
     
    46474649            case PortMode_HostPipe: pcszHostMode = "HostPipe"; break;
    46484650            case PortMode_HostDevice: pcszHostMode = "HostDevice"; break;
     4651            case PortMode_TCP: pcszHostMode = "TCP"; break;
    46494652            case PortMode_RawFile: pcszHostMode = "RawFile"; break;
    46504653            default: /*case PortMode_Disconnected:*/ pcszHostMode = "Disconnected"; break;
     
    46524655        switch (port.portMode)
    46534656        {
     4657            case PortMode_TCP:
    46544658            case PortMode_HostPipe:
    46554659                pelmPort->setAttribute("server", port.fServer);
     
    54935497    if (m->sv < SettingsVersion_v1_15)
    54945498    {
     5499        // VirtualBox 5.0 adds paravirt providers, explicit AHCI port hotplug
     5500        // setting, USB storage controller, xHCI and serial port TCP backend.
     5501
    54955502        /*
    54965503         * Check whether a paravirtualization provider other than "Legacy" is used, if so bump the version.
     
    55105517                 ++it)
    55115518            {
    5512                 bool fSettingsBumped = false;
    55135519                const StorageController &sctl = *it;
    55145520
     
    55165522                {
    55175523                    m->sv = SettingsVersion_v1_15;
    5518                     fSettingsBumped = true;
    5519                     break;
     5524                    return;
    55205525                }
    55215526
     
    55325537                    {
    55335538                        m->sv = SettingsVersion_v1_15;
    5534                         fSettingsBumped = true;
    5535                         break;
     5539                        return;
    55365540                    }
    55375541                }
    5538 
    5539                 /* Abort early if possible. */
    5540                 if (fSettingsBumped)
    5541                     return;
    55425542            }
    55435543
     
    55535553                {
    55545554                    m->sv = SettingsVersion_v1_15;
    5555                     break;
     5555                    return;
     5556                }
     5557            }
     5558
     5559            /*
     5560             * Check if any serial port uses the TCP backend.
     5561             */
     5562            for (SerialPortsList::const_iterator it = hardwareMachine.llSerialPorts.begin();
     5563                 it != hardwareMachine.llSerialPorts.end();
     5564                 ++it)
     5565            {
     5566                const SerialPort &port = *it;
     5567                if (port.portMode == PortMode_TCP)
     5568                {
     5569                    m->sv = SettingsVersion_v1_15;
     5570                    return;
    55565571                }
    55575572            }
  • trunk/src/VBox/Main/xml/VirtualBox-settings.xsd

    r48879 r55259  
    77 *  Common definitions
    88
    9     Copyright (C) 2004-2013 Oracle Corporation
     9    Copyright (C) 2004-2015 Oracle Corporation
    1010
    1111    This file is part of VirtualBox Open Source Edition (OSE), as
     
    242242    <xsd:enumeration value="HostPipe"/>
    243243    <xsd:enumeration value="HostDevice"/>
     244    <xsd:enumeration value="TCP"/>
    244245  </xsd:restriction>
    245246</xsd:simpleType>
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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