VirtualBox

Changeset 61003 in vbox for trunk


Ignore:
Timestamp:
May 17, 2016 1:41:19 PM (8 years ago)
Author:
vboxsync
Message:

Main/Appliance: get rid of "Controller" in storage controller names (following the convention established in 4.x) for importing true OVF appliances, and clean up settings.h including, as it limits recompilation

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

Legend:

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

    r60334 r61003  
    55
    66/*
    7  * Copyright (C) 2006-2013 Oracle Corporation
     7 * Copyright (C) 2006-2016 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2020
    2121/* VBox includes */
    22 #include <VBox/settings.h>
    2322#include "VirtualSystemDescriptionWrap.h"
    2423#include "ApplianceWrap.h"
     
    129128    HRESULT i_searchUniqueDiskImageFilePath(Utf8Str& aName) const;
    130129    HRESULT i_setUpProgress(ComObjPtr<Progress> &pProgress,
    131                             const Bstr &bstrDescription,
     130                            const Utf8Str &strDescription,
    132131                            SetUpProgressMode mode);
    133132    void i_waitForAsyncProgress(ComObjPtr<Progress> &pProgressThis, ComPtr<IProgress> &pProgressAsync);
     
    179178    void i_convertDiskAttachmentValues(const ovf::HardDiskController &hdc,
    180179                                       uint32_t ulAddressOnParent,
    181                                        Bstr &controllerType,
     180                                       Utf8Str &controllerType,
    182181                                       int32_t &lControllerPort,
    183182                                       int32_t &lDevice);
  • trunk/src/VBox/Main/include/ApplianceImplPrivate.h

    r60337 r61003  
    55
    66/*
    7  * Copyright (C) 2006-2013 Oracle Corporation
     7 * Copyright (C) 2006-2016 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    3636//
    3737////////////////////////////////////////////////////////////////////////////////
     38
     39namespace settings
     40{
     41    struct AttachedDevice;
     42}
    3843
    3944typedef std::pair<Utf8Str, Utf8Str> STRPAIR;
     
    285290{
    286291    ComPtr<IMachine>    pMachine;
    287     Bstr                controllerType;
     292    Utf8Str             controllerName;
    288293    int32_t             lControllerPort;        // 0-29 for SATA
    289294    int32_t             lDevice;                // IDE: 0 or 1, otherwise 0 always
  • trunk/src/VBox/Main/src-server/ApplianceImpl.cpp

    r60334 r61003  
    55
    66/*
    7  * Copyright (C) 2008-2013 Oracle Corporation
     7 * Copyright (C) 2008-2016 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    949949 *
    950950 * @param pProgress
    951  * @param bstrDescription
     951 * @param strDescription
    952952 * @param mode
    953953 * @return
    954954 */
    955955HRESULT Appliance::i_setUpProgress(ComObjPtr<Progress> &pProgress,
    956                                    const Bstr &bstrDescription,
     956                                   const Utf8Str &strDescription,
    957957                                   SetUpProgressMode mode)
    958958{
     
    10491049
    10501050    rc = pProgress->init(mVirtualBox, static_cast<IAppliance*>(this),
    1051                          bstrDescription.raw(),
     1051                         Bstr(strDescription).raw(),
    10521052                         TRUE /* aCancelable */,
    10531053                         cOperations, // ULONG cOperations,
    10541054                         ulTotalOperationsWeight, // ULONG ulTotalOperationsWeight,
    1055                          bstrDescription.raw(), // CBSTR bstrFirstOperationDescription,
     1055                         Bstr(strDescription).raw(), // CBSTR bstrFirstOperationDescription,
    10561056                         m->ulWeightForXmlOperation); // ULONG ulFirstOperationWeight,
    10571057    return rc;
  • trunk/src/VBox/Main/src-server/ApplianceImplImport.cpp

    r60341 r61003  
    469469            if (vsysThis.pelmVBoxMachine)
    470470            {
    471                 settings::StorageControllersList &llControllers = pNewDesc->m->pConfig->storageMachine.llStorageControllers;
     471                settings::StorageControllersList &llControllers = pNewDesc->m->pConfig->hardwareMachine.storage.llStorageControllers;
    472472                settings::StorageControllersList::iterator it3;
    473473                for (it3 = llControllers.begin();
     
    20122012    {
    20132013        delete task;
    2014         throw rc = setError(VBOX_E_OBJECT_NOT_FOUND, 
     2014        throw rc = setError(VBOX_E_OBJECT_NOT_FOUND,
    20152015                            tr("Could not create TaskOVF object for importing OVF data into VirtualBox"));
    20162016    }
     
    22812281 * @param hdc in: the HardDiskController structure to attach to.
    22822282 * @param ulAddressOnParent in: the AddressOnParent parameter from OVF.
    2283  * @param controllerType out: the name of the hard disk controller to attach to (e.g. "IDE Controller").
     2283 * @param controllerName out: the name of the hard disk controller to attach to (e.g. "IDE Controller").
    22842284 * @param lControllerPort out: the channel (controller port) of the controller to attach to.
    22852285 * @param lDevice out: the device number to attach to.
    22862286 */
    22872287void Appliance::i_convertDiskAttachmentValues(const ovf::HardDiskController &hdc,
    2288                                             uint32_t ulAddressOnParent,
    2289                                             Bstr &controllerType,
    2290                                             int32_t &lControllerPort,
    2291                                             int32_t &lDevice)
     2288                                              uint32_t ulAddressOnParent,
     2289                                              Utf8Str &controllerName,
     2290                                              int32_t &lControllerPort,
     2291                                              int32_t &lDevice)
    22922292{
    22932293    Log(("Appliance::i_convertDiskAttachmentValues: hdc.system=%d, hdc.fPrimary=%d, ulAddressOnParent=%d\n",
     
    23042304            // respectively. For the secondary IDE controller, the device number is always 1 because
    23052305            // the master device is reserved for the CD-ROM drive.
    2306             controllerType = Bstr("IDE Controller");
     2306            controllerName = "IDE";
    23072307            switch (ulAddressOnParent)
    23082308            {
     
    23562356
    23572357        case ovf::HardDiskController::SATA:
    2358             controllerType = Bstr("SATA Controller");
     2358            controllerName = "SATA";
    23592359            lControllerPort = (long)ulAddressOnParent;
    23602360            lDevice = (long)0;
     
    23642364        {
    23652365            if(hdc.strControllerType.compare("lsilogicsas")==0)
    2366                 controllerType = Bstr("SAS Controller");
     2366                controllerName = "SAS";
    23672367            else
    2368                 controllerType = Bstr("SCSI Controller");
     2368                controllerName = "SCSI";
    23692369            lControllerPort = (long)ulAddressOnParent;
    23702370            lDevice = (long)0;
     
    29942994    {
    29952995        ComPtr<IStorageController> pController;
    2996         Bstr bstrName(L"SCSI Controller");
     2996        Utf8Str strName("SCSI Controller");
    29972997        StorageBus_T busType = StorageBus_SCSI;
    29982998        StorageControllerType_T controllerType;
     
    30033003        {
    30043004            // OVF treats LsiLogicSas as a SCSI controller but VBox considers it a class of its own
    3005             bstrName = L"SAS Controller";
     3005            strName = "SAS Controller";
    30063006            busType = StorageBus_SAS;
    30073007            controllerType = StorageControllerType_LsiLogicSas;
     
    30143014                           hdcVBox.c_str());
    30153015
    3016         rc = pNewMachine->AddStorageController(bstrName.raw(), busType, pController.asOutParam());
     3016        rc = pNewMachine->AddStorageController(Bstr(strName).raw(), busType, pController.asOutParam());
    30173017        if (FAILED(rc)) throw rc;
    30183018        rc = pController->COMSETTER(ControllerType)(controllerType);
     
    30883088                MyHardDiskAttachment mhda;
    30893089                mhda.pMachine = pNewMachine;
    3090                 mhda.controllerType = bstrName;
     3090                mhda.controllerName = bstrName;
    30913091                mhda.lControllerPort = 0;
    30923092                mhda.lDevice = 0;
     
    30943094                Log(("Attaching floppy\n"));
    30953095
    3096                 rc = sMachine->AttachDevice(mhda.controllerType.raw(),
     3096                rc = sMachine->AttachDevice(Bstr(mhda.controllerName).raw(),
    30973097                                            mhda.lControllerPort,
    30983098                                            mhda.lDevice,
     
    33233323                i_convertDiskAttachmentValues(hdc,
    33243324                                              ovfVdisk.ulAddressOnParent,
    3325                                               mhda.controllerType,        // Bstr
     3325                                              mhda.controllerName,
    33263326                                              mhda.lControllerPort,
    33273327                                              mhda.lDevice);
     
    33553355                        throw rc;
    33563356
    3357                     rc = sMachine->AttachDevice(mhda.controllerType.raw(),// wstring name
     3357                    rc = sMachine->AttachDevice(Bstr(mhda.controllerName).raw(),// name
    33583358                                                mhda.lControllerPort,     // long controllerPort
    33593359                                                mhda.lDevice,             // long device
     
    33653365                else
    33663366                {
    3367                     rc = sMachine->AttachDevice(mhda.controllerType.raw(),// wstring name
     3367                    rc = sMachine->AttachDevice(Bstr(mhda.controllerName).raw(),// name
    33683368                                                mhda.lControllerPort,     // long controllerPort
    33693369                                                mhda.lDevice,             // long device
     
    35793579     * attachments pointing to the last hard disk image, which causes import
    35803580     * failures. A long fixed bug, however the OVF files are long lived. */
    3581     settings::StorageControllersList &llControllers = config.storageMachine.llStorageControllers;
     3581    settings::StorageControllersList &llControllers = config.hardwareMachine.storage.llStorageControllers;
    35823582    Guid hdUuid;
    35833583    uint32_t cDisks = 0;
     
    37923792
    37933793        // for each storage controller...
    3794         for (settings::StorageControllersList::iterator sit = config.storageMachine.llStorageControllers.begin();
    3795              sit != config.storageMachine.llStorageControllers.end();
     3794        for (settings::StorageControllersList::iterator sit = config.hardwareMachine.storage.llStorageControllers.begin();
     3795             sit != config.hardwareMachine.storage.llStorageControllers.end();
    37963796             ++sit)
    37973797        {
     
    39103910                break;
    39113911            } // for (settings::AttachedDevicesList::const_iterator dit = sc.llAttachedDevices.begin();
    3912         } // for (settings::StorageControllersList::const_iterator sit = config.storageMachine.llStorageControllers.begin();
     3912        } // for (settings::StorageControllersList::const_iterator sit = config.hardwareMachine.storage.llStorageControllers.begin();
    39133913
    39143914            // no disk with such a UUID found:
     
    40934093    HRESULT rc = S_OK;
    40944094
    4095     settings::StorageControllersList &llControllers = config->storageMachine.llStorageControllers;
     4095    settings::StorageControllersList &llControllers = config->hardwareMachine.storage.llStorageControllers;
    40964096    settings::StorageControllersList::iterator itscl;
    40974097    for (itscl = llControllers.begin();
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