VirtualBox

Changeset 84618 in vbox for trunk/src/VBox/Main/src-client


Ignore:
Timestamp:
May 29, 2020 6:43:11 PM (5 years ago)
Author:
vboxsync
Message:

OCI: (bugref:9469) cloud network integration code moved from Machine to Console, cloud network environment setup (cloud part).

Location:
trunk/src/VBox/Main/src-client
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/ConsoleImpl.cpp

    r82968 r84618  
    649649    }
    650650
     651#ifdef VBOX_WITH_CLOUD_NET
     652    {
     653        ComPtr<IVirtualBox> pVirtualBox;
     654        HRESULT rc = mMachine->COMGETTER(Parent)(pVirtualBox.asOutParam());
     655        AssertComRC(rc);
     656        if (SUCCEEDED(rc) && !pVirtualBox.isNull())
     657            stopGateways(pVirtualBox, mGateways);
     658    }
     659#endif /* VBOX_WITH_CLOUD_NET */
    651660    LogFlowThisFunc(("initFailed()=%d\n", autoUninitSpan.initFailed()));
    652661    if (mVmListener)
  • trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp

    r83170 r84618  
    26302630            Assert(!macAddr.isEmpty());
    26312631            Utf8Str macAddrUtf8 = macAddr;
     2632#ifdef VBOX_WITH_CLOUD_NET
     2633            NetworkAttachmentType_T eAttachmentType;
     2634            hrc = networkAdapter->COMGETTER(AttachmentType)(&eAttachmentType);                 H();
     2635            if (eAttachmentType == NetworkAttachmentType_Cloud)
     2636            {
     2637                mGateways.setLocalMacAddress(macAddrUtf8);
     2638                /* We'll insert cloud MAC later, when it becomes known. */
     2639            }
     2640            else
     2641            {
     2642#endif
    26322643            char *macStr = (char*)macAddrUtf8.c_str();
    26332644            Assert(strlen(macStr) == 12);
     
    26462657            }
    26472658            InsertConfigBytes(pCfg, "MAC", &Mac, sizeof(Mac));
    2648 
     2659#ifdef VBOX_WITH_CLOUD_NET
     2660            }
     2661#endif
    26492662            /*
    26502663             * Check if the cable is supposed to be unplugged
     
    49854998        Bstr bstr;
    49864999
     5000#ifdef VBOX_WITH_CLOUD_NET
     5001        /* We'll need device's pCfg for cloud attachments */
     5002        PCFGMNODE pDevCfg = pCfg;
     5003#endif /* VBOX_WITH_CLOUD_NET */
     5004
    49875005#define H()         AssertLogRelMsgReturn(!FAILED(hrc), ("hrc=%Rhrc\n", hrc), VERR_MAIN_CONFIG_CONSTRUCTOR_COM_ERROR)
    49885006
     
    58235841            case NetworkAttachmentType_Cloud:
    58245842            {
    5825                 hrc = aNetworkAdapter->COMGETTER(CloudNetwork)(bstr.asOutParam());       H();
     5843                ComPtr<ICloudNetwork> network;
     5844                hrc = aNetworkAdapter->COMGETTER(CloudNetwork)(bstr.asOutParam());            H();
     5845                hrc = pMachine->COMGETTER(Name)(mGateways.mTargetVM.asOutParam());            H();
     5846                hrc = virtualBox->FindCloudNetworkByName(bstr.raw(), network.asOutParam());   H();
     5847                hrc = startGateways(virtualBox, network, mGateways);                          H();
     5848                InsertConfigBytes(pDevCfg, "MAC", &mGateways.mCloudMacAddress, sizeof(mGateways.mCloudMacAddress));
    58265849                if (!bstr.isEmpty())
    58275850                {
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