VirtualBox

Changeset 16668 in vbox for trunk


Ignore:
Timestamp:
Feb 11, 2009 2:12:11 PM (16 years ago)
Author:
vboxsync
Message:

OVF: create new IAppliance::read() method instead of reading in constructor; IVirtualBox::openAppliance -> createAppliance; IAppliance->importAppliance -> importMachines

Location:
trunk/src/VBox
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageImport.cpp

    r16662 r16668  
    428428                    CHECK_ERROR_BREAK(aVirtualSystemDescriptions[i],
    429429                                      SetFinalValues(ComSafeArrayAsInParam(aEnabled),
    430                                                      ComSafeArrayAsInParam(aFinalValues)));
     430                                                     ComSafeArrayAsInParam(aFinalValues),
     431                                                     ComSafeArrayAsInParam(aExtraConfigValues)));
    431432
    432433            } // for (unsigned i = 0; i < cVirtualSystemDescriptions; ++i)
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxImportAppliance.cpp

    r16662 r16668  
    128128
    129129    virtual void restoreDefaults() {}
    130     virtual void putBack (QVector<QString>& aFinalValues, QVector<BOOL>& aFinalStates)
     130    virtual void putBack (QVector<BOOL>& aFinalStates, QVector<QString>& aFinalValues, QVector<QString>& aFinalExtraValues)
    131131    {
    132132        for (int i = 0; i < childCount(); ++i)
    133             child (i)->putBack (aFinalValues, aFinalStates);
     133            child (i)->putBack (aFinalStates, aFinalValues, aFinalExtraValues);
    134134    }
    135135
     
    162162    }
    163163
    164     virtual void putBack (QVector<QString>& aFinalValues, QVector<BOOL>& aFinalStates)
     164    virtual void putBack (QVector<BOOL>& aFinalStates, QVector<QString>& aFinalValues, QVector<QString>& aFinalExtraValues)
    165165    {
    166166        /* Resize the vectors */
    167167        unsigned long count = mDesc.GetCount();
     168        aFinalStates.resize (count);
    168169        aFinalValues.resize (count);
    169         aFinalStates.resize (count);
     170        aFinalExtraValues.resize (count);
    170171        /* Recursively fill the vectors */
    171         ModelItem::putBack (aFinalValues, aFinalStates);
     172        ModelItem::putBack (aFinalStates, aFinalValues, aFinalExtraValues);
    172173        /* Set all final values at once */
    173         mDesc.SetFinalValues (aFinalStates, aFinalValues);
     174        mDesc.SetFinalValues (aFinalStates, aFinalValues, aFinalExtraValues);
    174175    }
    175176
     
    202203    {}
    203204
    204     virtual void putBack (QVector<QString>& aFinalValues, QVector<BOOL>& aFinalStates)
    205     {
     205    virtual void putBack (QVector<BOOL>& aFinalStates, QVector<QString>& aFinalValues, QVector<QString>& aFinalExtraValues)
     206    {
     207        aFinalStates[mNumber] = mCheckState == Qt::Checked;
    206208        aFinalValues[mNumber] = mConfigValue;
    207         aFinalStates[mNumber] = mCheckState == Qt::Checked;
    208         ModelItem::putBack (aFinalValues, aFinalStates);
     209        aFinalExtraValues[mNumber] = mExtraConfigValue;
     210        ModelItem::putBack (aFinalStates, aFinalValues, aFinalExtraValues);
    209211    }
    210212
     
    927929void VirtualSystemModel::putBack()
    928930{
    929     QVector<QString> v1;
    930     QVector<BOOL> v2;
    931     mRootItem->putBack (v1, v2);
     931    QVector<BOOL> v1;
     932    QVector<QString> v2;
     933    QVector<QString> v3;
     934    mRootItem->putBack (v1, v2, v3);
    932935}
    933936
  • trunk/src/VBox/Main/ApplianceImpl.cpp

    r16662 r16668  
    13311331                pNewDesc->addEntry(VirtualSystemDescriptionType_USBController, "", "", "");
    13321332
     1333            NetworksMap::const_iterator itN;
     1334            for (itN = m->mapNetworks.begin();
     1335                 itN != m->mapNetworks.end();
     1336                 ++itN)
     1337            {
     1338                const Network &nw = itN->second;
     1339                pNewDesc->addEntry(VirtualSystemDescriptionType_LogicalNetwork,
     1340                                   "",
     1341                                   nw.strNetworkName,
     1342                                   nw.strNetworkName);
     1343            }
     1344
    13331345            /* Network Controller */
    13341346            // @todo: there is no hardware specification in the OVF file; supposedly the
     
    13551367                     ++nwIt, ++a)
    13561368                {
    1357                     Utf8Str nwController = *nwIt; // @todo: not used yet
    1358                     pNewDesc->addEntry(VirtualSystemDescriptionType_NetworkAdapter, "", "", toString<ULONG>(nwAdapterVBox));
     1369                    Utf8Str strNetwork = *nwIt; // logical network to connect to
     1370                    pNewDesc->addEntry(VirtualSystemDescriptionType_NetworkAdapter,
     1371                                       "",      // ref
     1372                                       strNetwork,      // orig
     1373                                       toString<ULONG>(nwAdapterVBox),   // conf
     1374                                       Utf8StrFmt("network=%s", strNetwork.c_str()));       // extra conf
    13591375                }
    13601376            }
     
    22522268
    22532269STDMETHODIMP VirtualSystemDescription::SetFinalValues(ComSafeArrayIn(BOOL, aEnabled),
    2254                                                       ComSafeArrayIn(IN_BSTR, aFinalValues))
    2255 {
    2256     CheckComArgSafeArrayNotNull(aFinalValues);
     2270                                                      ComSafeArrayIn(IN_BSTR, argConfigValues),
     2271                                                      ComSafeArrayIn(IN_BSTR, argExtraConfigValues))
     2272{
     2273    CheckComArgSafeArrayNotNull(argConfigValues);
     2274    CheckComArgSafeArrayNotNull(argExtraConfigValues);
    22572275
    22582276    AutoCaller autoCaller(this);
     
    22612279    AutoWriteLock alock(this);
    22622280
    2263     com::SafeArray <IN_BSTR> values(ComSafeArrayInArg(aFinalValues));
    2264     if (values.size() != m->descriptions.size())
     2281    com::SafeArray<IN_BSTR> aConfigValues(ComSafeArrayInArg(argConfigValues));
     2282    com::SafeArray<IN_BSTR> aExtraConfigValues(ComSafeArrayInArg(argExtraConfigValues));
     2283
     2284    if (    (aConfigValues.size() != m->descriptions.size())
     2285         || (aExtraConfigValues.size() != m->descriptions.size())
     2286       )
    22652287        return E_INVALIDARG;
    22662288
     
    22742296
    22752297        if (aEnabled[i])
    2276             vsde.strConfig = values[i];
     2298        {
     2299            vsde.strConfig = aConfigValues[i];
     2300            vsde.strExtraConfig = aExtraConfigValues[i];
     2301        }
    22772302        else
    22782303            vsde.type = VirtualSystemDescriptionType_Ignore;
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r16662 r16668  
    30133013    <const name="CDROM" value="10" />
    30143014    <const name="Floppy" value="11" />
    3015     <const name="NetworkAdapter" value="12" />
    3016     <const name="USBController" value="13" />
    3017     <const name="SoundCard" value="14" />
     3015    <const name="LogicalNetwork" value="12" />
     3016    <const name="NetworkAdapter" value="13" />
     3017    <const name="USBController" value="14" />
     3018    <const name="SoundCard" value="15" />
    30183019
    30193020  </enum>
     
    30873088        in aConfigValues[] will contain a qualified path specification where the hard disk image should
    30883089        be copied to; this target image will then be registered with VirtualBox.
    3089         The matching item in the aRefs[] array must contain a integer specifying the hard disk controller
    3090         to connect the image to. This number must be the same as the integer used by one of the hard disk
    3091         controller items (SCSI, SATA or IDE; see above).
     3090        The matching item in the aExtraConfigValues[] array must contain a string of the "controller=&lt;ctrl&gt;"
     3091        format, where &lt;ctrl&gt; must be an integer specifying the hard disk controller to connect the image to.
     3092        That number must be the index of an array item with one of the hard disk controller types
     3093        (HarddiskControllerSCSI, HarddiskControllerSATA, HarddiskControllerIDE).
    30923094      </li>
    30933095      <li>
    3094         "NetworkAdapter": a network adapter. (todo document)
     3096        "LogicalNetwork": a logical network to which virtual machines can connect. This is taken from
     3097        the Network section in the OVF that is shared between several virtual systems. OVF has no
     3098        formal description of how the network shall be set up (e.g. whether to use NAT or host interface
     3099        networking), but OVFs typically name the logical networks "nat" or "bridged" to suggest such
     3100        a configuration.
     3101      </li>
     3102      <li>
     3103        "NetworkAdapter": a network adapter. The array item in aConfigValues[] will specify the hardware
     3104        for the network adapter, whereas the array item in aExtraConfigValues[] will have a string
     3105        of the "network=&lt;nw&gt;" format, where &lt;nw&gt; must be one of the networks as specified with the
     3106        LogicalNetwork type.
    30953107      </li>
    30963108      <li>
     
    31383150        and SoundCard.
    31393151
    3140         For the configuration values, if you pass in the same array as returned
    3141         in the aConfigValues array from getDescription(), the configuration remains unchanged.
    3142         Please see the documentation for getDescription() for valid configuration values
    3143         for the individual array item types. If the corresponding item in the aEnabled array
    3144         is false, the configuration value is gnored.
     3152        For the configuration and "extra" configuration values, if you pass in the same arrays
     3153        as returned in the aConfigValues and aExtraConfigValues arrays from getDescription(),
     3154        the configuration remains unchanged. Please see the documentation for getDescription()
     3155        for valid configuration values for the individual array item types. If the
     3156        corresponding item in the aEnabled array is false, the configuration value is ignored.
    31453157      </desc>
    31463158
     
    31493161      </param>
    31503162
    3151       <param name="aFinalValues" type="wstring" dir="in" safearray="yes">
     3163      <param name="aConfigValues" type="wstring" dir="in" safearray="yes">
    31523164        <desc></desc>
    31533165      </param>
    31543166
     3167      <param name="aExtraConfigValues" type="wstring" dir="in" safearray="yes">
     3168        <desc></desc>
     3169      </param>
    31553170    </method>
    31563171
  • trunk/src/VBox/Main/include/ApplianceImpl.h

    r16662 r16668  
    155155
    156156    STDMETHOD(SetFinalValues)(ComSafeArrayIn(BOOL, aEnabled),
    157                               ComSafeArrayIn(IN_BSTR, aFinalValues));
     157                              ComSafeArrayIn(IN_BSTR, aConfigValues),
     158                              ComSafeArrayIn(IN_BSTR, aExtraConfigValues));
    158159
    159160    STDMETHOD(GetWarnings)(ComSafeArrayOut(BSTR, aWarnings));
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