VirtualBox

Changeset 68133 in vbox


Ignore:
Timestamp:
Jul 27, 2017 9:44:28 AM (7 years ago)
Author:
vboxsync
Message:

Unattended: Moved the createUnattendedInstaller method from IMachine to IVirtualBox as we will be needing it without a virtual machine in a new-vm-from-installation-iso wizard.

Location:
trunk/src/VBox
Files:
6 edited

Legend:

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

    r68129 r68133  
    15311531             */
    15321532            ComPtr<IUnattended> ptrUnattended;
    1533             CHECK_ERROR_BREAK(machine, CreateUnattendedInstaller(ptrUnattended.asOutParam()));
     1533            CHECK_ERROR_BREAK(a->virtualBox, CreateUnattendedInstaller(ptrUnattended.asOutParam()));
     1534            CHECK_ERROR_BREAK(ptrUnattended, COMSETTER(Machine)(machine));
    15341535
    15351536            if (pszIsoPath)
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r68126 r68133  
    19001900  <interface
    19011901    name="IVirtualBox" extends="$unknown"
    1902     uuid="0169423f-46b4-cde9-91af-1e9d5b6cd945"
     1902    uuid="9570b9d5-f1a1-448a-10c5-e12f5285adad"
    19031903    wsmap="managed"
    19041904    reservedMethods="8" reservedAttributes="12"
     
    23832383      <param name="appliance" type="IAppliance" dir="return">
    23842384        <desc>New appliance.</desc>
     2385      </param>
     2386    </method>
     2387
     2388    <method name="createUnattendedInstaller">
     2389      <desc>
     2390        Creates a new <link to="IUnattended"/> guest installation object.  This can be used to
     2391        analyze an installation ISO to create and configure a new machine for it to be installed
     2392        on.  It can also be used to (re)install an existing machine.
     2393      </desc>
     2394      <param name="unattended" type="IUnattended" dir="return">
     2395        <desc>New unattended object.</desc>
    23852396      </param>
    23862397    </method>
     
    37673778  <interface
    37683779    name="IUnattended" extends="$unknown"
    3769     uuid="da34bfb3-437a-4510-6c7e-7687b00d378d"
     3780    uuid="3107e9fd-7b3a-4008-91de-24273f605a8e"
    37703781    wsmap="managed"
    37713782    reservedMethods="4" reservedAttributes="16"
     
    37783789      The typical workflow is:
    37793790      <ol>
    3780         <li>Call <link to="IMachine::createUnattendedInstaller"/> to create the object</li>
    3781         <li>Set the relevant IUnattended attributes.</li>
     3791        <li>Call <link to="IVirtualBox::createUnattendedInstaller"/> to create the object</li>
     3792        <li>Set <link to="IUnattended::isoPath"/> and call <link to="IUnattended::detectIsoOS"/></li>
     3793        <li>Create, configure and register a machine according to <link to="IUnattended::detectedOSTypeId"/>
     3794            and the other detectedOS* attributes.</li>
     3795        <li>Set <link to="IUnattended::machine"/> to the new IMachine instance.</li>
     3796        <li>Set the other IUnattended attributes as desired.</li>
    37823797        <li>Call <link to="IUnattended::prepare"/> for the object to check the
    37833798            attribute values and create an internal installer instance.</li>
     
    37893804            installer and allow restarting from the second step.</li>
    37903805      </ol>
     3806
     3807      Note! Steps one is currently not implemented.
    37913808    </desc>
    37923809
     
    37943811      <desc>
    37953812        Guest operating system ISO image
     3813      </desc>
     3814    </attribute>
     3815
     3816    <attribute name="machine" type="IMachine">
     3817      <desc>
     3818        The associated machine object.
     3819
     3820        This must be set before <link to="IUnattended::prepare"/> is called.
     3821        The VM must be registered.
    37963822      </desc>
    37973823    </attribute>
     
    39593985        Used only with Windows installation CD/DVD:
    39603986        https://technet.microsoft.com/en-us/library/cc766022%28v=ws.10%29.aspx
    3961       </desc>
    3962     </attribute>
    3963 
    3964     <attribute name="machine" type="IMachine" readonly="yes">
    3965       <desc>
    3966         The associated machine object.
    39673987      </desc>
    39683988    </attribute>
     
    47234743  <interface
    47244744    name="IMachine" extends="$unknown"
    4725     uuid="b2547866-a0a1-4391-8b86-6952d82efaa0"
     4745    uuid="f50b24f0-0956-453c-d14c-8c27c683c295"
    47264746    wsmap="managed"
    47274747    wrap-hint-server-addinterfaces="IInternalMachineControl"
     
    81728192      <param name="progress" type="IProgress" dir="return">
    81738193        <desc>Progress object to track the operation completion.</desc>
    8174       </param>
    8175     </method>
    8176 
    8177     <method name="createUnattendedInstaller">
    8178       <desc>
    8179         Creates a new <link to="IUnattended"/> guest installation object.
    8180       </desc>
    8181       <param name="unattended" type="IUnattended" dir="return">
    8182         <desc>New unattended object.</desc>
    81838194      </param>
    81848195    </method>
  • trunk/src/VBox/Main/include/MachineImpl.h

    r68024 r68133  
    11981198    HRESULT restoreSnapshot(const ComPtr<ISnapshot> &aSnapshot,
    11991199                            ComPtr<IProgress> &aProgress);
    1200     HRESULT createUnattendedInstaller(ComPtr<IUnattended> &aUnattended);
    12011200    HRESULT applyDefaults(const com::Utf8Str &aFlags);
    12021201
  • trunk/src/VBox/Main/include/VirtualBoxImpl.h

    r66938 r68133  
    300300                             std::vector<MachineState_T> &aStates);
    301301    HRESULT createAppliance(ComPtr<IAppliance> &aAppliance);
     302    HRESULT createUnattendedInstaller(ComPtr<IUnattended> &aUnattended);
    302303    HRESULT createMedium(const com::Utf8Str &aFormat,
    303304                         const com::Utf8Str &aLocation,
  • trunk/src/VBox/Main/src-server/MachineImpl.cpp

    r68024 r68133  
    4444#include "MachineImplCloneVM.h"
    4545#include "AutostartDb.h"
    46 #ifdef VBOX_WITH_UNATTENDED
    47 # include "UnattendedImpl.h"
    48 #endif
    4946#include "SystemPropertiesImpl.h"
    5047
     
    1511515112}
    1511615113
    15117 HRESULT 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 
    1513615114HRESULT Machine::applyDefaults(const com::Utf8Str &aFlags)
    1513715115{
  • trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp

    r67642 r68133  
    7070#ifdef VBOX_WITH_EXTPACK
    7171# include "ExtPackManagerImpl.h"
     72#endif
     73#ifdef VBOX_WITH_UNATTENDED
     74# include "UnattendedImpl.h"
    7275#endif
    7376#include "AutostartDb.h"
     
    17991802}
    18001803
     1804HRESULT VirtualBox::createUnattendedInstaller(ComPtr<IUnattended> &aUnattended)
     1805{
     1806#ifdef VBOX_WITH_UNATTENDED
     1807    ComObjPtr<Unattended> ptrUnattended;
     1808    HRESULT hrc = ptrUnattended.createObject();
     1809    if (SUCCEEDED(hrc))
     1810    {
     1811        AutoReadLock wlock(this COMMA_LOCKVAL_SRC_POS);
     1812        hrc = ptrUnattended->initUnattended(this);
     1813        if (SUCCEEDED(hrc))
     1814            hrc = ptrUnattended.queryInterfaceTo(aUnattended.asOutParam());
     1815    }
     1816    return hrc;
     1817#else
     1818    NOREF(aUnattended);
     1819    return E_NOTIMPL;
     1820#endif
     1821}
     1822
    18011823HRESULT VirtualBox::createMedium(const com::Utf8Str &aFormat,
    18021824                                 const com::Utf8Str &aLocation,
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