VirtualBox

Changeset 75766 in vbox


Ignore:
Timestamp:
Nov 27, 2018 11:00:10 AM (6 years ago)
Author:
vboxsync
Message:

bugref:9152. Replaced the word "oci" by "cloud" in the names in the Appliance code.

Location:
trunk/src/VBox/Main
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/ApplianceImpl.h

    r73892 r75766  
    115115    class TaskOVF;
    116116    class TaskOPC;
    117     class TaskOCI;
     117    class TaskCloud;
    118118
    119119    struct Data;            // opaque, defined in ApplianceImpl.cpp
    120120    Data *m;
    121121
    122     enum SetUpProgressMode { ImportFile, ImportS3, WriteFile, WriteS3, ExportOCI };
     122    enum SetUpProgressMode { ImportFile, ImportS3, WriteFile, WriteS3, ExportCloud };
    123123
    124124    /** @name General stuff
     
    139139    static void i_importOrExportThreadTask(TaskOVF *pTask);
    140140    static void i_exportOPCThreadTask(TaskOPC *pTask);
    141     static void i_exportOCIThreadTask(TaskOCI *pTask);
     141    static void i_exportCloudThreadTask(TaskCloud *pTask);
    142142
    143143    HRESULT i_initBackendNames();
     
    218218    HRESULT i_writeImpl(ovf::OVFVersion_T aFormat, const LocationInfo &aLocInfo, ComObjPtr<Progress> &aProgress);
    219219    HRESULT i_writeOPCImpl(ovf::OVFVersion_T aFormat, const LocationInfo &aLocInfo, ComObjPtr<Progress> &aProgress);
    220     HRESULT i_writeOCIImpl(const LocationInfo &aLocInfo, ComObjPtr<Progress> &aProgress);
     220    HRESULT i_writeCloudImpl(const LocationInfo &aLocInfo, ComObjPtr<Progress> &aProgress);
    221221
    222222    HRESULT i_writeFS(TaskOVF *pTask);
     
    224224    HRESULT i_writeFSOVA(TaskOVF *pTask, AutoWriteLockBase& writeLock);
    225225    HRESULT i_writeFSOPC(TaskOPC *pTask);
    226     HRESULT i_writeFSOCI(TaskOCI *pTask);
     226    HRESULT i_writeFSCloud(TaskCloud *pTask);
    227227    HRESULT i_writeFSImpl(TaskOVF *pTask, AutoWriteLockBase &writeLock, RTVFSFSSTREAM hVfsFssDst);
    228228    HRESULT i_writeBufferToFile(RTVFSFSSTREAM hVfsFssDst, const char *pszFilename, const void *pvContent, size_t cbContent);
  • trunk/src/VBox/Main/include/ApplianceImplPrivate.h

    r75312 r75766  
    231231    uint32_t                  m_cPwProvided;
    232232
    233     struct OciExportData_T {
     233    struct CloudExportData_T {
    234234        Utf8Str strDisplayMachineName;
    235235        Utf8Str strProfileFilePath;
     
    245245    };
    246246
    247     OciExportData_T m_OciExportData;
     247    CloudExportData_T m_CloudExportData;
    248248};
    249249
     
    346346
    347347
    348 class Appliance::TaskOCI : public ThreadTask
     348class Appliance::TaskCloud : public ThreadTask
    349349{
    350350public:
     
    354354    };
    355355
    356     TaskOCI(Appliance *aThat,
     356    TaskCloud(Appliance *aThat,
    357357            TaskType aType,
    358358            LocationInfo aLocInfo,
    359359            ComObjPtr<Progress> &aProgress)
    360       : ThreadTask("TaskOCI"),
     360      : ThreadTask("TaskCloud"),
    361361        pAppliance(aThat),
    362362        taskType(aType),
     
    365365        rc(S_OK)
    366366    {
    367         m_strTaskName = "OCIExpt";
    368     }
    369 
    370     ~TaskOCI()
     367        m_strTaskName = "CloudExpt";
     368    }
     369
     370    ~TaskCloud()
    371371    {
    372372    }
     
    383383    void handler()
    384384    {
    385         Appliance::i_exportOCIThreadTask(this);
     385        Appliance::i_exportCloudThreadTask(this);
    386386    }
    387387};
  • trunk/src/VBox/Main/src-server/ApplianceImpl.cpp

    r74217 r75766  
    10351035            break;
    10361036        }
    1037         case ExportOCI:
    1038             cOperations = 1 + 7;
     1037        case ExportCloud:
     1038            cOperations = 1 + 9;//7
    10391039            ulTotalOperationsWeight = 100*cOperations;
    10401040            m->ulWeightForXmlOperation = 100;
     
    12681268
    12691269/**
    1270  * Worker for TaskOCI::handler.
     1270 * Worker for TaskCloud::handler.
    12711271 * @thread  pTask       The task.
    12721272 */
    12731273/* static */
    1274 void Appliance::i_exportOCIThreadTask(TaskOCI *pTask)
     1274void Appliance::i_exportCloudThreadTask(TaskCloud *pTask)
    12751275{
    12761276    LogFlowFuncEnter();
     
    12821282    switch (pTask->taskType)
    12831283    {
    1284         case TaskOCI::Export:
    1285             pTask->rc = pAppliance->i_writeFSOCI(pTask);
     1284        case TaskCloud::Export:
     1285            pTask->rc = pAppliance->i_writeFSCloud(pTask);
    12861286            break;
    12871287
     
    12991299
    13001300/* static */
    1301 DECLCALLBACK(int) Appliance::TaskOCI::updateProgress(unsigned uPercent, void *pvUser)
    1302 {
    1303     Appliance::TaskOCI* pTask = *(Appliance::TaskOCI**)pvUser;
     1301DECLCALLBACK(int) Appliance::TaskCloud::updateProgress(unsigned uPercent, void *pvUser)
     1302{
     1303    Appliance::TaskCloud* pTask = *(Appliance::TaskCloud**)pvUser;
    13041304
    13051305    if (    pTask
     
    13351335    else if (strUri.startsWith("OCI://", Utf8Str::CaseInsensitive)) /* OCI service (storage or compute) */
    13361336    {
    1337         locInfo.storageType = VFSType_OCI;
     1337        locInfo.storageType = VFSType_Cloud;
    13381338        strUri = strUri.substr(sizeof("OCI://") - 1);
    13391339    }
  • trunk/src/VBox/Main/src-server/ApplianceImplExport.cpp

    r75434 r75766  
    3939
    4040#include "ApplianceImplPrivate.h"
    41 
    42 //#include "OCIProvider.h"
    43 //#include "CloudClientImpl.h"
    44 //#include "OCIProfile.h"
    45 //#include "CloudAPI.h"
    46 //#include "VBoxOCIApi.h"
    47 //#include "VBoxOCIRest.h"
    4841
    4942using namespace std;
     
    666659     * the error straight from the API call but a tiny bit later through the
    667660     * Progress object. */
    668     if (m->locInfo.storageType == VFSType_OCI)//(isCloudDestination(aPath))
     661    if (m->locInfo.storageType == VFSType_Cloud)//(isCloudDestination(aPath))
    669662    {
    670663        rc = S_OK;
     
    672665        try
    673666        {
    674             switch (m->locInfo.storageType)
    675             {
    676                 case VFSType_OCI:
    677                     rc = i_writeOCIImpl(m->locInfo, progress);
    678                     break;
    679 //              case VFSType_GCP:
    680 //                  rc = i_writeGCPImpl(m->locInfo, progress);
    681 //                  break;
    682 //              case VFSType_Amazon:
    683 //                  rc = i_writeAmazonImpl(m->locInfo, progress);
    684 //                  break;
    685 //              case VFSType_Azure:
    686 //                  rc = i_writeAzureImpl(m->locInfo, progress);
    687 //                  break;
    688                 default:
    689                     break;
    690             }
    691 
     667            rc = i_writeCloudImpl(m->locInfo, progress);
    692668        }
    693669        catch (HRESULT aRC)
     
    859835
    860836
    861 HRESULT Appliance::i_writeOCIImpl(const LocationInfo &aLocInfo, ComObjPtr<Progress> &aProgress)
     837HRESULT Appliance::i_writeCloudImpl(const LocationInfo &aLocInfo, ComObjPtr<Progress> &aProgress)
    862838{
    863839    HRESULT rc;
     
    901877            {
    902878                throw rc = setError(VBOX_E_OBJECT_NOT_FOUND,
    903                                     tr("Strange, but nothing to export to OCI after preparation steps"));
     879                                    tr("There are no images to export to Cloud after preparation steps"));
    904880            }
    905881
     
    910886                vsdescThis->i_findByType(VirtualSystemDescriptionType_Name);
    911887            if (machineName.empty())
    912                 throw setError(VBOX_E_FILE_ERROR, tr("OCI: VM name wasn't found"));
    913             m->m_OciExportData.strDisplayMachineName = machineName.front()->strVBoxCurrent;
    914             LogRel(("Exported machine name: %s\n", m->m_OciExportData.strDisplayMachineName.c_str()));
    915 
    916             m->m_OciExportData.strBootImageName = strBootLocation;
    917             LogRel(("Exported image: %s\n", m->m_OciExportData.strBootImageName.c_str()));
     888                throw setError(VBOX_E_FILE_ERROR, tr("Cloud: VM name wasn't found"));
     889            m->m_CloudExportData.strDisplayMachineName = machineName.front()->strVBoxCurrent;
     890            LogRel(("Exported machine name: %s\n", m->m_CloudExportData.strDisplayMachineName.c_str()));
     891
     892            m->m_CloudExportData.strBootImageName = strBootLocation;
     893            LogRel(("Exported image: %s\n", m->m_CloudExportData.strBootImageName.c_str()));
    918894
    919895            if (aLocInfo.strPath.isEmpty())
    920896                throw rc = setError(VBOX_E_OBJECT_NOT_FOUND,
    921                                     tr("OCI: Cloud user profile wasn't found"));
    922 
    923             m->m_OciExportData.strProfileName = aLocInfo.strPath;
    924             LogRel(("OCI profile name: %s\n", m->m_OciExportData.strProfileName.c_str()));
     897                                    tr("Cloud: Cloud user profile wasn't found"));
     898
     899            m->m_CloudExportData.strProfileName = aLocInfo.strPath;
     900            LogRel(("profile name: %s\n", m->m_CloudExportData.strProfileName.c_str()));
    925901
    926902            Utf8Str strInstanceShapeId;
     
    929905            if (shapeId.empty())
    930906                throw rc = setError(VBOX_E_OBJECT_NOT_FOUND,
    931                                     tr("OCI: Shape of instance wasn't found"));
    932 
    933             m->m_OciExportData.strInstanceShapeId = shapeId.front()->strVBoxCurrent;
    934             LogRel(("OCI shape: %s\n", m->m_OciExportData.strInstanceShapeId.c_str()));
     907                                    tr("Cloud: Shape of instance wasn't found"));
     908
     909            m->m_CloudExportData.strInstanceShapeId = shapeId.front()->strVBoxCurrent;
     910            LogRel(("Shape: %s\n", m->m_CloudExportData.strInstanceShapeId.c_str()));
    935911
    936912            std::list<VirtualSystemDescriptionEntry*> domainName =
     
    938914            if (domainName.empty())
    939915                throw rc = setError(VBOX_E_OBJECT_NOT_FOUND,
    940                                     tr("OCI: Available domain wasn't found"));
    941 
    942             m->m_OciExportData.strDomainName = domainName.front()->strVBoxCurrent;
    943             LogRel(("OCI available domain name: %s\n", m->m_OciExportData.strDomainName.c_str()));
     916                                    tr("Cloud: Available domain wasn't found"));
     917
     918            m->m_CloudExportData.strDomainName = domainName.front()->strVBoxCurrent;
     919            LogRel(("Available domain name: %s\n", m->m_CloudExportData.strDomainName.c_str()));
    944920
    945921            std::list<VirtualSystemDescriptionEntry*> bootDiskSize =
     
    947923            if (bootDiskSize.empty())
    948924                throw rc = setError(VBOX_E_OBJECT_NOT_FOUND,
    949                                     tr("OCI: Boot disk size wasn't found"));
    950 
    951             m->m_OciExportData.strBootDiskSize = bootDiskSize.front()->strVBoxCurrent;
    952             LogRel(("OCI boot disk size: %s\n", m->m_OciExportData.strBootDiskSize.c_str()));
     925                                    tr("Cloud: Boot disk size wasn't found"));
     926
     927            m->m_CloudExportData.strBootDiskSize = bootDiskSize.front()->strVBoxCurrent;
     928            LogRel(("Boot disk size: %s\n", m->m_CloudExportData.strBootDiskSize.c_str()));
    953929
    954930            std::list<VirtualSystemDescriptionEntry*> bucketId =
     
    956932            if (bucketId.empty())
    957933                throw rc = setError(VBOX_E_OBJECT_NOT_FOUND,
    958                                     tr("OCI: Bucket wasn't found"));
    959 
    960             m->m_OciExportData.strBucketId = bucketId.front()->strVBoxCurrent;
    961             LogRel(("OCI bucket name: %s\n", m->m_OciExportData.strBucketId.c_str()));
     934                                    tr("Cloud: Bucket wasn't found"));
     935
     936            m->m_CloudExportData.strBucketId = bucketId.front()->strVBoxCurrent;
     937            LogRel(("bucket name: %s\n", m->m_CloudExportData.strBucketId.c_str()));
    962938
    963939            std::list<VirtualSystemDescriptionEntry*> subnet =
     
    965941            if (subnet.empty())
    966942                throw rc = setError(VBOX_E_OBJECT_NOT_FOUND,
    967                                     tr("OCI: Subnet wasn't found"));
    968 
    969             m->m_OciExportData.strSubnet = subnet.front()->strVBoxCurrent;
    970             LogRel(("OCI Subnet name: %s\n", m->m_OciExportData.strSubnet.c_str()));
     943                                    tr("Cloud: Subnet wasn't found"));
     944
     945            m->m_CloudExportData.strSubnet = subnet.front()->strVBoxCurrent;
     946            LogRel(("Subnet name: %s\n", m->m_CloudExportData.strSubnet.c_str()));
    971947
    972948            std::list<VirtualSystemDescriptionEntry*> publicIP =
     
    974950            if (publicIP.empty())
    975951                throw rc = setError(VBOX_E_OBJECT_NOT_FOUND,
    976                                     tr("OCI: Public IP setting wasn't found"));
    977 
    978             m->m_OciExportData.fPublicIP = (publicIP.front()->strVBoxCurrent == "true") ? true : false;
    979             LogRel(("OCI public IP: %s\n", m->m_OciExportData.fPublicIP ? "yes" : "no"));
     952                                    tr("Cloud: Public IP setting wasn't found"));
     953
     954            m->m_CloudExportData.fPublicIP = (publicIP.front()->strVBoxCurrent == "true") ? true : false;
     955            LogRel(("public IP: %s\n", m->m_CloudExportData.fPublicIP ? "yes" : "no"));
    980956        }
    981957
     
    984960
    985961        // Initialize our worker task
    986         TaskOCI* task = NULL;
     962        TaskCloud* task = NULL;
    987963        try
    988964        {
    989             task = new Appliance::TaskOCI(this, TaskOCI::Export, aLocInfo, aProgress);
     965            task = new Appliance::TaskCloud(this, TaskCloud::Export, aLocInfo, aProgress);
    990966        }
    991967        catch(...)
    992968        {
    993969            throw rc = setError(VBOX_E_OBJECT_NOT_FOUND,
    994                                 tr("Could not create TaskOCI object for exporting to OCI"));
     970                                tr("Could not create TaskCloud object for exporting to Cloud"));
    995971        }
    996972
     
    23432319 * instance with this image in the OCI Compute service.
    23442320 */
    2345 HRESULT Appliance::i_writeFSOCI(TaskOCI *pTask)
     2321HRESULT Appliance::i_writeFSCloud(TaskCloud *pTask)
    23462322{
    2347     LogRel(("Appliance::i_writeFSOCI\n"));
    23482323    LogFlowFuncEnter();
    23492324
     
    23522327    hrc = mVirtualBox->COMGETTER(CloudProviderManager)(cpm.asOutParam());
    23532328    Utf8Str strProviderName("OCI");
    2354     ComPtr<ICloudProvider> ociProvider;
    2355     hrc = cpm->GetProviderByShortName(Bstr(strProviderName.c_str()).raw(), ociProvider.asOutParam());
    2356     ComPtr<ICloudProfile> ociProfile;
    2357     hrc = ociProvider->GetProfileByName(Bstr(m->m_OciExportData.strProfileName.c_str()).raw(), ociProfile.asOutParam());
     2329    ComPtr<ICloudProvider> cloudProvider;
     2330    hrc = cpm->GetProviderByShortName(Bstr(strProviderName.c_str()).raw(), cloudProvider.asOutParam());
     2331    ComPtr<ICloudProfile> cloudProfile;
     2332    hrc = cloudProvider->GetProfileByName(Bstr(m->m_CloudExportData.strProfileName.c_str()).raw(), cloudProfile.asOutParam());
    23582333    ComObjPtr<ICloudClient> cloudClient;
    2359     hrc = ociProfile->CreateCloudClient(cloudClient.asOutParam());
     2334    hrc = cloudProfile->CreateCloudClient(cloudClient.asOutParam());
    23602335
    23612336    if (SUCCEEDED(hrc))
    23622337    {
    2363         LogRel(("Appliance::i_writeFSOCI(): calling OCICloudClient::exportVM\n"));
    2364 
    2365         /// @todo that's to be moved to ExpTack, but we need to have that method
    2366         /// exposed in .xidl
     2338        LogRel(("Appliance::i_writeFSCloud(): calling CloudClient::ExportLaunchVM\n"));
     2339
    23672340        if (m->virtualSystemDescriptions.size() == 1) {
    23682341            ComPtr<IVirtualBox> VBox(mVirtualBox);
    23692342
    23702343            pTask->pProgress->init(mVirtualBox, static_cast<IAppliance*>(this),
    2371                          Bstr("Exporting VM to OCI...").raw(),
     2344                         Bstr("Exporting VM to Cloud...").raw(),
    23722345                         TRUE /* aCancelable */,
    23732346                         5, // ULONG cOperations,
    23742347                         1000, // ULONG ulTotalOperationsWeight,
    2375                          Bstr("Exporting VM to OCI...").raw(), // aFirstOperationDescription
     2348                         Bstr("Exporting VM to Cloud...").raw(), // aFirstOperationDescription
    23762349                         10); // ULONG ulFirstOperationWeight,
    23772350
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