VirtualBox

Changeset 18829 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Apr 7, 2009 3:42:32 PM (16 years ago)
Author:
vboxsync
Message:

undo 45832

Location:
trunk/src/VBox
Files:
28 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp

    r18826 r18829  
    694694                    {
    695695                        Bstr strBridgeAdp;
    696                         nic->COMGETTER(BridgedInterface)(strBridgeAdp.asOutParam());
     696                        nic->COMGETTER(HostInterface)(strBridgeAdp.asOutParam());
    697697                        if (details == VMINFO_MACHINEREADABLE)
    698698                        {
     
    721721                    {
    722722                        Bstr strHostonlyAdp;
    723                         nic->COMGETTER(HostOnlyInterface)(strHostonlyAdp.asOutParam());
     723                        nic->COMGETTER(HostInterface)(strHostonlyAdp.asOutParam());
    724724                        if (details == VMINFO_MACHINEREADABLE)
    725725                        {
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp

    r18826 r18829  
    130130    std::vector <char *> nictracefile (NetworkAdapterCount, 0);
    131131    std::vector <char *> nicspeed (NetworkAdapterCount, 0);
    132     std::vector <char *> bridgedifdev (NetworkAdapterCount, 0);
    133     std::vector <char *> hostonlyifdev (NetworkAdapterCount, 0);
     132    std::vector <char *> hostifdev (NetworkAdapterCount, 0);
    134133    std::vector <const char *> intnet (NetworkAdapterCount, 0);
    135134    std::vector <const char *> natnet (NetworkAdapterCount, 0);
     
    489488            if (a->argc <= i + 1)
    490489                return errorArgument("Missing argument to '%s'", a->argv[i]);
    491             bridgedifdev[n - 1] = a->argv[i + 1];
     490            hostifdev[n - 1] = a->argv[i + 1];
    492491            i++;
    493492        }
     
    500499            if (a->argc <= i + 1)
    501500                return errorArgument("Missing argument to '%s'", a->argv[i]);
    502             bridgedifdev[n - 1] = a->argv[i + 1];
     501            hostifdev[n - 1] = a->argv[i + 1];
    503502            i++;
    504503        }
     
    512511            if (a->argc <= i + 1)
    513512                return errorArgument("Missing argument to '%s'", a->argv[i]);
    514             hostonlyifdev[n - 1] = a->argv[i + 1];
     513            hostifdev[n - 1] = a->argv[i + 1];
    515514            i++;
    516515        }
     
    16441643
    16451644            /* the host interface device? */
    1646             if (hostonlyifdev[n])
     1645            if (hostifdev[n])
    16471646            {
    16481647                /* remove it? */
    1649                 if (!strcmp(hostonlyifdev[n], "none"))
    1650                 {
    1651                     CHECK_ERROR_RET(nic, COMSETTER(HostOnlyInterface)(NULL), 1);
     1648                if (!strcmp(hostifdev[n], "none"))
     1649                {
     1650                    CHECK_ERROR_RET(nic, COMSETTER(HostInterface)(NULL), 1);
    16521651                }
    16531652                else
    16541653                {
    1655                     CHECK_ERROR_RET(nic, COMSETTER(HostOnlyInterface)(Bstr(hostonlyifdev[n])), 1);
    1656                 }
    1657             }
    1658 
    1659             if (bridgedifdev[n])
    1660             {
    1661                 /* remove it? */
    1662                 if (!strcmp(bridgedifdev[n], "none"))
    1663                 {
    1664                     CHECK_ERROR_RET(nic, COMSETTER(BridgedInterface)(NULL), 1);
    1665                 }
    1666                 else
    1667                 {
    1668                     CHECK_ERROR_RET(nic, COMSETTER(BridgedInterface)(Bstr(bridgedifdev[n])), 1);
     1654                    CHECK_ERROR_RET(nic, COMSETTER(HostInterface)(Bstr(hostifdev[n])), 1);
    16691655                }
    16701656            }
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp

    r18826 r18829  
    18981898                    if (type == KNetworkAttachmentType_Bridged)
    18991899                        attType = attType.arg (tr ("Bridged network, %1",
    1900                             "details report (network)").arg (adapter.GetBridgedInterface()));
     1900                            "details report (network)").arg (adapter.GetHostInterface()));
    19011901                    else if (type == KNetworkAttachmentType_Internal)
    19021902                        attType = attType.arg (tr ("Internal network, '%1'",
     
    19041904                    else if (type == KNetworkAttachmentType_HostOnly)
    19051905                        attType = attType.arg (tr ("Host-only network, '%1'",
    1906                             "details report (network)").arg (adapter.GetHostOnlyInterface()));
     1906                            "details report (network)").arg (adapter.GetHostInterface()));
    19071907                    else
    19081908                        attType = attType.arg (vboxGlobal().toString (type));
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMSettingsNetworkDetails.cpp

    r18826 r18829  
    7676    if (!intName.isEmpty())
    7777        setProperty ("INT_Name", QVariant (intName));
    78     QString bridgedIfName (mAdapter.GetBridgedInterface());
    79     CHostNetworkInterface bridgedIf =
    80         vboxGlobal().virtualBox().GetHost().FindHostNetworkInterfaceByName (bridgedIfName);
    81     if (!bridgedIf.isNull() && bridgedIf.GetInterfaceType() == KHostNetworkInterfaceType_Bridged)
    82         setProperty ("BRG_Name", QVariant (bridgedIfName));
    83 
    84     QString hostonlyIfName (mAdapter.GetHostOnlyInterface());
    85     CHostNetworkInterface hostonlyIf =
    86         vboxGlobal().virtualBox().GetHost().FindHostNetworkInterfaceByName (hostonlyIfName);
    87     if (!hostonlyIf.isNull() && hostonlyIf.GetInterfaceType() == KHostNetworkInterfaceType_HostOnly)
    88         setProperty ("HOI_Name", QVariant (hostonlyIfName));
     78    QString ifsName (mAdapter.GetHostInterface());
     79    CHostNetworkInterface ifs =
     80        vboxGlobal().virtualBox().GetHost().FindHostNetworkInterfaceByName (ifsName);
     81    if (!ifs.isNull() && ifs.GetInterfaceType() == KHostNetworkInterfaceType_Bridged)
     82        setProperty ("BRG_Name", QVariant (ifsName));
     83    else if (!ifs.isNull() && ifs.GetInterfaceType() == KHostNetworkInterfaceType_HostOnly)
     84        setProperty ("HOI_Name", QVariant (ifsName));
    8985
    9086    /* Load common settings */
     
    10096    {
    10197        case KNetworkAttachmentType_Bridged:
    102             mAdapter.SetBridgedInterface (name);
     98            mAdapter.SetHostInterface (name);
    10399            break;
    104100        case KNetworkAttachmentType_Internal:
     
    106102            break;
    107103        case KNetworkAttachmentType_HostOnly:
    108             mAdapter.SetHostOnlyInterface (name);
     104            mAdapter.SetHostInterface (name);
    109105            break;
    110106        default:
  • trunk/src/VBox/Main/ApplianceImpl.cpp

    r18826 r18829  
    20362036                                if (FAILED(rc)) throw rc;
    20372037                                /* Set the interface name to attach to */
    2038                                 pNetworkAdapter->COMSETTER(BridgedInterface)(name);
     2038                                pNetworkAdapter->COMSETTER(HostInterface)(name);
    20392039                                if (FAILED(rc)) throw rc;
    20402040                                break;
     
    20672067                                if (FAILED(rc)) throw rc;
    20682068                                /* Set the interface name to attach to */
    2069                                 pNetworkAdapter->COMSETTER(HostOnlyInterface)(name);
     2069                                pNetworkAdapter->COMSETTER(HostInterface)(name);
    20702070                                if (FAILED(rc)) throw rc;
    20712071                                break;
  • trunk/src/VBox/Main/ConsoleImpl.cpp

    r18826 r18829  
    43354335                /* a valid host interface must have been set */
    43364336                Bstr hostif;
    4337                 adapter->COMGETTER(BridgedInterface)(hostif.asOutParam());
     4337                adapter->COMGETTER(HostInterface)(hostif.asOutParam());
    43384338                if (!hostif)
    43394339                {
     
    57355735        /* The name of the TAP interface we are using */
    57365736        Bstr tapDeviceName;
    5737         rc = networkAdapter->COMGETTER(BridgedInterface)(tapDeviceName.asOutParam());
     5737        rc = networkAdapter->COMGETTER(HostInterface)(tapDeviceName.asOutParam());
    57385738        if (FAILED(rc))
    57395739            tapDeviceName.setNull();  /* Is this necessary? */
     
    58565856        Bstr tapDeviceName, tapTerminateApplication;
    58575857        bool isStatic = true;
    5858         rc = networkAdapter->COMGETTER(BridgedInterface)(tapDeviceName.asOutParam());
     5858        rc = networkAdapter->COMGETTER(HostInterface)(tapDeviceName.asOutParam());
    58595859        if (FAILED(rc) || tapDeviceName.isEmpty())
    58605860        {
  • trunk/src/VBox/Main/ConsoleImpl2.cpp

    r18826 r18829  
    12381238        }
    12391239#ifdef VMWARE_NET_IN_SLOT_11
    1240         /*
     1240        /* 
    12411241         * Dirty hack for PCI slot compatibility with VMWare,
    12421242         * it assigns slot 11 to the first network controller.
     
    14461446
    14471447                    Bstr HifName;
    1448                     hrc = networkAdapter->COMGETTER(BridgedInterface)(HifName.asOutParam());
     1448                    hrc = networkAdapter->COMGETTER(HostInterface)(HifName.asOutParam());
    14491449                    if(FAILED(hrc))
    14501450                    {
     
    18081808# else
    18091809                Bstr HifName;
    1810                 hrc = networkAdapter->COMGETTER(HostOnlyInterface)(HifName.asOutParam());
     1810                hrc = networkAdapter->COMGETTER(HostInterface)(HifName.asOutParam());
    18111811                if(FAILED(hrc))
    18121812                {
     
    19581958#if !defined(RT_OS_WINDOWS) && defined(VBOX_WITH_NETFLT)
    19591959                Bstr HifName;
    1960                 hrc = networkAdapter->COMGETTER(HostOnlyInterface)(HifName.asOutParam());
     1960                hrc = networkAdapter->COMGETTER(HostInterface)(HifName.asOutParam());
    19611961                if(FAILED(hrc))
    19621962                {
  • trunk/src/VBox/Main/NetworkAdapterImpl.cpp

    r18826 r18829  
    396396}
    397397
    398 STDMETHODIMP NetworkAdapter::COMGETTER(HostOnlyInterface)(BSTR *aHostInterface)
     398STDMETHODIMP NetworkAdapter::COMGETTER(HostInterface)(BSTR *aHostInterface)
    399399{
    400400    CheckComArgOutPointerValid(aHostInterface);
     
    405405    AutoReadLock alock (this);
    406406
    407     mData->mHostOnlyInterface.cloneTo (aHostInterface);
    408 
    409     return S_OK;
    410 }
    411 
    412 STDMETHODIMP NetworkAdapter::COMSETTER(HostOnlyInterface)(IN_BSTR aHostInterface)
     407    mData->mHostInterface.cloneTo (aHostInterface);
     408
     409    return S_OK;
     410}
     411
     412STDMETHODIMP NetworkAdapter::COMSETTER(HostInterface)(IN_BSTR aHostInterface)
    413413{
    414414    /** @todo Validate input string length. r=dmik: do it in XML schema?*/
     
    427427    AutoWriteLock alock (this);
    428428
    429     if (mData->mHostOnlyInterface != aHostInterface)
    430     {
    431         mData.backup();
    432         mData->mHostOnlyInterface = aHostInterface;
    433 
    434         /* leave the lock before informing callbacks */
    435         alock.unlock();
    436 
    437         mParent->onNetworkAdapterChange (this);
    438     }
    439 
    440     return S_OK;
    441 }
    442 
    443 STDMETHODIMP NetworkAdapter::COMGETTER(BridgedInterface)(BSTR *aHostInterface)
    444 {
    445     CheckComArgOutPointerValid(aHostInterface);
    446 
    447     AutoCaller autoCaller (this);
    448     CheckComRCReturnRC (autoCaller.rc());
    449 
    450     AutoReadLock alock (this);
    451 
    452     mData->mBridgedInterface.cloneTo (aHostInterface);
    453 
    454     return S_OK;
    455 }
    456 
    457 STDMETHODIMP NetworkAdapter::COMSETTER(BridgedInterface)(IN_BSTR aHostInterface)
    458 {
    459     /** @todo Validate input string length. r=dmik: do it in XML schema?*/
    460 
    461     /* we don't allow null strings for the host interface (because the @name
    462      * attribute of <HostInterface> must be always present but can be empty). */
    463     CheckComArgNotNull (aHostInterface);
    464 
    465     AutoCaller autoCaller (this);
    466     CheckComRCReturnRC (autoCaller.rc());
    467 
    468     /* the machine needs to be mutable */
    469     Machine::AutoMutableStateDependency adep (mParent);
    470     CheckComRCReturnRC (adep.rc());
    471 
    472     AutoWriteLock alock (this);
    473 
    474     if (mData->mBridgedInterface != aHostInterface)
    475     {
    476         mData.backup();
    477         mData->mBridgedInterface = aHostInterface;
     429    if (mData->mHostInterface != aHostInterface)
     430    {
     431        mData.backup();
     432        mData->mHostInterface = aHostInterface;
    478433
    479434        /* leave the lock before informing callbacks */
     
    971926        ComAssertRet (!name.isNull(), E_FAIL);
    972927
    973         rc = COMSETTER(BridgedInterface) (name);
     928        rc = COMSETTER(HostInterface) (name);
    974929        CheckComRCReturnRC (rc);
    975930
     
    997952        ComAssertRet (!name.isNull(), E_FAIL);
    998953
    999         rc = COMSETTER(HostOnlyInterface) (name);
     954        rc = COMSETTER(HostInterface) (name);
    1000955        CheckComRCReturnRC (rc);
    1001956#endif
     
    10891044        {
    10901045            Key attachmentNode = aAdapterNode.createKey ("BridgedInterface");
    1091             Assert (!mData->mBridgedInterface.isNull());
    1092             attachmentNode.setValue <Bstr> ("name", mData->mBridgedInterface);
     1046            Assert (!mData->mHostInterface.isNull());
     1047            attachmentNode.setValue <Bstr> ("name", mData->mHostInterface);
    10931048            break;
    10941049        }
     
    11041059            Key attachmentNode = aAdapterNode.createKey ("HostOnlyInterface");
    11051060#if defined(VBOX_WITH_NETFLT)
    1106             Assert (!mData->mHostOnlyInterface.isNull());
    1107             attachmentNode.setValue <Bstr> ("name", mData->mHostOnlyInterface);
     1061            Assert (!mData->mHostInterface.isNull());
     1062            attachmentNode.setValue <Bstr> ("name", mData->mHostInterface);
    11081063#endif
    11091064            break;
     
    12561211        {
    12571212            /* reset handle and device name */
    1258             mData->mBridgedInterface = "";
     1213            mData->mHostInterface = "";
    12591214            break;
    12601215        }
     
    12681223#if defined(VBOX_WITH_NETFLT)
    12691224            /* reset handle and device name */
    1270             mData->mHostOnlyInterface = "";
     1225            mData->mHostInterface = "";
    12711226#endif
    12721227            break;
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r18826 r18829  
    1093310933  <interface
    1093410934     name="INetworkAdapter" extends="$unknown"
    10935      uuid="50F03B9E-FF02-4e07-9DA8-86FBF884D62E"
     10935     uuid="65607a27-2b73-4d43-b4cc-0ba2c817fbde"
    1093610936     wsmap="managed"
    1093710937     >
     
    1098210982    <attribute name="attachmentType" type="NetworkAttachmentType" readonly="yes"/>
    1098310983
    10984     <attribute name="bridgedInterface" type="wstring">
    10985       <desc>
    10986         Name of the bridged network interface the VM is attached to.
    10987       </desc>
    10988     </attribute>
    10989    
    10990     <attribute name="hostOnlyInterface" type="wstring">
    10991       <desc>
    10992         Name of the host only network interface the VM is attached to.
    10993       </desc>
    10994     </attribute>
    10995    
     10984    <attribute name="hostInterface" type="wstring">
     10985      <desc>
     10986        Name of the host network interface the VM is attached to.
     10987      </desc>
     10988    </attribute>
     10989
    1099610990    <attribute name="internalNetwork" type="wstring">
    1099710991      <desc>
  • trunk/src/VBox/Main/include/NetworkAdapterImpl.h

    r18826 r18829  
    4444            , mAttachmentType (NetworkAttachmentType_Null)
    4545            ,  mCableConnected (TRUE), mLineSpeed (0), mTraceEnabled (FALSE)
    46             , mHostOnlyInterface ("") /* cannot be null */
    47             , mBridgedInterface ("") /* cannot be null */
     46            , mHostInterface ("") /* cannot be null */
    4847        {}
    4948
     
    5857                    mLineSpeed == that.mLineSpeed &&
    5958                    mTraceEnabled == that.mTraceEnabled &&
    60                     mHostOnlyInterface == that.mHostOnlyInterface &&
    61                     mBridgedInterface == that.mBridgedInterface &&
     59                    mHostInterface == that.mHostInterface &&
    6260                    mInternalNetwork == that.mInternalNetwork &&
    6361                    mNATNetwork == that.mNATNetwork);
     
    7371        BOOL mTraceEnabled;
    7472        Bstr mTraceFile;
    75         Bstr mHostOnlyInterface;
    76         Bstr mBridgedInterface;
     73        Bstr mHostInterface;
    7774        Bstr mInternalNetwork;
    7875        Bstr mNATNetwork;
     
    112109    STDMETHOD(COMSETTER(MACAddress)) (IN_BSTR aMACAddress);
    113110    STDMETHOD(COMGETTER(AttachmentType)) (NetworkAttachmentType_T *aAttachmentType);
    114     STDMETHOD(COMGETTER(HostOnlyInterface)) (BSTR *aHostInterface);
    115     STDMETHOD(COMSETTER(HostOnlyInterface)) (IN_BSTR aHostInterface);
    116     STDMETHOD(COMGETTER(BridgedInterface)) (BSTR *aHostInterface);
    117     STDMETHOD(COMSETTER(BridgedInterface)) (IN_BSTR aHostInterface);
     111    STDMETHOD(COMGETTER(HostInterface)) (BSTR *aHostInterface);
     112    STDMETHOD(COMSETTER(HostInterface)) (IN_BSTR aHostInterface);
    118113    STDMETHOD(COMGETTER(InternalNetwork)) (BSTR *aInternalNetwork);
    119114    STDMETHOD(COMSETTER(InternalNetwork)) (IN_BSTR aInternalNetwork);
Note: See TracChangeset for help on using the changeset viewer.

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