VirtualBox

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


Ignore:
Timestamp:
Mar 3, 2009 3:08:59 PM (16 years ago)
Author:
vboxsync
Message:

OVF: rename config array items to have them make sense on export as well.

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

Legend:

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

    r17287 r17291  
    18001800                throw setError(VBOX_E_FILE_ERROR,
    18011801                               tr("Missing guest OS type"));
    1802             const Utf8Str &strOsTypeVBox = vsdeOS.front()->strConfig;
     1802            const Utf8Str &strOsTypeVBox = vsdeOS.front()->strVbox;
    18031803
    18041804            /* Now that we know the base system get our internal defaults based on that. */
     
    18131813                throw setError(VBOX_E_FILE_ERROR,
    18141814                               tr("Missing VM name"));
    1815             const Utf8Str &strNameVBox = vsdeName.front()->strConfig;
     1815            const Utf8Str &strNameVBox = vsdeName.front()->strVbox;
    18161816            rc = pVirtualBox->CreateMachine(Bstr(strNameVBox), Bstr(strOsTypeVBox),
    18171817                                                 Bstr(), Guid(),
     
    18281828            std::list<VirtualSystemDescriptionEntry*> vsdeRAM = vsdescThis->findByType(VirtualSystemDescriptionType_Memory);
    18291829            ComAssertMsgThrow(vsdeRAM.size() == 1, ("RAM size missing"), E_FAIL);
    1830             const Utf8Str &memoryVBox = vsdeRAM.front()->strConfig;
     1830            const Utf8Str &memoryVBox = vsdeRAM.front()->strVbox;
    18311831            ULONG tt = (ULONG)RTStrToUInt64(memoryVBox.c_str());
    18321832            rc = pNewMachine->COMSETTER(MemorySize)(tt);
     
    18511851            if (vsdeAudioAdapter.size() > 0)
    18521852            {
    1853                 const Utf8Str& audioAdapterVBox = vsdeAudioAdapter.front()->strConfig;
     1853                const Utf8Str& audioAdapterVBox = vsdeAudioAdapter.front()->strVbox;
    18541854                if (RTStrICmp(audioAdapterVBox, "null") != 0)
    18551855                {
     
    19031903                     ++nwIt, ++a)
    19041904                {
    1905                     const Utf8Str &nwTypeVBox = (*nwIt)->strConfig;
     1905                    const Utf8Str &nwTypeVBox = (*nwIt)->strVbox;
    19061906                    uint32_t tt1 = RTStrToUInt32(nwTypeVBox.c_str());
    19071907                    ComPtr<INetworkAdapter> nwVBox;
     
    19451945                if (FAILED(rc)) throw rc;
    19461946
    1947                 const char *pcszIDEType = vsdeHDCIDE.front()->strConfig.c_str();
     1947                const char *pcszIDEType = vsdeHDCIDE.front()->strVbox.c_str();
    19481948                if (!strcmp(pcszIDEType, "PIIX3"))
    19491949                    rc = biosSettings->COMSETTER(IDEControllerType)(IDEControllerType_PIIX3);
     
    19641964            if (vsdeHDCSATA.size() > 0)
    19651965            {
    1966                 const Utf8Str &hdcVBox = vsdeHDCIDE.front()->strConfig;
     1966                const Utf8Str &hdcVBox = vsdeHDCIDE.front()->strVbox;
    19671967                if (hdcVBox == "AHCI")
    19681968                {
     
    20342034                        VirtualSystemDescriptionEntry *vsdeHD = *itHD;
    20352035
    2036                         const char *pcszDstFilePath = vsdeHD->strConfig.c_str();
     2036                        const char *pcszDstFilePath = vsdeHD->strVbox.c_str();
    20372037                        /* Check if the destination file exists already or the
    20382038                         * destination path is empty. */
     
    24132413                                                      ComSafeArrayOut(BSTR, aRefs),
    24142414                                                      ComSafeArrayOut(BSTR, aOrigValues),
    2415                                                       ComSafeArrayOut(BSTR, aConfigValues),
     2415                                                      ComSafeArrayOut(BSTR, aVboxValues),
    24162416                                                      ComSafeArrayOut(BSTR, aExtraConfigValues))
    24172417{
     
    24192419        ComSafeArrayOutIsNull(aRefs) ||
    24202420        ComSafeArrayOutIsNull(aOrigValues) ||
    2421         ComSafeArrayOutIsNull(aConfigValues) ||
     2421        ComSafeArrayOutIsNull(aVboxValues) ||
    24222422        ComSafeArrayOutIsNull(aExtraConfigValues))
    24232423        return E_POINTER;
     
    24322432    com::SafeArray<BSTR> sfaRefs(c);
    24332433    com::SafeArray<BSTR> sfaOrigValues(c);
    2434     com::SafeArray<BSTR> sfaConfigValues(c);
     2434    com::SafeArray<BSTR> sfaVboxValues(c);
    24352435    com::SafeArray<BSTR> sfaExtraConfigValues(c);
    24362436
     
    24482448        bstr.cloneTo(&sfaRefs[i]);
    24492449
    2450         bstr = vsde.strOrig;
     2450        bstr = vsde.strOvf;
    24512451        bstr.cloneTo(&sfaOrigValues[i]);
    24522452
    2453         bstr = vsde.strConfig;
    2454         bstr.cloneTo(&sfaConfigValues[i]);
     2453        bstr = vsde.strVbox;
     2454        bstr.cloneTo(&sfaVboxValues[i]);
    24552455
    24562456        bstr = vsde.strExtraConfig;
     
    24612461    sfaRefs.detachTo(ComSafeArrayOutArg(aRefs));
    24622462    sfaOrigValues.detachTo(ComSafeArrayOutArg(aOrigValues));
    2463     sfaConfigValues.detachTo(ComSafeArrayOutArg(aConfigValues));
     2463    sfaVboxValues.detachTo(ComSafeArrayOutArg(aVboxValues));
    24642464    sfaExtraConfigValues.detachTo(ComSafeArrayOutArg(aExtraConfigValues));
    24652465
     
    24722472 */
    24732473STDMETHODIMP VirtualSystemDescription::SetFinalValues(ComSafeArrayIn(BOOL, aEnabled),
    2474                                                       ComSafeArrayIn(IN_BSTR, argConfigValues),
     2474                                                      ComSafeArrayIn(IN_BSTR, argVboxValues),
    24752475                                                      ComSafeArrayIn(IN_BSTR, argExtraConfigValues))
    24762476{
    2477     CheckComArgSafeArrayNotNull(argConfigValues);
     2477    CheckComArgSafeArrayNotNull(argVboxValues);
    24782478    CheckComArgSafeArrayNotNull(argExtraConfigValues);
    24792479
     
    24832483    AutoWriteLock alock(this);
    24842484
    2485     com::SafeArray<IN_BSTR> aConfigValues(ComSafeArrayInArg(argConfigValues));
     2485    com::SafeArray<IN_BSTR> aVboxValues(ComSafeArrayInArg(argVboxValues));
    24862486    com::SafeArray<IN_BSTR> aExtraConfigValues(ComSafeArrayInArg(argExtraConfigValues));
    24872487
    2488     if (    (aConfigValues.size() != m->descriptions.size())
     2488    if (    (aVboxValues.size() != m->descriptions.size())
    24892489         || (aExtraConfigValues.size() != m->descriptions.size())
    24902490       )
     
    25012501        if (aEnabled[i])
    25022502        {
    2503             vsde.strConfig = aConfigValues[i];
     2503            vsde.strVbox = aVboxValues[i];
    25042504            vsde.strExtraConfig = aExtraConfigValues[i];
    25052505        }
     
    25602560    vsde.type = aType;
    25612561    vsde.strRef = strRef;
    2562     vsde.strOrig = aOrigValue;
    2563     vsde.strConfig = aAutoValue;
     2562    vsde.strOvf = aOrigValue;
     2563    vsde.strVbox = aAutoValue;
    25642564    vsde.strExtraConfig = strExtraConfig;
    25652565
     
    27442744        ComPtr<IBIOSSettings> pBiosSettings;
    27452745        pBiosSettings = mBIOSSettings;
    2746         Utf8Str strConfig;
     2746        Utf8Str strVbox;
    27472747        IDEControllerType_T ctlr;
    27482748        rc = pBiosSettings->COMGETTER(IDEControllerType)(&ctlr);
     
    27502750        switch(ctlr)
    27512751        {
    2752             case IDEControllerType_PIIX3: strConfig = "PIIX3"; break;
    2753             case IDEControllerType_PIIX4: strConfig = "PIIX4"; break;
    2754             case IDEControllerType_ICH6: strConfig = "ICH6"; break;
     2752            case IDEControllerType_PIIX3: strVbox = "PIIX3"; break;
     2753            case IDEControllerType_PIIX4: strVbox = "PIIX4"; break;
     2754            case IDEControllerType_ICH6: strVbox = "ICH6"; break;
    27552755        }
    27562756
    2757         if (strConfig.length())
     2757        if (strVbox.length())
    27582758        {
    27592759            strIdeControllerID = Utf8StrFmt("%RI32", uControllerId++);
    2760             pNewDesc->addEntry(VirtualSystemDescriptionType_HardDiskControllerIDE, strIdeControllerID, strConfig, "");
     2760            pNewDesc->addEntry(VirtualSystemDescriptionType_HardDiskControllerIDE, strIdeControllerID, strVbox, "");
    27612761        }
    27622762
     
    27712771        {
    27722772            strSataControllerID = Utf8StrFmt("%RI32", uControllerId++);
    2773             pNewDesc->addEntry(VirtualSystemDescriptionType_HardDiskControllerSATA, strSataControllerID, strConfig, "");
     2773            pNewDesc->addEntry(VirtualSystemDescriptionType_HardDiskControllerSATA, strSataControllerID, strVbox, "");
    27742774        }
    27752775#endif // VBOX_WITH_AHCI
     
    28062806            if (FAILED(rc)) throw rc;
    28072807
     2808            Bstr bstrName;
     2809            rc = pHardDisk->COMGETTER(Name)(bstrName.asOutParam());
     2810
    28082811            pNewDesc->addEntry(VirtualSystemDescriptionType_HardDiskImage,
    2809                                "", // hd.strDiskId,
     2812                               Utf8Str(bstrName), // hd.strDiskId,
    28102813                               "", // di.strHref,
    28112814                               "",
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r17287 r17291  
    31023102      <link to="VirtualSystemDescriptionType" /> enum value in the array item in aTypes[]. In each case,
    31033103      the array item with the same index in aOrigValue[] will contain the original value as contained
    3104       in the OVF file (just for informational purposes), and the corresponding item in aConfigValues[]
     3104      in the OVF file (just for informational purposes), and the corresponding item in aVboxValues[]
    31053105      will contain a suggested value to be used for VirtualBox. Depending on the description type,
    31063106      the aExtraConfigValues[] array item may also be used.
     
    31093109      <li>
    31103110        "OS": the guest operating system type. There must be exactly one such array item on import. The
    3111         corresponding item in aConfigValues[] contains the suggested guest operating system for VirtualBox.
     3111        corresponding item in aVboxValues[] contains the suggested guest operating system for VirtualBox.
    31123112        This will be one of the values listed in <link to="IVirtualBox::guestOSTypes" />. The corresponding
    3113         item in aOrigValues[] will contain a numerical value that described the operating system in the OVF
     3113        item in aOvfValues[] will contain a numerical value that described the operating system in the OVF
    31143114        (see <link to="CIMOSType" />).
    31153115      </li>
     
    31173117        "Name": the name to give to the new virtual machine. There can be at most one such array item;
    31183118        if none is present on import, then an automatic name will be created from the operating system
    3119         type. The correponding item im aOrigValues[] will contain the suggested virtual machine name
    3120         from the OVF file, and aConfigValues[] will contain a suggestion for a unique VirtualBox
     3119        type. The correponding item im aOvfValues[] will contain the suggested virtual machine name
     3120        from the OVF file, and aVboxValues[] will contain a suggestion for a unique VirtualBox
    31213121        <link to="IMachine" /> name that does not exist yet.
    31223122      </li>
     
    31313131      <li>
    31323132        "HarddiskControllerIDE": an IDE hard disk controller. There can be at most one such item. This
    3133         has no value in aOrigValues[] or aConfigValues[].
     3133        has no value in aOvfValues[] or aVboxValues[].
    31343134        The matching item in the aRefs[] array will contain an integer that items of the "Harddisk"
    31353135        type can use to specify which hard disk controller a virtual disk should be connected to.
     
    31373137      <li>
    31383138        "HarddiskControllerSATA": an SATA hard disk controller. There can be at most one such item. This
    3139         has no value in aOrigValues[] or aConfigValues[].
     3139        has no value in aOvfValues[] or aVboxValues[].
    31403140        The matching item in the aRefs[] array will be used as with IDE controllers (see above).
    31413141      </li>
    31423142      <li>
    31433143        "HarddiskControllerSCSI": a SCSI hard disk controller. There can be at most one such item.
    3144         The items in aOrigValues[] and aConfigValues[] will either be "LsiLogic" or "BusLogic".
     3144        The items in aOvfValues[] and aVboxValues[] will either be "LsiLogic" or "BusLogic".
    31453145        The matching item in the aRefs[] array will be used as with IDE controllers (see above).
    31463146      </li>
    31473147      <li>
    31483148        "HardDiskImage": a virtual hard disk, most probably as a reference to an image file. There can be an
    3149         arbitrary number of these items, one for each virtual disk image that accompanies the OVF. The
    3150         array item in aOrigValues[] will contain the file specification from the OVF file, whereas the
    3151         item in aConfigValues[] will contain a qualified path specification to where the hard disk image
    3152         should be copied; this target image will then be registered with VirtualBox.
     3149        arbitrary number of these items, one for each virtual disk image that accompanies the OVF.
     3150
     3151        The array item in aOvfValues[] will contain the file specification from the OVF file,
     3152        whereas the item in aVboxValues[] will contain a qualified path specification to where
     3153        VirtualBox uses the hard disk image. This means that on import the image will be copied
     3154        and converted from the "ovf" location to the "vbox" location; on export, this will be
     3155        handled the other way round. On import, the target image will also be registered with VirtualBox.
     3156
    31533157        The matching item in the aExtraConfigValues[] array must contain a string of the following
    31543158        format: "controller=&lt;index&gt;;channel=&lt;c&gt;"
     
    31693173      </li>
    31703174      <li>
    3171         "NetworkAdapter": a network adapter. The array item in aConfigValues[] will specify the hardware
     3175        "NetworkAdapter": a network adapter. The array item in aVboxValues[] will specify the hardware
    31723176        for the network adapter, whereas the array item in aExtraConfigValues[] will have a string
    31733177        of the "network=&lt;nw&gt;" format, where &lt;nw&gt; must be one of the networks as specified with the
     
    31923196      </param>
    31933197
    3194       <param name="aOrigValues" type="wstring" dir="out" safearray="yes">
     3198      <param name="aOvfValues" type="wstring" dir="out" safearray="yes">
    31953199        <desc></desc>
    31963200      </param>
    31973201
    3198       <param name="aConfigValues" type="wstring" dir="out" safearray="yes">
     3202      <param name="aVboxValues" type="wstring" dir="out" safearray="yes">
    31993203        <desc></desc>
    32003204      </param>
     
    32183222        and SoundCard.
    32193223
    3220         For the configuration and "extra" configuration values, if you pass in the same arrays
    3221         as returned in the aConfigValues and aExtraConfigValues arrays from getDescription(),
     3224        For the "vbox" and "extra configuration" values, if you pass in the same arrays
     3225        as returned in the aVboxValues and aExtraConfigValues arrays from getDescription(),
    32223226        the configuration remains unchanged. Please see the documentation for getDescription()
    32233227        for valid configuration values for the individual array item types. If the
     
    32293233      </param>
    32303234
    3231       <param name="aConfigValues" type="wstring" dir="in" safearray="yes">
     3235      <param name="aVboxValues" type="wstring" dir="in" safearray="yes">
    32323236        <desc></desc>
    32333237      </param>
  • trunk/src/VBox/Main/include/ApplianceImpl.h

    r17287 r17291  
    110110    VirtualSystemDescriptionType_T type;    // type of this entry
    111111    Utf8Str strRef;                         // reference number (hard disk controllers only)
    112     Utf8Str strOrig;                        // original OVF value (type-dependent)
    113     Utf8Str strConfig;                      // configuration value (type-dependent)
     112    Utf8Str strOvf;                         // original OVF value (type-dependent)
     113    Utf8Str strVbox;                        // configuration value (type-dependent)
    114114    Utf8Str strExtraConfig;                 // extra configuration key=value strings (type-dependent)
    115115};
     
    154154    STDMETHOD(GetDescription)(ComSafeArrayOut(VirtualSystemDescriptionType_T, aTypes),
    155155                              ComSafeArrayOut(BSTR, aRefs),
    156                               ComSafeArrayOut(BSTR, aOrigValues),
    157                               ComSafeArrayOut(BSTR, aConfigValues),
     156                              ComSafeArrayOut(BSTR, aOvfValues),
     157                              ComSafeArrayOut(BSTR, aVboxValues),
    158158                              ComSafeArrayOut(BSTR, aExtraConfigValues));
    159159
    160160    STDMETHOD(SetFinalValues)(ComSafeArrayIn(BOOL, aEnabled),
    161                               ComSafeArrayIn(IN_BSTR, aConfigValues),
     161                              ComSafeArrayIn(IN_BSTR, aVboxValues),
    162162                              ComSafeArrayIn(IN_BSTR, aExtraConfigValues));
    163163
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