VirtualBox

Changeset 29087 in vbox for trunk


Ignore:
Timestamp:
May 5, 2010 2:20:30 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
61143
Message:

Main/OVF: support LsiLogicSas controller import & export; remove obsolete ifdefs

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/ApplianceImplExport.cpp

    r28958 r29087  
    174174
    175175        ComPtr<IStorageController> pIDEController;
    176 #ifdef VBOX_WITH_AHCI
    177176        ComPtr<IStorageController> pSATAController;
    178 #endif /* VBOX_WITH_AHCI */
    179 #ifdef VBOX_WITH_LSILOGIC
    180177        ComPtr<IStorageController> pSCSIController;
    181 #endif /* VBOX_WITH_LSILOGIC */
     178        ComPtr<IStorageController> pSASController;
    182179        for (size_t j = 0; j < nwControllers.size(); ++j)
    183180        {
     
    188185                && pIDEController.isNull())
    189186                pIDEController = nwControllers[j];
    190 #ifdef VBOX_WITH_AHCI
    191187            else if (   eType == StorageBus_SATA
    192188                     && pSATAController.isNull())
    193189                pSATAController = nwControllers[j];
    194 #endif /* VBOX_WITH_AHCI */
    195 #ifdef VBOX_WITH_LSILOGIC
    196190            else if (   eType == StorageBus_SCSI
    197191                     && pSATAController.isNull())
    198192                pSCSIController = nwControllers[j];
    199 #endif /* VBOX_WITH_LSILOGIC */
     193            else if (   eType == StorageBus_SAS
     194                     && pSASController.isNull())
     195                pSASController = nwControllers[j];
    200196        }
    201197
     
    229225        }
    230226
    231 #ifdef VBOX_WITH_AHCI
    232227//     <const name="HardDiskControllerSATA" value="7" />
    233228        if (!pSATAController.isNull())
     
    240235                               strVbox);
    241236        }
    242 #endif // VBOX_WITH_AHCI
    243 
    244 #ifdef VBOX_WITH_LSILOGIC
     237
    245238//     <const name="HardDiskControllerSCSI" value="8" />
    246239        if (!pSCSIController.isNull())
     
    265258                throw rc;
    266259        }
    267 #endif // VBOX_WITH_LSILOGIC
     260
     261        if (!pSASController.isNull())
     262        {
     263            // VirtualBox considers the SAS controller a class of its own but in OVF
     264            // it should be a SCSI controller
     265            Utf8Str strVbox = "LsiLogicSas";
     266            lSCSIControllerIndex = (int32_t)pNewDesc->m->llDescriptions.size();
     267            pNewDesc->addEntry(VirtualSystemDescriptionType_HardDiskControllerSCSI,
     268                               Utf8StrFmt("%d", lSCSIControllerIndex),
     269                               strVbox,
     270                               strVbox);
     271        }
    268272
    269273//     <const name="HardDiskImage" value="9" />
  • trunk/src/VBox/Main/ApplianceImplImport.cpp

    r28957 r29087  
    416416
    417417                    case ovf::HardDiskController::SATA:
     418                        /* Check for the constrains */
     419                        if (cSATAused < 1)
    418420                        {
    419 #ifdef VBOX_WITH_AHCI
    420                             /* Check for the constrains */
    421                             if (cSATAused < 1)
    422                             {
    423                                 // @todo: figure out the SATA types
    424                                 /* We only support a plain AHCI controller, so use them always */
    425                                 pNewDesc->addEntry(VirtualSystemDescriptionType_HardDiskControllerSATA,
    426                                                    strControllerID,
    427                                                    hdc.strControllerType,
    428                                                    "AHCI");
    429                             }
    430                             else
    431                             {
    432                                 /* Warn only once */
    433                                 if (cSATAused == 1)
    434                                     addWarning(tr("The virtual system \"%s\" requests support for more than one SATA controller, but VirtualBox has support for only one"),
    435                                                vsysThis.strName.c_str());
    436 
    437                             }
    438                             ++cSATAused;
    439                             break;
    440 #else /* !VBOX_WITH_AHCI */
    441                             addWarning(tr("The virtual system \"%s\" requests at least one SATA controller but this version of VirtualBox does not provide a SATA controller emulation"),
    442                                       vsysThis.strName.c_str());
    443 #endif /* !VBOX_WITH_AHCI */
     421                            // @todo: figure out the SATA types
     422                            /* We only support a plain AHCI controller, so use them always */
     423                            pNewDesc->addEntry(VirtualSystemDescriptionType_HardDiskControllerSATA,
     424                                                strControllerID,
     425                                                hdc.strControllerType,
     426                                                "AHCI");
    444427                        }
     428                        else
     429                        {
     430                            /* Warn only once */
     431                            if (cSATAused == 1)
     432                                addWarning(tr("The virtual system \"%s\" requests support for more than one SATA controller, but VirtualBox has support for only one"),
     433                                            vsysThis.strName.c_str());
     434
     435                        }
     436                        ++cSATAused;
     437                    break;
    445438
    446439                    case ovf::HardDiskController::SCSI:
     440                        /* Check for the constrains */
     441                        if (cSCSIused < 1)
    447442                        {
    448 #ifdef VBOX_WITH_LSILOGIC
    449                             /* Check for the constrains */
    450                             if (cSCSIused < 1)
    451                             {
    452                                 Utf8Str hdcController = "LsiLogic";
    453                                 if (!hdc.strControllerType.compare("BusLogic", Utf8Str::CaseInsensitive))
    454                                     hdcController = "BusLogic";
    455                                 pNewDesc->addEntry(VirtualSystemDescriptionType_HardDiskControllerSCSI,
    456                                                    strControllerID,
    457                                                    hdc.strControllerType,
    458                                                    hdcController);
    459                             }
    460                             else
    461                                 addWarning(tr("The virtual system \"%s\" requests support for an additional SCSI controller of type \"%s\" with ID %s, but VirtualBox presently supports only one SCSI controller."),
    462                                            vsysThis.strName.c_str(),
    463                                            hdc.strControllerType.c_str(),
    464                                            strControllerID.c_str());
    465                             ++cSCSIused;
    466                             break;
    467 #else /* !VBOX_WITH_LSILOGIC */
    468                             addWarning(tr("The virtual system \"%s\" requests at least one SATA controller but this version of VirtualBox does not provide a SCSI controller emulation"),
    469                                        vsysThis.strName.c_str());
    470 #endif /* !VBOX_WITH_LSILOGIC */
     443                            Utf8Str hdcController = "LsiLogic";
     444                            if (!hdc.strControllerType.compare("lsilogicsas", Utf8Str::CaseInsensitive))
     445                                hdcController = "LsiLogicSas";
     446                            else if (!hdc.strControllerType.compare("BusLogic", Utf8Str::CaseInsensitive))
     447                                hdcController = "BusLogic";
     448                            pNewDesc->addEntry(VirtualSystemDescriptionType_HardDiskControllerSCSI,
     449                                                strControllerID,
     450                                                hdc.strControllerType,
     451                                                hdcController);
    471452                        }
     453                        else
     454                            addWarning(tr("The virtual system \"%s\" requests support for an additional SCSI controller of type \"%s\" with ID %s, but VirtualBox presently supports only one SCSI controller."),
     455                                        vsysThis.strName.c_str(),
     456                                        hdc.strControllerType.c_str(),
     457                                        strControllerID.c_str());
     458                        ++cSCSIused;
     459                    break;
    472460                }
    473461            }
     
    16471635        if (FAILED(rc)) throw rc;
    16481636    }
    1649 #ifdef VBOX_WITH_AHCI
     1637
    16501638    /* Hard disk controller SATA */
    16511639    std::list<VirtualSystemDescriptionEntry*> vsdeHDCSATA = vsdescThis->findByType(VirtualSystemDescriptionType_HardDiskControllerSATA);
     
    16671655                           hdcVBox.c_str());
    16681656    }
    1669 #endif /* VBOX_WITH_AHCI */
    1670 
    1671 #ifdef VBOX_WITH_LSILOGIC
     1657
    16721658    /* Hard disk controller SCSI */
    16731659    std::list<VirtualSystemDescriptionEntry*> vsdeHDCSCSI = vsdescThis->findByType(VirtualSystemDescriptionType_HardDiskControllerSCSI);
     
    16781664    {
    16791665        ComPtr<IStorageController> pController;
     1666        Bstr bstrName(L"SCSI Controller");
     1667        StorageBus_T busType = StorageBus_SCSI;
    16801668        StorageControllerType_T controllerType;
    16811669        const Utf8Str &hdcVBox = vsdeHDCSCSI.front()->strVbox;
    16821670        if (hdcVBox == "LsiLogic")
    16831671            controllerType = StorageControllerType_LsiLogic;
     1672        else if (hdcVBox == "LsiLogicSas")
     1673        {
     1674            // OVF treats LsiLogicSas as a SCSI controller but VBox considers it a class of its own
     1675            bstrName = L"SAS Controller";
     1676            busType = StorageBus_SAS;
     1677            controllerType = StorageControllerType_LsiLogic;
     1678        }
    16841679        else if (hdcVBox == "BusLogic")
    16851680            controllerType = StorageControllerType_BusLogic;
     
    16891684                           hdcVBox.c_str());
    16901685
    1691         rc = pNewMachine->AddStorageController(Bstr("SCSI Controller"), StorageBus_SCSI, pController.asOutParam());
     1686        rc = pNewMachine->AddStorageController(bstrName, busType, pController.asOutParam());
    16921687        if (FAILED(rc)) throw rc;
    16931688        rc = pController->COMSETTER(ControllerType)(controllerType);
    16941689        if (FAILED(rc)) throw rc;
    16951690    }
    1696 #endif /* VBOX_WITH_LSILOGIC */
    16971691
    16981692    /* Now its time to register the machine before we add any hard disks */
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r29028 r29087  
    35993599      <li>
    36003600        "HardDiskControllerSCSI": a SCSI hard disk controller. There can be at most one such item.
    3601         The items in @a aOvfValues[] and @a aVBoxValues[] will either be "LsiLogic" or "BusLogic".
     3601        The items in @a aOvfValues[] and @a aVBoxValues[] will either be "LsiLogic", "BusLogic" or
     3602        "LsiLogicSas". (Note that in OVF, the LsiLogicSas controller is treated as a SCSI controller
     3603        whereas VirtualBox considers it a class of storage controllers of its own; see
     3604        <link to="StorageControllerType" />).
    36023605        The matching item in the @a aRefs[] array will be used as with IDE controllers (see above).
    36033606      </li>
  • trunk/src/VBox/Main/include/ovfreader.h

    r28957 r29087  
    257257    ControllerSystemType    system;             // one of IDE, SATA, SCSI
    258258
    259     iprt::MiniString        strControllerType;  // controller subtype (Item/ResourceSubType); e.g. "LsiLogic"; can be empty (esp. for IDE)
     259    iprt::MiniString        strControllerType;
     260            // controller subtype (Item/ResourceSubType); e.g. "LsiLogic"; can be empty (esp. for IDE)
     261            // note that we treat LsiLogicSAS as a SCSI controller (system == SCSI) even though VirtualBox
     262            // treats it as a fourth class besides IDE, SATA, SCSI
    260263
    261264    uint32_t                ulAddress;          // controller index; this is determined heuristically by the OVF reader and will
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