VirtualBox

Changeset 28596 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Apr 22, 2010 2:02:59 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
60441
Message:

Main/OVF: fix IDE controller export broken by r60336

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

Legend:

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

    r28165 r28596  
    12441244void VirtualSystemDescription::addEntry(VirtualSystemDescriptionType_T aType,
    12451245                                        const Utf8Str &strRef,
    1246                                         const Utf8Str &aOrigValue,
    1247                                         const Utf8Str &aAutoValue,
     1246                                        const Utf8Str &aOvfValue,
     1247                                        const Utf8Str &aVboxValue,
    12481248                                        uint32_t ulSizeMB,
    12491249                                        const Utf8Str &strExtraConfig /*= ""*/)
     
    12531253    vsde.type = aType;
    12541254    vsde.strRef = strRef;
    1255     vsde.strOvf = aOrigValue;
    1256     vsde.strVbox = aAutoValue;
     1255    vsde.strOvf = aOvfValue;
     1256    vsde.strVbox = aVboxValue;
    12571257    vsde.strExtraConfig = strExtraConfig;
    12581258    vsde.ulSizeMB = ulSizeMB;
  • trunk/src/VBox/Main/ApplianceImplExport.cpp

    r28531 r28596  
    222222                lIDEControllerPrimaryIndex = (int32_t)pNewDesc->m->llDescriptions.size();
    223223                pNewDesc->addEntry(VirtualSystemDescriptionType_HardDiskControllerIDE,
    224                                    Utf8StrFmt("%d", lIDEControllerPrimaryIndex),
    225                                    strVbox,
    226                                    strVbox);
     224                                   Utf8StrFmt("%d", lIDEControllerPrimaryIndex),        // strRef
     225                                   strVbox,     // aOvfValue
     226                                   strVbox);    // aVboxValue
    227227                lIDEControllerSecondaryIndex = lIDEControllerPrimaryIndex + 1;
    228228                pNewDesc->addEntry(VirtualSystemDescriptionType_HardDiskControllerIDE,
     
    664664                                            XMLStack &stack)
    665665{
     666    LogFlowFunc(("ENTER appliance %p\n", this));
     667
    666668    xml::ElementNode *pelmVirtualSystem;
    667669    if (enFormat == OVF_0_9)
     
    865867        {
    866868            const VirtualSystemDescriptionEntry &desc = *itD;
     869
     870            LogFlowFunc(("Loop %u: handling description entry ulIndex=%u, type=%s, strRef=%s, strOvf=%s, strVbox=%s, strExtraConfig=%s\n",
     871                         uLoop,
     872                         desc.ulIndex,
     873                         (  desc.type == VirtualSystemDescriptionType_HardDiskControllerIDE ? "HardDiskControllerIDE"
     874                          : desc.type == VirtualSystemDescriptionType_HardDiskControllerSATA ? "HardDiskControllerSATA"
     875                          : desc.type == VirtualSystemDescriptionType_HardDiskControllerSCSI ? "HardDiskControllerSCSI"
     876                          : desc.type == VirtualSystemDescriptionType_HardDiskImage ? "HardDiskImage"
     877                          : Utf8StrFmt("%d", desc.type).c_str()),
     878                         desc.strRef.c_str(),
     879                         desc.strOvf.c_str(),
     880                         desc.strVbox.c_str(),
     881                         desc.strExtraConfig.c_str()));
    867882
    868883            ovf::ResourceType_T type = (ovf::ResourceType_T)0;      // if this becomes != 0 then we do stuff
     
    944959                        strResourceSubType = desc.strVbox;
    945960
    946                         if (desc.strRef != "1")
     961                        if (!lIDEPrimaryControllerIndex)
    947962                        {
    948963                            // first IDE controller:
     
    10631078                        size_t pos1 = desc.strExtraConfig.find("controller=");
    10641079                        size_t pos2 = desc.strExtraConfig.find("channel=");
     1080                        int32_t lControllerIndex = -1;
    10651081                        if (pos1 != Utf8Str::npos)
    10661082                        {
    1067                             int32_t lControllerIndex = -1;
    10681083                            RTStrToInt32Ex(desc.strExtraConfig.c_str() + pos1 + 11, NULL, 0, &lControllerIndex);
    10691084                            if (lControllerIndex == lIDEPrimaryControllerIndex)
     
    10781093                        if (pos2 != Utf8Str::npos)
    10791094                            RTStrToInt32Ex(desc.strExtraConfig.c_str() + pos2 + 8, NULL, 0, &lAddressOnParent);
     1095
     1096                        LogFlowFunc(("HardDiskImage details: pos1=%d, pos2=%d, lControllerIndex=%d, lIDEPrimaryControllerIndex=%d, lIDESecondaryControllerIndex=%d, ulParent=%d, lAddressOnParent=%d\n",
     1097                                     pos1, pos2, lControllerIndex, lIDEPrimaryControllerIndex, lIDESecondaryControllerIndex, ulParent, lAddressOnParent));
    10801098
    10811099                        if (    !ulParent
     
    12931311HRESULT Appliance::writeFS(const LocationInfo &locInfo, const OVFFormat enFormat, ComObjPtr<Progress> &pProgress)
    12941312{
    1295     LogFlowFuncEnter();
    1296     LogFlowFunc(("Appliance %p\n", this));
     1313    LogFlowFunc(("ENTER appliance %p\n", this));
    12971314
    12981315    AutoCaller autoCaller(this);
  • trunk/src/VBox/Main/ApplianceImplImport.cpp

    r28531 r28596  
    395395                {
    396396                    case ovf::HardDiskController::IDE:
     397                        /* Check for the constrains */
     398                        if (cIDEused < 4)
    397399                        {
    398                             /* Check for the constrains */
    399                             /* @todo: I'm very confused! Are these bits *one* controller or
    400                                is every port/bus declared as an extra controller. */
    401                             if (cIDEused < 4)
    402                             {
    403                                 // @todo: figure out the IDE types
    404                                 /* Use PIIX4 as default */
    405                                 Utf8Str strType = "PIIX4";
    406                                 if (!hdc.strControllerType.compare("PIIX3", Utf8Str::CaseInsensitive))
    407                                     strType = "PIIX3";
    408                                 else if (!hdc.strControllerType.compare("ICH6", Utf8Str::CaseInsensitive))
    409                                     strType = "ICH6";
    410                                 pNewDesc->addEntry(VirtualSystemDescriptionType_HardDiskControllerIDE,
    411                                                    strControllerID,
    412                                                    hdc.strControllerType,
    413                                                    strType);
    414                             }
    415                             else
    416                             {
    417                                 /* Warn only once */
    418                                 if (cIDEused == 1)
    419                                     addWarning(tr("The virtual \"%s\" system requests support for more than one IDE controller, but VirtualBox has support for only one."),
    420                                                vsysThis.strName.c_str());
    421 
    422                             }
    423                             ++cIDEused;
    424                             break;
     400                            // @todo: figure out the IDE types
     401                            /* Use PIIX4 as default */
     402                            Utf8Str strType = "PIIX4";
     403                            if (!hdc.strControllerType.compare("PIIX3", Utf8Str::CaseInsensitive))
     404                                strType = "PIIX3";
     405                            else if (!hdc.strControllerType.compare("ICH6", Utf8Str::CaseInsensitive))
     406                                strType = "ICH6";
     407                            pNewDesc->addEntry(VirtualSystemDescriptionType_HardDiskControllerIDE,
     408                                               strControllerID,         // strRef
     409                                               hdc.strControllerType,   // aOvfValue
     410                                               strType);                // aVboxValue
    425411                        }
     412                        else
     413                            /* Warn only once */
     414                            if (cIDEused == 2)
     415                                addWarning(tr("The virtual \"%s\" system requests support for more than two IDE controller channels, but VirtualBox supports only two."),
     416                                            vsysThis.strName.c_str());
     417
     418                        ++cIDEused;
     419                    break;
    426420
    427421                    case ovf::HardDiskController::SATA:
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r28557 r28596  
    35343534      <li>
    35353535        "HardDiskControllerIDE": an IDE hard disk controller. There can be at most two such items.
    3536         This has no value in @a aOvfValues[] or @a aVBoxValues[].
     3536        An optional value in @a aOvfValues[] and @a aVBoxValues[] can be "PIIX3" or "PIIX4" to specify
     3537        the type of IDE controller; this corresponds to the ResourceSubType element which VirtualBox
     3538        writes into the OVF.
    35373539        The matching item in the @a aRefs[] array will contain an integer that items of the "Harddisk"
    35383540        type can use to specify which hard disk controller a virtual disk should be connected to.
     
    86188620          data. Pass 0 for an infinite timeout.
    86198621        </desc>
    8620       </param>     
     8622      </param>
    86218623      <param name="size" type="unsigned long long" dir="in">
    86228624        <desc>
  • trunk/src/VBox/Main/include/ApplianceImpl.h

    r28165 r28596  
    260260    void addEntry(VirtualSystemDescriptionType_T aType,
    261261                  const Utf8Str &strRef,
    262                   const Utf8Str &aOrigValue,
    263                   const Utf8Str &aAutoValue,
     262                  const Utf8Str &aOvfValue,
     263                  const Utf8Str &aVboxValue,
    264264                  uint32_t ulSizeMB = 0,
    265265                  const Utf8Str &strExtraConfig = "");
Note: See TracChangeset for help on using the changeset viewer.

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