VirtualBox

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


Ignore:
Timestamp:
Jul 18, 2017 1:54:10 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
117044
Message:

IUnattended,IMachine: Changed IUnattended to a pure action object with a factory method instead of an attribute. Added more attributes: scriptTemplatePath, validationKitIsoPath, installTestExecService, and (readonly) machine. Only the first and also of those actually do anything at the moment.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r67898 r68024  
    37673767  <interface
    37683768    name="IUnattended" extends="$unknown"
    3769     uuid="a6ba3585-5fc3-4465-d61d-5b70540690af"
     3769    uuid="b365bb45-267f-44fa-c32a-cad265372f8e"
    37703770    wsmap="managed"
    37713771    reservedMethods="4" reservedAttributes="16"
     
    37763776      the Guest OS for fully automated install.
    37773777
    3778       It is based on the IMachine:
    3779       <link to="IMachine::unattended"/> attribute.
     3778      The typical workflow is:
     3779      <ol>
     3780        <li>Call <link to="IMachine::createUnattendedInstaller"/> to create the object</li>
     3781        <li>Set the IUnattended attributes.</li>
     3782        <li>Call <link to="IUnattended::prepare"/> for the object to check the
     3783            attribute values and create an internal installer instance.</li>
     3784        <li>Call <link to="IUnattended::constructMedia"/> to create additional
     3785            media files (ISO/floppy) needed.</li>
     3786        <li>Call <link to="IUnattended::reconfigureVM"/> to reconfigure the VM
     3787            with the installation ISO, additional media files and whatnot </li>
     3788        <li>Optionally call <link to="IUnattended::done"/> to destroy the internal
     3789            installer and allow restarting from the second step.</li>
     3790      </ol>
    37803791    </desc>
    37813792
     
    38153826    <attribute name="additionsIsoPath" type="wstring">
    38163827      <desc>
    3817         Guest Additions ISO image path
     3828        Guest Additions ISO image path.  This defaults to
     3829        <link to="ISystemProperties::defaultAdditionsISO"/> when the Unattended
     3830        object is instantiated.
     3831
     3832        This property is ignored when <link to="IUnattended::installGuestAdditions"/> is false.
    38183833      </desc>
    38193834    </attribute>
     
    38263841        distribution, only the installation of additions pointed to by
    38273842        <link to="IUnattended::additionsIsoPath"/>.
     3843      </desc>
     3844    </attribute>
     3845
     3846    <attribute name="validationKitIsoPath" type="wstring">
     3847      <desc>
     3848        VirtualBox ValidationKit ISO image path.  This is used when
     3849        <link to="IUnattended::installTestExecService"/> is set to true.
     3850      </desc>
     3851    </attribute>
     3852
     3853    <attribute name="installTestExecService" type="boolean">
     3854      <desc>
     3855        Indicates whether the test execution service (TXS) from the VBox
     3856        ValidationKit should be installed.
     3857
     3858        The TXS binary will be taken from the ISO indicated by
     3859        <link to="IUnattended::validationKitIsoPath"/>.
    38283860      </desc>
    38293861    </attribute>
     
    38463878        Used only with Windows installation CD/DVD:
    38473879        https://technet.microsoft.com/en-us/library/cc766022%28v=ws.10%29.aspx
     3880      </desc>
     3881    </attribute>
     3882
     3883    <attribute name="machine" type="IMachine" readonly="yes">
     3884      <desc>
     3885        The associated machine object.
     3886      </desc>
     3887    </attribute>
     3888
     3889    <attribute name="scriptTemplatePath" type="wstring">
     3890      <desc>
     3891        The unattended installation script template file.
     3892
     3893        The template default is based on the guest OS type and is determined by the
     3894        internal installer when when <link to="IUnattended::prepare"/> is invoked.
     3895        Most users will want the defaults.
     3896
     3897        After <link to="IUnattended::prepare"/> is called, it can be read to see
     3898        which file is being used.
    38483899      </desc>
    38493900    </attribute>
     
    53865437    </attribute>
    53875438
    5388     <attribute name="unattended" type="IUnattended" readonly="yes">
    5389       <desc>Associated unattended install class, always present.</desc>
    5390     </attribute>
    5391 
    53925439    <method name="lockMachine">
    53935440      <desc>
     
    79688015      <param name="progress" type="IProgress" dir="return">
    79698016        <desc>Progress object to track the operation completion.</desc>
     8017      </param>
     8018    </method>
     8019
     8020    <method name="createUnattendedInstaller">
     8021      <desc>
     8022        Creates a new <link to="IUnattended"/> guest installation object.
     8023      </desc>
     8024      <param name="unattended" type="IUnattended" dir="return">
     8025        <desc>New unattended object.</desc>
    79708026      </param>
    79718027    </method>
  • trunk/src/VBox/Main/include/MachineImpl.h

    r67738 r68024  
    776776    const ComObjPtr<BIOSSettings>      mBIOSSettings;
    777777    const ComObjPtr<BandwidthControl>  mBandwidthControl;
    778 #ifdef VBOX_WITH_UNATTENDED
    779     const ComObjPtr<Unattended>        mUnattended;
    780 #endif
    781778
    782779    typedef std::vector<ComObjPtr<NetworkAdapter> > NetworkAdapterVector;
     
    984981    HRESULT getVMProcessPriority(com::Utf8Str &aVMProcessPriority);
    985982    HRESULT setVMProcessPriority(const com::Utf8Str &aVMProcessPriority);
    986     HRESULT getUnattended(ComPtr<IUnattended> &aUnattended);
    987983
    988984    // wrapped IMachine methods
     
    12021198    HRESULT restoreSnapshot(const ComPtr<ISnapshot> &aSnapshot,
    12031199                            ComPtr<IProgress> &aProgress);
     1200    HRESULT createUnattendedInstaller(ComPtr<IUnattended> &aUnattended);
    12041201    HRESULT applyDefaults(const com::Utf8Str &aFlags);
    12051202
  • trunk/src/VBox/Main/src-server/MachineImpl.cpp

    r67738 r68024  
    71847184}
    71857185
    7186 HRESULT Machine::getUnattended(ComPtr<IUnattended> &aUnattended)
    7187 {
    7188 #ifdef VBOX_WITH_UNATTENDED
    7189     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    7190     if (mUnattended.isNotNull())
    7191         aUnattended = mUnattended;
    7192     else
    7193     {
    7194         /* Do on-demand creation. */
    7195         alock.release();
    7196         AutoWriteLock wlock(this COMMA_LOCKVAL_SRC_POS);
    7197         if (mUnattended.isNull())
    7198         {
    7199             unconst(mUnattended).createObject();
    7200             HRESULT hrc = mUnattended->init(this);
    7201             if (FAILED(hrc))
    7202             {
    7203                 mUnattended->uninit();
    7204                 unconst(mUnattended).setNull();
    7205                 return hrc;
    7206             }
    7207         }
    7208         aUnattended = mUnattended;
    7209     }
    7210     return S_OK;
    7211 #else
    7212     NOREF(aUnattended);
    7213     return E_NOTIMPL;
    7214 #endif
    7215 }
    7216 
    72177186HRESULT Machine::cloneTo(const ComPtr<IMachine> &aTarget, CloneMode_T aMode, const std::vector<CloneOptions_T> &aOptions,
    72187187                         ComPtr<IProgress> &aProgress)
     
    84458414    mBandwidthControl->init(this);
    84468415
    8447 #ifdef VBOX_WITH_UNATTENDED
    8448     Assert(mUnattended.isNull()); /* Created on-demand. */
    8449 #endif
    8450 
    84518416    return S_OK;
    84528417}
     
    85258490        unconst(mBIOSSettings).setNull();
    85268491    }
    8527 
    8528 #ifdef VBOX_WITH_UNATTENDED
    8529     if (mUnattended)
    8530     {
    8531         mUnattended->uninit();
    8532         unconst(mUnattended).setNull();
    8533     }
    8534 #endif
    85358492
    85368493    /* Deassociate media (only when a real Machine or a SnapshotMachine
     
    1515815115}
    1515915116
     15117HRESULT Machine::createUnattendedInstaller(ComPtr<IUnattended> &aUnattended)
     15118{
     15119#ifdef VBOX_WITH_UNATTENDED
     15120    ComObjPtr<Unattended> ptrUnattended;
     15121    HRESULT hrc = ptrUnattended.createObject();
     15122    if (SUCCEEDED(hrc))
     15123    {
     15124        AutoReadLock wlock(this COMMA_LOCKVAL_SRC_POS);
     15125        hrc = ptrUnattended->init(this);
     15126        if (SUCCEEDED(hrc))
     15127            hrc = ptrUnattended.queryInterfaceTo(aUnattended.asOutParam());
     15128    }
     15129    return hrc;
     15130#else
     15131    NOREF(aUnattended);
     15132    return E_NOTIMPL;
     15133#endif
     15134}
     15135
    1516015136HRESULT Machine::applyDefaults(const com::Utf8Str &aFlags)
    1516115137{
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette