VirtualBox

Ignore:
Timestamp:
Jul 16, 2010 2:34:31 PM (14 years ago)
Author:
vboxsync
Message:

Main/OVF: add Appliance::machines[] attribute so that caller can figure out which machines were actually created; improve OVF testcase (not done yet)

File:
1 edited

Legend:

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

    r30764 r30881  
    454454}
    455455
     456/**
     457 * Public method implementation.
     458 * @param aDisks
     459 * @return
     460 */
     461STDMETHODIMP Appliance::COMGETTER(Machines)(ComSafeArrayOut(BSTR, aMachines))
     462{
     463    CheckComArgOutSafeArrayPointerValid(aMachines);
     464
     465    AutoCaller autoCaller(this);
     466    if (FAILED(autoCaller.rc())) return autoCaller.rc();
     467
     468    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     469
     470    if (!isApplianceIdle())
     471        return E_ACCESSDENIED;
     472
     473    com::SafeArray<BSTR> sfaMachines(m->llGuidsMachinesCreated.size());
     474    size_t u = 0;
     475    for (std::list<Guid>::const_iterator it = m->llGuidsMachinesCreated.begin();
     476         it != m->llGuidsMachinesCreated.end();
     477         ++it)
     478    {
     479        const Guid &uuid = *it;
     480        Bstr bstr(uuid.toUtf16());
     481        bstr.detachTo(&sfaMachines[u]);
     482        ++u;
     483    }
     484
     485    sfaMachines.detachTo(ComSafeArrayOutArg(aMachines));
     486
     487    return S_OK;
     488}
     489
    456490STDMETHODIMP Appliance::CreateVFSExplorer(IN_BSTR aURI, IVFSExplorer **aExplorer)
    457491{
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