VirtualBox

Changeset 31574 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Aug 11, 2010 2:54:09 PM (14 years ago)
Author:
vboxsync
Message:

Main: bring back boolean argument to IConsole::discardSavedState()

Location:
trunk/src/VBox
Files:
8 edited

Legend:

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

    r31539 r31574  
    433433                ComPtr<IConsole> console;
    434434                CHECK_ERROR_BREAK(a->session, COMGETTER(Console)(console.asOutParam()));
    435                 CHECK_ERROR_BREAK(console, DiscardSavedState());
     435                CHECK_ERROR_BREAK(console, DiscardSavedState(true /* fDeleteFile */));
    436436            } while (0);
    437437            CHECK_ERROR_BREAK(a->session, UnlockMachine());
  • trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp

    r31568 r31574  
    16511651        if (machineState == MachineState_Saved)
    16521652        {
    1653             CHECK_ERROR(gConsole, DiscardSavedState());
     1653            CHECK_ERROR(gConsole, DiscardSavedState(true /* fDeleteFile */));
    16541654        }
    16551655        /*
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/VBoxSelectorWnd.cpp

    r31500 r31574  
    770770
    771771    CConsole console = session.GetConsole();
    772     console.DiscardSavedState();
     772    console.DiscardSavedState(true /* fDeleteFile */);
    773773    if (!console.isOk())
    774774        vboxProblem().cannotDiscardSavedState (console);
  • trunk/src/VBox/Main/ConsoleImpl.cpp

    r31543 r31574  
    23882388}
    23892389
    2390 STDMETHODIMP Console::DiscardSavedState()
     2390STDMETHODIMP Console::DiscardSavedState(BOOL aRemoveFile)
    23912391{
    23922392    AutoCaller autoCaller(this);
     
    24002400            Global::stringifyMachineState(mMachineState));
    24012401
    2402     HRESULT rc = S_OK;
     2402    HRESULT rc = mControl->SetRemoveSavedStateFile(aRemoveFile);
     2403    if (FAILED(rc)) return rc;
    24032404
    24042405    /*
  • trunk/src/VBox/Main/MachineImpl.cpp

    r31562 r31574  
    96599659    }
    96609660
     9661    /* default is to delete saved state on Saved -> PoweredOff transition */
     9662    mRemoveSavedState = true;
     9663
    96619664    /* Confirm a successful initialization when it's the case */
    96629665    autoInitSpan.setSucceeded();
     
    99529955
    99539956/**
     9957 *  @note Locks this object for writing.
     9958 */
     9959STDMETHODIMP SessionMachine::SetRemoveSavedStateFile(BOOL aRemove)
     9960{
     9961    AutoCaller autoCaller(this);
     9962    AssertComRCReturn(autoCaller.rc(), autoCaller.rc());
     9963
     9964    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     9965
     9966    mRemoveSavedState = aRemove;
     9967
     9968    return S_OK;
     9969}
     9970
     9971/**
    99549972 *  @note Locks the same as #setMachineState() does.
    99559973 */
     
    1126211280    if (deleteSavedState)
    1126311281    {
    11264         Assert(!mSSData->mStateFilePath.isEmpty());
    11265         RTFileDelete(mSSData->mStateFilePath.c_str());
     11282        if (mRemoveSavedState)
     11283        {
     11284            Assert(!mSSData->mStateFilePath.isEmpty());
     11285            RTFileDelete(mSSData->mStateFilePath.c_str());
     11286        }
    1126611287        mSSData->mStateFilePath.setNull();
    1126711288        stsFlags |= SaveSTS_StateFilePath;
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r31572 r31574  
    29882988     wsmap="suppress"
    29892989     >
     2990    <method name="setRemoveSavedStateFile">
     2991      <desc>
     2992        Updates the flag whether the saved state file is removed on a
     2993        machine state change from Saved to PoweredOff.
     2994      </desc>
     2995      <param name="aRemove" type="boolean" dir="in"/>
     2996    </method>
     2997
    29902998    <method name="updateState">
    29912999      <desc>
    29923000        Updates the VM state.
    29933001        <note>
    2994           This operation will also update the settings file with
    2995           the correct information about the saved state file
    2996           and delete this file from disk when appropriate.
     3002          This operation will also update the settings file with the correct
     3003          information about the saved state file and delete this file from disk
     3004          when appropriate.
    29973005        </note>
    29983006      </desc>
     
    61516159      <desc>
    61526160        Forcibly resets the machine to "Powered Off" state if it is
    6153         currently in the "Saved" state (previously created by <link to="#saveState"/>)
    6154         and deletes the file into which the machine state was saved.
     6161        currently in the "Saved" state (previously created by <link to="#saveState"/>).
    61556162        Next time the machine is powered up, a clean boot will occur.
    61566163        <note>
     
    61606167          computer, it can can lead to data loss.
    61616168        </note>
     6169        If @a fRemoveFile is @c true, the file in the machine directory
     6170        into which the machine state was saved is also deleted. If
     6171        this is @c false, then the state can be recovered and later
     6172        re-inserted into a machine using <link to="#adoptSavedState" />.
     6173        The location of the file can be found in the
     6174        <link to="IMachine::stateFilePath" /> attribute.
    61626175        <result name="VBOX_E_INVALID_VM_STATE">
    61636176          Virtual machine not in state Saved.
    61646177        </result>
    61656178      </desc>
     6179      <param name="fRemoveFile" type="boolean" dir="in" >
     6180        <desc>Whether to also remove the saved state file.</desc>
     6181      </param>
    61666182    </method>
    61676183
  • trunk/src/VBox/Main/include/ConsoleImpl.h

    r31539 r31574  
    138138    STDMETHOD(SaveState)(IProgress **aProgress);
    139139    STDMETHOD(AdoptSavedState)(IN_BSTR aSavedStateFile);
    140     STDMETHOD(DiscardSavedState)();
     140    STDMETHOD(DiscardSavedState)(BOOL aRemoveFile);
    141141    STDMETHOD(GetDeviceActivity)(DeviceType_T aDeviceType,
    142142                                DeviceActivity_T *aDeviceActivity);
  • trunk/src/VBox/Main/include/MachineImpl.h

    r31539 r31574  
    888888
    889889    // IInternalMachineControl methods
     890    STDMETHOD(SetRemoveSavedStateFile)(BOOL aRemove);
    890891    STDMETHOD(UpdateState)(MachineState_T machineState);
    891892    STDMETHOD(GetIPCId)(BSTR *id);
     
    10251026    HRESULT updateMachineStateOnClient();
    10261027
     1028    HRESULT mRemoveSavedState;
     1029
    10271030    SnapshotData mSnapshotData;
    10281031
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