VirtualBox

Changeset 16237 in vbox


Ignore:
Timestamp:
Jan 26, 2009 3:06:34 PM (16 years ago)
Author:
vboxsync
Message:

OVF: add separate IAppliance::interpret() method, API docs

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

Legend:

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

    r16234 r16237  
    808808    }
    809809
    810     rc = construeAppliance();
    811     if (FAILED(rc))
    812         return rc;
    813 
    814810    /* Confirm a successful initialization */
    815811    autoInitSpan.setSucceeded();
     
    10171013}
    10181014
    1019 HRESULT Appliance::construeAppliance()
     1015STDMETHODIMP Appliance::Interpret()
    10201016{
    10211017    // @todo:
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r16235 r16237  
    28822882        <link to="IVirtualBox::openAppliance" />.
    28832883
    2884         Opening an appliance is a two-step process with VirtualBox: first
     2884        Opening an appliance is a three-step process with VirtualBox: first
    28852885        <link to="IVirtualBox::openAppliance" /> is called, which succeeds if the
    28862886        appliance file is syntactically valid, irrespective of whether VirtualBox
    28872887        can handle the appliance.
    28882888
    2889         Once that method has returned an IAppliance instance, one can inspect the
    2890         member data of that instance to determine whether VirtualBox can handle
    2891         the requirements of that appliance and create local virtual machines
    2892         accordingly.
     2889        As a second step, the caller should then invoke <link to="IAppliance::interpret" />,
     2890        which analyzes the OVF data and sets up the contents of the IAppliance attributes
     2891        accordingly. These can be inspected by a VirtualBox front-end such as the GUI,
     2892        and the suggestions can be displayed to the user. For example, the virtual system
     2893        will contain the virtual hardware prescribed by the OVF (network and hardware
     2894        adapters, virtual disk images, memory size and so on), and the GUI can then give
     2895        the user the option to confirm and/or change these suggestions.
     2896
     2897        As a third step, the caller should invoke <link to="#Import" />, which will create
     2898        virtual machines in VirtualBox as instances of <link to="IMachine" /> that match the
     2899        information in the virtual system descriptions.
    28932900    </desc>
    28942901
     
    28992906
    29002907    <attribute name="virtualSystemDescriptions" type="IVirtualSystemDescription" readonly="yes" safearray="yes">
    2901       <desc></desc>
    2902     </attribute>
     2908      <desc>
     2909      Array of virtual system descriptions. One such description gets created by
     2910      <link to="#interpret" /> for each virtual system found in the OVF.
     2911      </desc>
     2912    </attribute>
     2913
     2914    <method name="interpret">
     2915      <desc>
     2916        Interprets the OVF data that was read when the appliance was constructed. After
     2917        calling this method, one can call
     2918        <link to="#getDisks" /> to retrieve disk information and also inspect the
     2919        <link to="#virtualSystemDescriptions" /> array attribute, which will then contain
     2920        one <link to="IVirtualSystemDescription" /> for each virtual machine found in
     2921        the appliance.
     2922      </desc>
     2923    </method>
    29032924
    29042925    <method name="getDisks">
  • trunk/src/VBox/Main/include/ApplianceImpl.h

    r16218 r16237  
    5757    void FinalRelease() { uninit(); }
    5858
    59     HRESULT init (VirtualBox *aVirtualBox, IN_BSTR &path);
     59    HRESULT init(VirtualBox *aVirtualBox, IN_BSTR &path);
    6060    void uninit();
    6161
     
    6464
    6565    /* IAppliance properties */
    66     STDMETHOD(COMGETTER(Path)) (BSTR *aPath);
     66    STDMETHOD(COMGETTER(Path))(BSTR *aPath);
     67
     68    STDMETHOD(COMGETTER(VirtualSystemDescriptions))(ComSafeArrayOut (IVirtualSystemDescription*, aVirtualSystemDescriptions));
    6769
    6870    /* IAppliance methods */
     71    /* void interpret (); */
     72    STDMETHOD(Interpret)(void);
     73
    6974    /* void getDisks (out unsigned long aDisksSize, [array, size_is (aDisksSize)] out wstring aDisks, [retval] out unsigned long cDisks); */
    70     STDMETHOD(GetDisks) (ComSafeArrayOut(BSTR, aDisks), ULONG *cDisks);
    71 
    72     STDMETHOD (COMGETTER (VirtualSystemDescriptions)) (ComSafeArrayOut (IVirtualSystemDescription*, aVirtualSystemDescriptions));
     75    STDMETHOD(GetDisks)(ComSafeArrayOut(BSTR, aDisks), ULONG *cDisks);
    7376
    7477    /* public methods only for internal purposes */
    75     STDMETHOD (ImportAppliance)();
     78    STDMETHOD(ImportAppliance)();
    7679
    7780    /* private instance data */
     
    8891    HRESULT HandleVirtualSystemContent(const char *pcszPath, const xml::Node *pContentElem);
    8992
    90     HRESULT construeAppliance();
    9193    HRESULT searchUniqueVMName (std::string& aName);
    9294};
     
    151153    /* private instance data */
    152154private:
    153     void addEntry (VirtualSystemDescriptionType_T aType, ULONG aRef, std::string aOrigValue, std::string aAutoValue);
    154     std::list<VirtualSystemDescriptionEntry> findByType (VirtualSystemDescriptionType_T aType);
     155    void addEntry(VirtualSystemDescriptionType_T aType, ULONG aRef, std::string aOrigValue, std::string aAutoValue);
     156    std::list<VirtualSystemDescriptionEntry> findByType(VirtualSystemDescriptionType_T aType);
    155157
    156158    struct Data;
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