VirtualBox

Changeset 17965 in vbox


Ignore:
Timestamp:
Mar 16, 2009 6:36:34 PM (16 years ago)
Author:
vboxsync
Message:

OVF: import/export VM descriptions (comments)

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

Legend:

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

    r17963 r17965  
    154154{
    155155    Utf8Str             strName;                // copy of VirtualSystem/@id
     156
     157    Utf8Str             strDescription;         // copy of VirtualSystem/Info content
    156158
    157159    CIMOSType_T         cimos;
     
    692694        const char *pcszTypeAttr = (pTypeAttr) ? pTypeAttr->getValue() : "";
    693695
    694         if (!strcmp(pcszElemName, "EulaSection"))
     696        if (!strcmp(pcszElemName, "Info"))
     697        {
     698            // the "Info" section directly under VirtualSystem is where our export routine
     699            // chooses to save the VM description (comments), so re-import it from there too
     700            vsys.strDescription = pelmThis->getValue();
     701        }
     702        else if (!strcmp(pcszElemName, "EulaSection"))
    695703        {
    696704         /* <EulaSection>
     
    12931301                               nameVBox);
    12941302
     1303            if (!vsysThis.strDescription.isEmpty())
     1304                pNewDesc->addEntry(VirtualSystemDescriptionType_Description,
     1305                                    "",
     1306                                    vsysThis.strDescription,
     1307                                    vsysThis.strDescription);
     1308
    12951309            /* Now that we know the OS type, get our internal defaults based on that. */
    12961310            ComPtr<IGuestOSType> pGuestOSType;
     
    18841898                                                 pNewMachine.asOutParam());
    18851899            if (FAILED(rc)) throw rc;
     1900
     1901            // and the description
     1902            std::list<VirtualSystemDescriptionEntry*> vsdeDescription = vsdescThis->findByType(VirtualSystemDescriptionType_Description);
     1903            if (vsdeDescription.size())
     1904            {
     1905                const Utf8Str &strDescription = vsdeDescription.front()->strVbox;
     1906                rc = pNewMachine->COMSETTER(Description)(Bstr(strDescription));
     1907                if (FAILED(rc)) throw rc;
     1908            }
    18861909
    18871910            if (!task->progress.isNull())
     
    25342557
    25352558            xml::ElementNode *pelmVirtualSystem = pelmVirtualSystemCollection->createChild("VirtualSystem");
    2536             /* xml::ElementNode *pelmVirtualSystemInfo = */ pelmVirtualSystem->createChild("Info");      // @todo put in description here after implementing an entry for it
     2559
     2560            xml::ElementNode *pelmVirtualSystemInfo = pelmVirtualSystem->createChild("Info");
     2561            std::list<VirtualSystemDescriptionEntry*> llDescription = vsdescThis->findByType(VirtualSystemDescriptionType_Description);
     2562            if (llDescription.size())
     2563                pelmVirtualSystemInfo->addContent(llDescription.front()->strVbox);
    25372564
    25382565            std::list<VirtualSystemDescriptionEntry*> llName = vsdescThis->findByType(VirtualSystemDescriptionType_Name);
     
    34743501                           strVMName);
    34753502
     3503        // description
     3504        Utf8Str strDescription(bstrDescription);
     3505        pNewDesc->addEntry(VirtualSystemDescriptionType_Description,
     3506                           "",
     3507                           strDescription,
     3508                           strDescription);
     3509
    34763510        /* CPU count*/
    34773511        Utf8Str strCpuCount = Utf8StrFmt("%RI32", cCPUs);
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r17888 r17965  
    29522952  >
    29532953    <desc>
    2954       OVF resource type.
     2954        OVF resource type (as listed with CIM_ResourceAllocationSettingData; see for example
     2955        http://msdn.microsoft.com/en-us/library/cc136877(VS.85).aspx).
    29552956    </desc>
    29562957
     
    32073208    <const name="OS" value="2" />
    32083209    <const name="Name" value="3" />
    3209     <const name="CPU" value="4" />
    3210     <const name="Memory" value="5" />
    3211     <const name="HardDiskControllerIDE" value="6" />
    3212     <const name="HardDiskControllerSATA" value="7" />
    3213     <const name="HardDiskControllerSCSI" value="8" />
    3214     <const name="HardDiskImage" value="9" />
    3215     <const name="Floppy" value="10" />
    3216     <const name="CDROM" value="11" />
    3217     <const name="NetworkAdapter" value="12" />
    3218     <const name="USBController" value="13" />
    3219     <const name="SoundCard" value="14" />
     3210    <const name="Description" value="4" />
     3211    <const name="CPU" value="5" />
     3212    <const name="Memory" value="6" />
     3213    <const name="HardDiskControllerIDE" value="7" />
     3214    <const name="HardDiskControllerSATA" value="8" />
     3215    <const name="HardDiskControllerSCSI" value="9" />
     3216    <const name="HardDiskImage" value="10" />
     3217    <const name="Floppy" value="11" />
     3218    <const name="CDROM" value="12" />
     3219    <const name="NetworkAdapter" value="13" />
     3220    <const name="USBController" value="14" />
     3221    <const name="SoundCard" value="15" />
    32203222
    32213223  </enum>
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