VirtualBox

Changeset 52481 in vbox


Ignore:
Timestamp:
Aug 22, 2014 5:27:48 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
95701
Message:

6813 - MachineImpl.cpp - IInternalMachineControl changes.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/MachineImpl.h

    r52312 r52481  
    7373class HostUSBDevice;
    7474class StorageController;
    75 
    7675class SessionMachine;
    7776
     
    12581257    RWLockHandle *lockHandle() const;
    12591258
    1260     // IInternalMachineControl methods
    1261     STDMETHOD(SetRemoveSavedStateFile)(BOOL aRemove);
    1262     STDMETHOD(UpdateState)(MachineState_T machineState);
    1263     STDMETHOD(BeginPowerUp)(IProgress *aProgress);
    1264     STDMETHOD(EndPowerUp)(LONG iResult);
    1265     STDMETHOD(BeginPoweringDown)(IProgress **aProgress);
    1266     STDMETHOD(EndPoweringDown)(LONG aResult, IN_BSTR aErrMsg);
    1267     STDMETHOD(RunUSBDeviceFilters)(IUSBDevice *aUSBDevice, BOOL *aMatched, ULONG *aMaskedIfs);
    1268     STDMETHOD(CaptureUSBDevice)(IN_BSTR aId);
    1269     STDMETHOD(DetachUSBDevice)(IN_BSTR aId, BOOL aDone);
    1270     STDMETHOD(AutoCaptureUSBDevices)();
    1271     STDMETHOD(DetachAllUSBDevices)(BOOL aDone);
    1272     STDMETHOD(OnSessionEnd)(ISession *aSession, IProgress **aProgress);
    1273     STDMETHOD(BeginSavingState)(IProgress **aProgress, BSTR *aStateFilePath);
    1274     STDMETHOD(EndSavingState)(LONG aResult, IN_BSTR aErrMsg);
    1275     STDMETHOD(AdoptSavedState)(IN_BSTR aSavedStateFile);
    1276     STDMETHOD(BeginTakingSnapshot)(IConsole *aInitiator,
    1277                                    IN_BSTR aName,
    1278                                    IN_BSTR aDescription,
    1279                                    IProgress *aConsoleProgress,
    1280                                    BOOL fTakingSnapshotOnline,
    1281                                    BSTR *aStateFilePath);
    1282     STDMETHOD(EndTakingSnapshot)(BOOL aSuccess);
    1283     STDMETHOD(DeleteSnapshot)(IConsole *aInitiator, IN_BSTR aStartId,
    1284                               IN_BSTR aEndID, BOOL fDeleteAllChildren,
    1285                               MachineState_T *aMachineState, IProgress **aProgress);
    1286     STDMETHOD(FinishOnlineMergeMedium)();
    1287     STDMETHOD(RestoreSnapshot)(IConsole *aInitiator,
    1288                                ISnapshot *aSnapshot,
    1289                                MachineState_T *aMachineState,
    1290                                IProgress **aProgress);
    1291     STDMETHOD(PullGuestProperties)(ComSafeArrayOut(BSTR, aNames), ComSafeArrayOut(BSTR, aValues),
    1292               ComSafeArrayOut(LONG64, aTimestamps), ComSafeArrayOut(BSTR, aFlags));
    1293     STDMETHOD(PushGuestProperty)(IN_BSTR aName, IN_BSTR aValue,
    1294                                   LONG64 aTimestamp, IN_BSTR aFlags);
    1295     STDMETHOD(LockMedia)();
    1296     STDMETHOD(UnlockMedia)();
    1297     STDMETHOD(EjectMedium)(IMediumAttachment *aAttachment,
    1298                            IMediumAttachment **aNewAttachment);
    1299     STDMETHOD(ReportVmStatistics)(ULONG aValidStats, ULONG aCpuUser,
    1300                                   ULONG aCpuKernel, ULONG aCpuIdle,
    1301                                   ULONG aMemTotal, ULONG aMemFree,
    1302                                   ULONG aMemBalloon, ULONG aMemShared,
    1303                                   ULONG aMemCache, ULONG aPageTotal,
    1304                                   ULONG aAllocVMM, ULONG aFreeVMM,
    1305                                   ULONG aBalloonedVMM, ULONG aSharedVMM,
    1306                                   ULONG aVmNetRx, ULONG aVmNetTx);
    1307 
    13081259    // public methods only for internal purposes
    13091260
     
    13501301    bool i_hasMatchingUSBFilter(const ComObjPtr<HostUSBDevice> &aDevice, ULONG *aMaskedIfs);
    13511302
     1303    HRESULT i_lockMedia();
     1304    HRESULT i_unlockMedia();
     1305
     1306private:
     1307
     1308    // wrapped IInternalMachineControl properties
     1309
     1310    // wrapped IInternalMachineControl methods
     1311    HRESULT setRemoveSavedStateFile(BOOL aRemove);
     1312    HRESULT updateState(MachineState_T aState);
     1313    HRESULT beginPowerUp(const ComPtr<IProgress> &aProgress);
     1314    HRESULT endPowerUp(LONG aResult);
     1315    HRESULT beginPoweringDown(ComPtr<IProgress> &aProgress);
     1316    HRESULT endPoweringDown(LONG aResult,
     1317                            const com::Utf8Str &aErrMsg);
     1318    HRESULT runUSBDeviceFilters(const ComPtr<IUSBDevice> &aDevice,
     1319                                BOOL *aMatched,
     1320                                ULONG *aMaskedInterfaces);
     1321    HRESULT captureUSBDevice(const com::Guid &aId);
     1322    HRESULT detachUSBDevice(const com::Guid &aId,
     1323                            BOOL aDone);
     1324    HRESULT autoCaptureUSBDevices();
     1325    HRESULT detachAllUSBDevices(BOOL aDone);
     1326    HRESULT onSessionEnd(const ComPtr<ISession> &aSession,
     1327                         ComPtr<IProgress> &aProgress);
     1328    HRESULT beginSavingState(ComPtr<IProgress> &aProgress,
     1329                             com::Utf8Str &aStateFilePath);
     1330    HRESULT endSavingState(LONG aResult,
     1331                           const com::Utf8Str &aErrMsg);
     1332    HRESULT adoptSavedState(const com::Utf8Str &aSavedStateFile);
     1333    HRESULT beginTakingSnapshot(const ComPtr<IConsole> &aInitiator,
     1334                                const com::Utf8Str &aName,
     1335                                const com::Utf8Str &aDescription,
     1336                                const ComPtr<IProgress> &aConsoleProgress,
     1337                                BOOL aFTakingSnapshotOnline,
     1338                                com::Utf8Str &aStateFilePath);
     1339    HRESULT endTakingSnapshot(BOOL aSuccess);
     1340    HRESULT deleteSnapshot(const ComPtr<IConsole> &aInitiator,
     1341                           const com::Guid &aStartId,
     1342                           const com::Guid &aEndId,
     1343                           BOOL aDeleteAllChildren,
     1344                           MachineState_T *aMachineState,
     1345                           ComPtr<IProgress> &aProgress);
     1346    HRESULT finishOnlineMergeMedium();
     1347    HRESULT restoreSnapshot(const ComPtr<IConsole> &aInitiator,
     1348                            const ComPtr<ISnapshot> &aSnapshot,
     1349                            MachineState_T *aMachineState,
     1350                            ComPtr<IProgress> &aProgress);
     1351    HRESULT pullGuestProperties(std::vector<com::Utf8Str> &aNames,
     1352                                std::vector<com::Utf8Str> &aValues,
     1353                                std::vector<LONG64> &aTimestamps,
     1354                                std::vector<com::Utf8Str> &aFlags);
     1355    HRESULT pushGuestProperty(const com::Utf8Str &aName,
     1356                              const com::Utf8Str &aValue,
     1357                              LONG64 aTimestamp,
     1358                              const com::Utf8Str &aFlags);
    13521359    HRESULT lockMedia();
    13531360    HRESULT unlockMedia();
    1354 
    1355 private:
     1361    HRESULT ejectMedium(const ComPtr<IMediumAttachment> &aAttachment,
     1362                        ComPtr<IMediumAttachment> &aNewAttachment);
     1363    HRESULT reportVmStatistics(ULONG aValidStats,
     1364                               ULONG aCpuUser,
     1365                               ULONG aCpuKernel,
     1366                               ULONG aCpuIdle,
     1367                               ULONG aMemTotal,
     1368                               ULONG aMemFree,
     1369                               ULONG aMemBalloon,
     1370                               ULONG aMemShared,
     1371                               ULONG aMemCache,
     1372                               ULONG aPagedTotal,
     1373                               ULONG aMemAllocTotal,
     1374                               ULONG aMemFreeTotal,
     1375                               ULONG aMemBalloonTotal,
     1376                               ULONG aMemSharedTotal,
     1377                               ULONG aVmNetRx,
     1378                               ULONG aVmNetTx);
     1379
    13561380
    13571381    struct ConsoleTaskData
     
    13811405    friend struct RestoreSnapshotTask;
    13821406
    1383     HRESULT endSavingState(HRESULT aRC, const Utf8Str &aErrMsg);
     1407    HRESULT i_endSavingState(HRESULT aRC, const Utf8Str &aErrMsg);
    13841408    void i_releaseSavedStateFile(const Utf8Str &strSavedStateFile, Snapshot *pSnapshotToIgnore);
    13851409
  • trunk/src/VBox/Main/src-client/SessionImpl.cpp

    r52252 r52481  
    269269#ifndef VBOX_WITH_GENERIC_SESSION_WATCHER
    270270HRESULT Session::assignMachine(const ComPtr<IMachine> &aMachine,
    271                           LockType_T aLockType,
    272                           const com::Utf8Str &aTokenId)
     271                               LockType_T aLockType,
     272                               const com::Utf8Str &aTokenId)
    273273#else
    274274HRESULT Session::assignMachine(const ComPtr<IMachine> &aMachine,
    275                           LockType_T aLockType,
    276                           const ComPtr<IToken> &aToken)
     275                               LockType_T aLockType,
     276                               const ComPtr<IToken> &aToken)
    277277#endif /* !VBOX_WITH_GENERIC_SESSION_WATCHER */
    278278{
  • trunk/src/VBox/Main/src-server/MachineImpl.cpp

    r52339 r52481  
    18611861{
    18621862    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    1863    
     1863
    18641864    aVideoCaptureOptions = mHWData->mVideoCaptureOptions;
    18651865    return S_OK;
     
    72077207 *  Returns the full path to the machine's log file for an given index.
    72087208 */
    7209 Utf8Str Machine::i_queryLogFilename(ULONG idx) /** @todo r=bird: Misnamed. Should be i_getLogFilename as it cannot fail. See VBox-CodingGuidelines.cpp, Compulsory seciont, line 79. */
     7209Utf8Str Machine::i_queryLogFilename(ULONG idx) /** @todo r=bird: Misnamed. Should be i_getLogFilename as it cannot fail.
     7210                                                   See VBox-CodingGuidelines.cpp, Compulsory seciont, line 79. */
    72107211{
    72117212    Utf8Str logFolder;
     
    74127413            Utf8Str strStartupLogDir = strStartupLogFile;
    74137414            strStartupLogDir.stripFilename();
    7414             RTDirCreateFullPath(strStartupLogDir.c_str(), 0755); /** @todo add a variant for creating the path to a file without stripping the file. */
     7415            RTDirCreateFullPath(strStartupLogDir.c_str(), 0755); /** @todo add a variant for creating the path to a
     7416                                                                     file without stripping the file. */
    74157417        }
    74167418        strSupStartLogArg.append(strStartupLogFile);
     
    1086910871                {
    1087010872                    alock.release();
    10871                     rc = mData->mSession.mMachine->lockMedia();
     10873                    rc = mData->mSession.mMachine->i_lockMedia();
    1087210874                    alock.acquire();
    1087310875                    if (FAILED(rc))
     
    1254812550 *  Passes collected guest statistics to performance collector object
    1254912551 */
    12550 STDMETHODIMP SessionMachine::ReportVmStatistics(ULONG aValidStats, ULONG aCpuUser,
    12551                                                 ULONG aCpuKernel, ULONG aCpuIdle,
    12552                                                 ULONG aMemTotal, ULONG aMemFree,
    12553                                                 ULONG aMemBalloon, ULONG aMemShared,
    12554                                                 ULONG aMemCache, ULONG aPageTotal,
    12555                                                 ULONG aAllocVMM, ULONG aFreeVMM,
    12556                                                 ULONG aBalloonedVMM, ULONG aSharedVMM,
    12557                                                 ULONG aVmNetRx, ULONG aVmNetTx)
     12552HRESULT SessionMachine::reportVmStatistics(ULONG aValidStats, ULONG aCpuUser,
     12553                                           ULONG aCpuKernel, ULONG aCpuIdle,
     12554                                           ULONG aMemTotal, ULONG aMemFree,
     12555                                           ULONG aMemBalloon, ULONG aMemShared,
     12556                                           ULONG aMemCache, ULONG aPageTotal,
     12557                                           ULONG aAllocVMM, ULONG aFreeVMM,
     12558                                           ULONG aBalloonedVMM, ULONG aSharedVMM,
     12559                                           ULONG aVmNetRx, ULONG aVmNetTx)
    1255812560{
    1255912561#ifdef VBOX_WITH_RESOURCE_USAGE_API
     
    1258912591 *  @note Locks this object for writing.
    1259012592 */
    12591 STDMETHODIMP SessionMachine::SetRemoveSavedStateFile(BOOL aRemove)
    12592 {
    12593     AutoCaller autoCaller(this);
    12594     AssertComRCReturn(autoCaller.rc(), autoCaller.rc());
    12595 
     12593HRESULT SessionMachine::setRemoveSavedStateFile(BOOL aRemove)
     12594{
    1259612595    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    1259712596
     
    1260412603 *  @note Locks the same as #i_setMachineState() does.
    1260512604 */
    12606 STDMETHODIMP SessionMachine::UpdateState(MachineState_T aMachineState)
    12607 {
    12608     return i_setMachineState(aMachineState);
     12605HRESULT SessionMachine::updateState(MachineState_T aState)
     12606{
     12607    return i_setMachineState(aState);
    1260912608}
    1261012609
     
    1261212611 *  @note Locks this object for writing.
    1261312612 */
    12614 STDMETHODIMP SessionMachine::BeginPowerUp(IProgress *aProgress)
    12615 {
    12616     LogFlowThisFunc(("aProgress=%p\n", aProgress));
    12617     AutoCaller autoCaller(this);
    12618     AssertComRCReturn(autoCaller.rc(), autoCaller.rc());
     12613HRESULT SessionMachine::beginPowerUp(const ComPtr<IProgress> &aProgress)
     12614{
     12615    IProgress* pProgress(aProgress);
     12616
     12617    LogFlowThisFunc(("aProgress=%p\n", pProgress));
    1261912618
    1262012619    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    1262412623
    1262512624    if (!mData->mSession.mProgress.isNull())
    12626         mData->mSession.mProgress->setOtherProgressObject(aProgress);
     12625        mData->mSession.mProgress->setOtherProgressObject(pProgress);
    1262712626
    1262812627    /* If we didn't reference the NAT network service yet, add a reference to
     
    1266412663 *  @note Locks this object for writing.
    1266512664 */
    12666 STDMETHODIMP SessionMachine::EndPowerUp(LONG iResult)
    12667 {
    12668     AutoCaller autoCaller(this);
    12669     AssertComRCReturn(autoCaller.rc(), autoCaller.rc());
    12670 
     12665HRESULT SessionMachine::endPowerUp(LONG aResult)
     12666{
    1267112667    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    1267212668
     
    1267712673    if (mData->mSession.mProgress)
    1267812674    {
    12679         mData->mSession.mProgress->notifyComplete((HRESULT)iResult);
     12675        mData->mSession.mProgress->notifyComplete((HRESULT)aResult);
    1268012676        mData->mSession.mProgress.setNull();
    1268112677    }
    1268212678
    12683     if (SUCCEEDED((HRESULT)iResult))
     12679    if (SUCCEEDED((HRESULT)aResult))
    1268412680    {
    1268512681#ifdef VBOX_WITH_RESOURCE_USAGE_API
     
    1269812694 *  @note Locks this object for writing.
    1269912695 */
    12700 STDMETHODIMP SessionMachine::BeginPoweringDown(IProgress **aProgress)
     12696HRESULT SessionMachine::beginPoweringDown(ComPtr<IProgress> &aProgress)
    1270112697{
    1270212698    LogFlowThisFuncEnter();
    12703 
    12704     AutoCaller autoCaller(this);
    12705     AssertComRCReturn(autoCaller.rc(), autoCaller.rc());
    1270612699
    1270712700    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    1272512718    i_setMachineState(MachineState_Stopping);
    1272612719
    12727     pProgress.queryInterfaceTo(aProgress);
     12720    pProgress.queryInterfaceTo(aProgress.asOutParam());
    1272812721
    1272912722    return S_OK;
     
    1273312726 *  @note Locks this object for writing.
    1273412727 */
    12735 STDMETHODIMP SessionMachine::EndPoweringDown(LONG iResult, IN_BSTR aErrMsg)
     12728HRESULT SessionMachine::endPoweringDown(LONG aResult,
     12729                                        const com::Utf8Str &aErrMsg)
    1273612730{
    1273712731    LogFlowThisFuncEnter();
    1273812732
    12739     AutoCaller autoCaller(this);
    12740     AssertComRCReturn(autoCaller.rc(), autoCaller.rc());
    12741 
    1274212733    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    1274312734
    12744     AssertReturn(    (   (SUCCEEDED(iResult) && mData->mMachineState == MachineState_PoweredOff)
    12745                       || (FAILED(iResult) && mData->mMachineState == MachineState_Stopping))
     12735    AssertReturn(    (   (SUCCEEDED(aResult) && mData->mMachineState == MachineState_PoweredOff)
     12736                      || (FAILED(aResult) && mData->mMachineState == MachineState_Stopping))
    1274612737                  && mConsoleTaskData.mLastState != MachineState_Null,
    1274712738                 E_FAIL);
     
    1275312744     * MachineState_PoweredOff, so no need to do anything.
    1275412745     */
    12755     if (FAILED(iResult))
     12746    if (FAILED(aResult))
    1275612747        i_setMachineState(mConsoleTaskData.mLastState);
    1275712748
    1275812749    /* notify the progress object about operation completion */
    1275912750    Assert(mConsoleTaskData.mProgress);
    12760     if (SUCCEEDED(iResult))
     12751    if (SUCCEEDED(aResult))
    1276112752        mConsoleTaskData.mProgress->i_notifyComplete(S_OK);
    1276212753    else
    1276312754    {
    12764         Utf8Str strErrMsg(aErrMsg);
    12765         if (strErrMsg.length())
    12766             mConsoleTaskData.mProgress->i_notifyComplete(iResult,
     12755        if (aErrMsg.length())
     12756            mConsoleTaskData.mProgress->i_notifyComplete(aResult,
    1276712757                                                         COM_IIDOF(ISession),
    1276812758                                                         getComponentName(),
    12769                                                          strErrMsg.c_str());
     12759                                                         aErrMsg.c_str());
    1277012760        else
    12771             mConsoleTaskData.mProgress->i_notifyComplete(iResult);
     12761            mConsoleTaskData.mProgress->i_notifyComplete(aResult);
    1277212762    }
    1277312763
     
    1278712777 *  @note Locks the same as USBController::hasMatchingFilter() does.
    1278812778 */
    12789 STDMETHODIMP SessionMachine::RunUSBDeviceFilters(IUSBDevice *aUSBDevice,
    12790                                                  BOOL *aMatched,
    12791                                                  ULONG *aMaskedIfs)
     12779HRESULT SessionMachine::runUSBDeviceFilters(const ComPtr<IUSBDevice> &aDevice,
     12780                                            BOOL *aMatched,
     12781                                            ULONG *aMaskedInterfaces)
    1279212782{
    1279312783    LogFlowThisFunc(("\n"));
    1279412784
    12795     AutoCaller autoCaller(this);
    12796     AssertComRCReturn(autoCaller.rc(), autoCaller.rc());
    12797 
    1279812785#ifdef VBOX_WITH_USB
    12799     *aMatched = mUSBDeviceFilters->i_hasMatchingFilter(aUSBDevice, aMaskedIfs);
     12786    *aMatched = mUSBDeviceFilters->i_hasMatchingFilter(aDevice, aMaskedInterfaces);
    1280012787#else
    12801     NOREF(aUSBDevice);
    12802     NOREF(aMaskedIfs);
     12788    NOREF(aDevice);
     12789    NOREF(aMaskedInterfaces);
    1280312790    *aMatched = FALSE;
    1280412791#endif
     
    1281012797 *  @note Locks the same as Host::captureUSBDevice() does.
    1281112798 */
    12812 STDMETHODIMP SessionMachine::CaptureUSBDevice(IN_BSTR aId)
     12799HRESULT SessionMachine::captureUSBDevice(const com::Guid &aId)
    1281312800{
    1281412801    LogFlowThisFunc(("\n"));
    12815 
    12816     AutoCaller autoCaller(this);
    12817     AssertComRCReturnRC(autoCaller.rc());
    1281812802
    1281912803#ifdef VBOX_WITH_USB
     
    1282512809    USBProxyService *service = mParent->i_host()->i_usbProxyService();
    1282612810    AssertReturn(service, E_FAIL);
    12827     return service->captureDeviceForVM(this, Guid(aId).ref());
     12811    return service->captureDeviceForVM(this, aId.ref());
    1282812812#else
    1282912813    NOREF(aId);
     
    1283512819 *  @note Locks the same as Host::detachUSBDevice() does.
    1283612820 */
    12837 STDMETHODIMP SessionMachine::DetachUSBDevice(IN_BSTR aId, BOOL aDone)
     12821HRESULT SessionMachine::detachUSBDevice(const com::Guid &aId,
     12822                                        BOOL aDone)
    1283812823{
    1283912824    LogFlowThisFunc(("\n"));
    12840 
    12841     AutoCaller autoCaller(this);
    12842     AssertComRCReturn(autoCaller.rc(), autoCaller.rc());
    1284312825
    1284412826#ifdef VBOX_WITH_USB
    1284512827    USBProxyService *service = mParent->i_host()->i_usbProxyService();
    1284612828    AssertReturn(service, E_FAIL);
    12847     return service->detachDeviceFromVM(this, Guid(aId).ref(), !!aDone);
     12829    return service->detachDeviceFromVM(this, aId.ref(), !!aDone);
    1284812830#else
    1284912831    NOREF(aId);
     
    1286112843 *  @note Locks what called methods lock.
    1286212844 */
    12863 STDMETHODIMP SessionMachine::AutoCaptureUSBDevices()
     12845HRESULT SessionMachine::autoCaptureUSBDevices()
    1286412846{
    1286512847    LogFlowThisFunc(("\n"));
    12866 
    12867     AutoCaller autoCaller(this);
    12868     AssertComRCReturn(autoCaller.rc(), autoCaller.rc());
    1286912848
    1287012849#ifdef VBOX_WITH_USB
     
    1289112870 *  @note Locks what called methods lock.
    1289212871 */
    12893 STDMETHODIMP SessionMachine::DetachAllUSBDevices(BOOL aDone)
     12872HRESULT SessionMachine::detachAllUSBDevices(BOOL aDone)
    1289412873{
    1289512874    LogFlowThisFunc(("\n"));
    12896 
    12897     AutoCaller autoCaller(this);
    12898     AssertComRCReturn(autoCaller.rc(), autoCaller.rc());
    1289912875
    1290012876#ifdef VBOX_WITH_USB
     
    1291512891 *  @note Locks this object for writing.
    1291612892 */
    12917 STDMETHODIMP SessionMachine::OnSessionEnd(ISession *aSession,
    12918                                           IProgress **aProgress)
     12893HRESULT SessionMachine::onSessionEnd(const ComPtr<ISession> &aSession,
     12894                                     ComPtr<IProgress> &aProgress)
    1291912895{
    1292012896    LogFlowThisFuncEnter();
    12921 
    12922     AssertReturn(aSession, E_INVALIDARG);
    12923     AssertReturn(aProgress, E_INVALIDARG);
    12924 
    12925     AutoCaller autoCaller(this);
    1292612897
    1292712898    LogFlowThisFunc(("callerstate=%d\n", getObjectState().getState()));
     
    1293012901     *  informs us it is closed right after we've been uninitialized -- it's ok.
    1293112902     */
    12932     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1293312903
    1293412904    /* get IInternalSessionControl interface */
     
    1294312913    if (control == mData->mSession.mDirectControl)
    1294412914    {
    12945         ComAssertRet(aProgress, E_POINTER);
     12915        IProgress *pProgress = aProgress;
     12916        ComAssertRet(pProgress, E_POINTER);
    1294612917
    1294712918        /* The direct session is being normally closed by the client process
     
    1298012951                       Bstr(tr("Closing session")).raw(),
    1298112952                       FALSE /* aCancelable */);
    12982         progress.queryInterfaceTo(aProgress);
     12953        progress.queryInterfaceTo(aProgress.asOutParam());
    1298312954        mData->mSession.mProgress = progress;
    1298412955    }
     
    1301212983 *  @note Locks this object for writing.
    1301312984 */
    13014 STDMETHODIMP SessionMachine::BeginSavingState(IProgress **aProgress, BSTR *aStateFilePath)
     12985HRESULT SessionMachine::beginSavingState(ComPtr<IProgress> &aProgress,
     12986                                         com::Utf8Str &aStateFilePath)
    1301512987{
    1301612988    LogFlowThisFuncEnter();
    13017 
    13018     CheckComArgOutPointerValid(aProgress);
    13019     CheckComArgOutPointerValid(aStateFilePath);
    13020 
    13021     AutoCaller autoCaller(this);
    13022     AssertComRCReturn(autoCaller.rc(), autoCaller.rc());
    1302312989
    1302412990    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    1303713003                    FALSE /* aCancelable */);
    1303813004
    13039     Utf8Str strStateFilePath;
    1304013005    /* stateFilePath is null when the machine is not running */
    1304113006    if (mData->mMachineState == MachineState_Paused)
    13042         i_composeSavedStateFilename(strStateFilePath);
     13007        i_composeSavedStateFilename(aStateFilePath);
    1304313008
    1304413009    /* fill in the console task data */
    1304513010    mConsoleTaskData.mLastState = mData->mMachineState;
    13046     mConsoleTaskData.strStateFilePath = strStateFilePath;
     13011    mConsoleTaskData.strStateFilePath = aStateFilePath;
    1304713012    mConsoleTaskData.mProgress = pProgress;
    1304813013
     
    1305013015    i_setMachineState(MachineState_Saving);
    1305113016
    13052     strStateFilePath.cloneTo(aStateFilePath);
    13053     pProgress.queryInterfaceTo(aProgress);
     13017    pProgress.queryInterfaceTo(aProgress.asOutParam());
    1305413018
    1305513019    return S_OK;
     
    1305913023 *  @note Locks mParent + this object for writing.
    1306013024 */
    13061 STDMETHODIMP SessionMachine::EndSavingState(LONG iResult, IN_BSTR aErrMsg)
     13025HRESULT SessionMachine::endSavingState(LONG aResult,
     13026                                       const com::Utf8Str &aErrMsg)
    1306213027{
    1306313028    LogFlowThisFunc(("\n"));
    13064 
    13065     AutoCaller autoCaller(this);
    13066     AssertComRCReturn(autoCaller.rc(), autoCaller.rc());
    1306713029
    1306813030    /* endSavingState() need mParent lock */
    1306913031    AutoMultiWriteLock2 alock(mParent, this COMMA_LOCKVAL_SRC_POS);
    1307013032
    13071     AssertReturn(    (   (SUCCEEDED(iResult) && mData->mMachineState == MachineState_Saved)
    13072                       || (FAILED(iResult) && mData->mMachineState == MachineState_Saving))
     13033    AssertReturn(    (   (SUCCEEDED(aResult) && mData->mMachineState == MachineState_Saved)
     13034                      || (FAILED(aResult) && mData->mMachineState == MachineState_Saving))
    1307313035                  && mConsoleTaskData.mLastState != MachineState_Null
    1307413036                  && !mConsoleTaskData.strStateFilePath.isEmpty(),
     
    1308113043     * MachineState_Saved, so no need to do anything.
    1308213044     */
    13083     if (FAILED(iResult))
     13045    if (FAILED(aResult))
    1308413046        i_setMachineState(mConsoleTaskData.mLastState);
    1308513047
    13086     return endSavingState(iResult, aErrMsg);
     13048    return i_endSavingState(aResult, aErrMsg);
    1308713049}
    1308813050
     
    1309013052 *  @note Locks this object for writing.
    1309113053 */
    13092 STDMETHODIMP SessionMachine::AdoptSavedState(IN_BSTR aSavedStateFile)
     13054HRESULT SessionMachine::adoptSavedState(const com::Utf8Str &aSavedStateFile)
    1309313055{
    1309413056    LogFlowThisFunc(("\n"));
    13095 
    13096     CheckComArgStrNotEmptyOrNull(aSavedStateFile);
    13097 
    13098     AutoCaller autoCaller(this);
    13099     AssertComRCReturn(autoCaller.rc(), autoCaller.rc());
    1310013057
    1310113058    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    1310613063                 , E_FAIL); /** @todo setError. */
    1310713064
    13108     Utf8Str stateFilePathFull = aSavedStateFile;
    13109     int vrc = i_calculateFullPath(stateFilePathFull, stateFilePathFull);
     13065    com::Utf8Str stateFilePathFull = aSavedStateFile;
     13066    int vrc = i_calculateFullPath(aSavedStateFile, stateFilePathFull);
    1311013067    if (RT_FAILURE(vrc))
    1311113068        return setError(VBOX_E_FILE_ERROR,
    13112                         tr("Invalid saved state file path '%ls' (%Rrc)"),
    13113                         aSavedStateFile,
     13069                        tr("Invalid saved state file path '%s' (%Rrc)"),
     13070                        stateFilePathFull.c_str(),
    1311413071                        vrc);
    1311513072
     
    1312213079}
    1312313080
    13124 STDMETHODIMP SessionMachine::PullGuestProperties(ComSafeArrayOut(BSTR, aNames),
    13125                                                  ComSafeArrayOut(BSTR, aValues),
    13126                                                  ComSafeArrayOut(LONG64, aTimestamps),
    13127                                                  ComSafeArrayOut(BSTR, aFlags))
     13081HRESULT SessionMachine::pullGuestProperties(std::vector<com::Utf8Str> &aNames,
     13082                                            std::vector<com::Utf8Str> &aValues,
     13083                                            std::vector<LONG64>       &aTimestamps,
     13084                                            std::vector<com::Utf8Str> &aFlags)
    1312813085{
    1312913086    LogFlowThisFunc(("\n"));
     
    1313213089    using namespace guestProp;
    1313313090
    13134     AutoCaller autoCaller(this);
    13135     AssertComRCReturn(autoCaller.rc(), autoCaller.rc());
    13136 
    1313713091    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    1313813092
    13139     CheckComArgOutSafeArrayPointerValid(aNames);
    13140     CheckComArgOutSafeArrayPointerValid(aValues);
    13141     CheckComArgOutSafeArrayPointerValid(aTimestamps);
    13142     CheckComArgOutSafeArrayPointerValid(aFlags);
    13143 
    1314413093    size_t cEntries = mHWData->mGuestProperties.size();
    13145     com::SafeArray<BSTR> names(cEntries);
    13146     com::SafeArray<BSTR> values(cEntries);
    13147     com::SafeArray<LONG64> timestamps(cEntries);
    13148     com::SafeArray<BSTR> flags(cEntries);
    13149     unsigned i = 0;
     13094    aNames.resize(cEntries);
     13095    aValues.resize(cEntries);
     13096    aTimestamps.resize(cEntries);
     13097    aFlags.resize(cEntries);
     13098
     13099    size_t  i = 0;
    1315013100    for (HWData::GuestPropertyMap::iterator it = mHWData->mGuestProperties.begin();
    1315113101         it != mHWData->mGuestProperties.end();
    13152          ++it)
     13102         ++it, ++i)
    1315313103    {
    1315413104        char szFlags[MAX_FLAGS_LEN + 1];
    13155         it->first.cloneTo(&names[i]);
    13156         it->second.strValue.cloneTo(&values[i]);
    13157         timestamps[i] = it->second.mTimestamp;
     13105        aNames[i] = it->first;
     13106        aValues[i] = it->second.strValue;
     13107        aTimestamps[i] = it->second.mTimestamp;
     13108
    1315813109        /* If it is NULL, keep it NULL. */
    1315913110        if (it->second.mFlags)
    1316013111        {
    1316113112            writeFlags(it->second.mFlags, szFlags);
    13162             Bstr(szFlags).cloneTo(&flags[i]);
     13113            aFlags[i] = szFlags;
    1316313114        }
    1316413115        else
    13165             flags[i] = NULL;
    13166         ++i;
    13167     }
    13168     names.detachTo(ComSafeArrayOutArg(aNames));
    13169     values.detachTo(ComSafeArrayOutArg(aValues));
    13170     timestamps.detachTo(ComSafeArrayOutArg(aTimestamps));
    13171     flags.detachTo(ComSafeArrayOutArg(aFlags));
     13116            aFlags[i] = "";
     13117    }
    1317213118    return S_OK;
    1317313119#else
     
    1317613122}
    1317713123
    13178 STDMETHODIMP SessionMachine::PushGuestProperty(IN_BSTR aName,
    13179                                                IN_BSTR aValue,
    13180                                                LONG64  aTimestamp,
    13181                                                IN_BSTR aFlags)
     13124HRESULT SessionMachine::pushGuestProperty(const  com::Utf8Str &aName,
     13125                                          const  com::Utf8Str &aValue,
     13126                                                 LONG64       aTimestamp,
     13127                                          const  com::Utf8Str &aFlags)
    1318213128{
    1318313129    LogFlowThisFunc(("\n"));
     
    1318513131#ifdef VBOX_WITH_GUEST_PROPS
    1318613132    using namespace guestProp;
    13187 
    13188     CheckComArgStrNotEmptyOrNull(aName);
    13189     CheckComArgNotNull(aValue);
    13190     CheckComArgNotNull(aFlags);
    1319113133
    1319213134    try
     
    1319513137         * Convert input up front.
    1319613138         */
    13197         Utf8Str  utf8Name(aName);
    1319813139        uint32_t fFlags = NILFLAG;
    13199         if (aFlags)
    13200         {
    13201             Utf8Str utf8Flags(aFlags);
    13202             int vrc = validateFlags(utf8Flags.c_str(), &fFlags);
     13140        if (aFlags.length())
     13141        {
     13142            int vrc = validateFlags(aFlags.c_str(), &fFlags);
    1320313143            AssertRCReturn(vrc, E_INVALIDARG);
    1320413144        }
     
    1320713147         * Now grab the object lock, validate the state and do the update.
    1320813148         */
    13209         AutoCaller autoCaller(this);
    13210         if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1321113149
    1321213150        AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    1323313171        mHWData.backup();
    1323413172
    13235         bool fDelete = !RT_VALID_PTR(aValue) || *(aValue) == '\0';
    13236         HWData::GuestPropertyMap::iterator it = mHWData->mGuestProperties.find(utf8Name);
     13173        bool fDelete = !aValue.length();
     13174        HWData::GuestPropertyMap::iterator it = mHWData->mGuestProperties.find(aName);
    1323713175        if (it != mHWData->mGuestProperties.end())
    1323813176        {
     
    1325513193            prop.mFlags     = fFlags;
    1325613194
    13257             mHWData->mGuestProperties[utf8Name] = prop;
     13195            mHWData->mGuestProperties[aName] = prop;
    1325813196            mData->mGuestPropertiesModified = TRUE;
    1325913197        }
     
    1326513203             || RTStrSimplePatternMultiMatch(mHWData->mGuestPropertyNotificationPatterns.c_str(),
    1326613204                                             RTSTR_MAX,
    13267                                              utf8Name.c_str(),
     13205                                             aName.c_str(),
    1326813206                                             RTSTR_MAX, NULL)
    1326913207           )
     
    1327213210
    1327313211            mParent->i_onGuestPropertyChange(mData->mUuid,
    13274                                              aName,
    13275                                              aValue,
    13276                                              aFlags);
     13212                                             Bstr(aName).raw(),
     13213                                             Bstr(aValue).raw(),
     13214                                             Bstr(aFlags).raw());
    1327713215        }
    1327813216    }
     
    1328713225}
    1328813226
    13289 STDMETHODIMP SessionMachine::LockMedia()
    13290 {
    13291     AutoCaller autoCaller(this);
    13292     AssertComRCReturn(autoCaller.rc(), autoCaller.rc());
    13293 
     13227
     13228HRESULT SessionMachine::lockMedia()
     13229{
    1329413230    AutoMultiWriteLock2 alock(this->lockHandle(),
    1329513231                              &mParent->i_getMediaTreeLockHandle() COMMA_LOCKVAL_SRC_POS);
     
    1330113237    clearError();
    1330213238    alock.release();
    13303     return lockMedia();
    13304 }
    13305 
    13306 STDMETHODIMP SessionMachine::UnlockMedia()
    13307 {
    13308     HRESULT hrc = unlockMedia();
     13239    return i_lockMedia();
     13240}
     13241
     13242HRESULT SessionMachine::unlockMedia()
     13243{
     13244    HRESULT hrc = i_unlockMedia();
    1330913245    return hrc;
    1331013246}
    1331113247
    13312 STDMETHODIMP SessionMachine::EjectMedium(IMediumAttachment *aAttachment,
    13313                                          IMediumAttachment **aNewAttachment)
    13314 {
    13315     CheckComArgNotNull(aAttachment);
    13316     CheckComArgOutPointerValid(aNewAttachment);
    13317 
    13318     AutoCaller autoCaller(this);
    13319     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    13320 
     13248HRESULT SessionMachine::ejectMedium(const ComPtr<IMediumAttachment> &aAttachment,
     13249                                    ComPtr<IMediumAttachment> &aNewAttachment)
     13250{
    1332113251    // request the host lock first, since might be calling Host methods for getting host drives;
    1332213252    // next, protect the media tree all the while we're in here, as well as our member variables
     
    1332513255                                  &mParent->i_getMediaTreeLockHandle() COMMA_LOCKVAL_SRC_POS);
    1332613256
    13327     ComObjPtr<MediumAttachment> pAttach = static_cast<MediumAttachment *>(aAttachment);
     13257    IMediumAttachment *iAttach = aAttachment;
     13258    ComObjPtr<MediumAttachment> pAttach = static_cast<MediumAttachment *>(iAttach);
    1332813259
    1332913260    Bstr ctrlName;
     
    1333213263    bool fTempEject;
    1333313264    {
    13334         AutoCaller autoAttachCaller(this);
    13335         if (FAILED(autoAttachCaller.rc())) return autoAttachCaller.rc();
    13336 
    1333713265        AutoReadLock attLock(pAttach COMMA_LOCKVAL_SRC_POS);
    1333813266
     
    1338413312    }
    1338513313
    13386     pAttach.queryInterfaceTo(aNewAttachment);
     13314    pAttach.queryInterfaceTo(aNewAttachment.asOutParam());
    1338713315
    1338813316    return S_OK;
     
    1397513903 *  @note Locks mParent + this objects for writing.
    1397613904 */
    13977 HRESULT SessionMachine::endSavingState(HRESULT aRc, const Utf8Str &aErrMsg)
     13905HRESULT SessionMachine::i_endSavingState(HRESULT aRc, const Utf8Str &aErrMsg)
    1397813906{
    1397913907    LogFlowThisFuncEnter();
     
    1407414002 * no more needed.
    1407514003 */
    14076 HRESULT SessionMachine::lockMedia()
     14004HRESULT SessionMachine::i_lockMedia()
    1407714005{
    1407814006    AutoCaller autoCaller(this);
     
    1415114079 * Undoes the locks made by by #lockMedia().
    1415214080 */
    14153 HRESULT SessionMachine::unlockMedia()
     14081HRESULT SessionMachine::i_unlockMedia()
    1415414082{
    1415514083    AutoCaller autoCaller(this);
  • trunk/src/VBox/Main/src-server/SnapshotImpl.cpp

    r52168 r52481  
    13941394 * @return
    13951395 */
    1396 STDMETHODIMP SessionMachine::BeginTakingSnapshot(IConsole *aInitiator,
    1397                                                  IN_BSTR aName,
    1398                                                  IN_BSTR aDescription,
    1399                                                  IProgress *aConsoleProgress,
    1400                                                  BOOL fTakingSnapshotOnline,
    1401                                                  BSTR *aStateFilePath)
     1396HRESULT SessionMachine::beginTakingSnapshot(const ComPtr<IConsole> &aInitiator,
     1397                                            const com::Utf8Str &aName,
     1398                                            const com::Utf8Str &aDescription,
     1399                                            const ComPtr<IProgress> &aConsoleProgress,
     1400                                            BOOL  aFTakingSnapshotOnline,
     1401                                            com::Utf8Str &aStateFilePath)
    14021402{
    14031403    LogFlowThisFuncEnter();
    14041404
    1405     AssertReturn(aInitiator && aName, E_INVALIDARG);
    1406     AssertReturn(aStateFilePath, E_POINTER);
    1407 
    1408     LogFlowThisFunc(("aName='%ls' fTakingSnapshotOnline=%RTbool\n", aName, fTakingSnapshotOnline));
    1409 
    1410     AutoCaller autoCaller(this);
    1411     AssertComRCReturn(autoCaller.rc(), autoCaller.rc());
     1405    LogFlowThisFunc(("aName='%s' aFTakingSnapshotOnline=%RTbool\n", aName.c_str(), aFTakingSnapshotOnline));
    14121406
    14131407    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    14281422    }
    14291423
    1430     if (    !fTakingSnapshotOnline
     1424    if (    !aFTakingSnapshotOnline
    14311425         && mData->mMachineState != MachineState_Saved
    14321426       )
     
    14441438    snapshotId.create();
    14451439
    1446     Utf8Str strStateFilePath;
    14471440    /* stateFilePath is null when the machine is not online nor saved */
    1448     if (fTakingSnapshotOnline)
     1441    if (aFTakingSnapshotOnline)
    14491442    {
    14501443        Bstr value;
     
    14521445                                  value.asOutParam());
    14531446        if (FAILED(rc) || value != "1")
    1454         {
    14551447            // creating a new online snapshot: we need a fresh saved state file
    1456             i_composeSavedStateFilename(strStateFilePath);
    1457         }
     1448            i_composeSavedStateFilename(aStateFilePath);
    14581449    }
    14591450    else if (mData->mMachineState == MachineState_Saved)
    14601451        // taking an online snapshot from machine in "saved" state: then use existing state file
    1461         strStateFilePath = mSSData->strStateFilePath;
    1462 
    1463     if (strStateFilePath.isNotEmpty())
     1452        aStateFilePath = mSSData->strStateFilePath;
     1453
     1454    if (aStateFilePath.isNotEmpty())
    14641455    {
    14651456        // ensure the directory for the saved state file exists
    1466         HRESULT rc = VirtualBox::i_ensureFilePathExists(strStateFilePath, true /* fCreate */);
     1457        HRESULT rc = VirtualBox::i_ensureFilePathExists(aStateFilePath, true /* fCreate */);
    14671458        if (FAILED(rc)) return rc;
    14681459    }
     
    14711462    ComObjPtr<SnapshotMachine> snapshotMachine;
    14721463    snapshotMachine.createObject();
    1473     HRESULT rc = snapshotMachine->init(this, snapshotId.ref(), strStateFilePath);
     1464    HRESULT rc = snapshotMachine->init(this, snapshotId.ref(), aStateFilePath);
    14741465    AssertComRCReturn(rc, rc);
    14751466
     
    14901481    mConsoleTaskData.mLastState = mData->mMachineState;
    14911482    mConsoleTaskData.mSnapshot = pSnapshot;
     1483
    14921484    /// @todo in the long run the progress object should be moved to
    14931485    // VBoxSVC to avoid trouble with monitoring the progress object state
     
    14981490    {
    14991491        LogFlowThisFunc(("Creating differencing hard disks (online=%d)...\n",
    1500                          fTakingSnapshotOnline));
     1492                         aFTakingSnapshotOnline));
    15011493
    15021494        // backup the media data so we can recover if things goes wrong along the day;
     
    15151507        rc = i_createImplicitDiffs(aConsoleProgress,
    15161508                                   1,            // operation weight; must be the same as in Console::TakeSnapshot()
    1517                                    !!fTakingSnapshotOnline);
     1509                                   !!aFTakingSnapshotOnline);
    15181510        if (FAILED(rc))
    15191511            throw rc;
     
    15431535    }
    15441536
    1545     if (fTakingSnapshotOnline && SUCCEEDED(rc))
    1546         strStateFilePath.cloneTo(aStateFilePath);
    1547     else
    1548         *aStateFilePath = NULL;
     1537    if (!(aFTakingSnapshotOnline && SUCCEEDED(rc)))
     1538        aStateFilePath = "";
    15491539
    15501540    LogFlowThisFunc(("LEAVE - %Rhrc [%s]\n", rc, Global::stringifyMachineState(mData->mMachineState) ));
     
    15661556 * @return
    15671557 */
    1568 STDMETHODIMP SessionMachine::EndTakingSnapshot(BOOL aSuccess)
     1558HRESULT SessionMachine::endTakingSnapshot(BOOL aSuccess)
    15691559{
    15701560    LogFlowThisFunc(("\n"));
    1571 
    1572     AutoCaller autoCaller(this);
    1573     AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    15741561
    15751562    AutoWriteLock machineLock(this COMMA_LOCKVAL_SRC_POS);
     
    16931680 * @return
    16941681 */
    1695 STDMETHODIMP SessionMachine::RestoreSnapshot(IConsole *aInitiator,
    1696                                              ISnapshot *aSnapshot,
    1697                                              MachineState_T *aMachineState,
    1698                                              IProgress **aProgress)
     1682HRESULT SessionMachine::restoreSnapshot(const ComPtr<IConsole> &aInitiator,
     1683                                        const ComPtr<ISnapshot> &aSnapshot,
     1684                                        MachineState_T *aMachineState,
     1685                                        ComPtr<IProgress> &aProgress)
    16991686{
    17001687    LogFlowThisFuncEnter();
    1701 
    1702     AssertReturn(aInitiator, E_INVALIDARG);
    1703     AssertReturn(aSnapshot && aMachineState && aProgress, E_POINTER);
    1704 
    1705     AutoCaller autoCaller(this);
    1706     AssertComRCReturn(autoCaller.rc(), autoCaller.rc());
    17071688
    17081689    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    17121693                 E_FAIL);
    17131694
    1714     ComObjPtr<Snapshot> pSnapshot(static_cast<Snapshot*>(aSnapshot));
     1695    ISnapshot* iSnapshot = aSnapshot;
     1696    ComObjPtr<Snapshot>pSnapshot(static_cast<Snapshot*>(iSnapshot));
    17151697    ComObjPtr<SnapshotMachine> pSnapMachine = pSnapshot->i_getSnapshotMachine();
    17161698
     
    17691751
    17701752    /* return the progress to the caller */
    1771     pProgress.queryInterfaceTo(aProgress);
     1753    pProgress.queryInterfaceTo(aProgress.asOutParam());
    17721754
    17731755    /* return the new state to the caller */
     
    20552037
    20562038/**
    2057  * Implementation for IInternalMachineControl::DeleteSnapshot().
     2039 * Implementation for IInternalMachineControl::deleteSnapshot().
    20582040 *
    20592041 * Gets called from Console::DeleteSnapshot(), and that's basically the
     
    20702052 * @note Locks mParent + this + children objects for writing!
    20712053 */
    2072 STDMETHODIMP SessionMachine::DeleteSnapshot(IConsole *aInitiator,
    2073                                             IN_BSTR aStartId,
    2074                                             IN_BSTR aEndId,
    2075                                             BOOL fDeleteAllChildren,
    2076                                             MachineState_T *aMachineState,
    2077                                             IProgress **aProgress)
     2054HRESULT SessionMachine::deleteSnapshot(const ComPtr<IConsole> &aInitiator,
     2055                                       const com::Guid &aStartId,
     2056                                       const com::Guid &aEndId,
     2057                                       BOOL aDeleteAllChildren,
     2058                                       MachineState_T *aMachineState,
     2059                                       ComPtr<IProgress> &aProgress)
    20782060{
    20792061    LogFlowThisFuncEnter();
    20802062
    2081     Guid startId(aStartId);
    2082     Guid endId(aEndId);
    2083 
    2084     AssertReturn(aInitiator && !startId.isZero() && !endId.isZero() && startId.isValid() && endId.isValid(), E_INVALIDARG);
     2063    AssertReturn(aInitiator && !aStartId.isZero() && !aEndId.isZero() && aStartId.isValid() && aEndId.isValid(), E_INVALIDARG);
    20852064
    20862065    AssertReturn(aMachineState && aProgress, E_POINTER);
    20872066
    20882067    /** @todo implement the "and all children" and "range" variants */
    2089     if (fDeleteAllChildren || startId != endId)
     2068    if (aDeleteAllChildren || aStartId != aEndId)
    20902069        ReturnComNotImplemented();
    2091 
    2092     AutoCaller autoCaller(this);
    2093     AssertComRCReturn(autoCaller.rc(), autoCaller.rc());
    20942070
    20952071    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    21082084
    21092085    ComObjPtr<Snapshot> pSnapshot;
    2110     HRESULT rc = i_findSnapshotById(startId, pSnapshot, true /* aSetError */);
     2086    HRESULT rc = i_findSnapshotById(aStartId, pSnapshot, true /* aSetError */);
    21112087    if (FAILED(rc)) return rc;
    21122088
     
    22262202
    22272203    /* return the progress to the caller */
    2228     pProgress.queryInterfaceTo(aProgress);
     2204    pProgress.queryInterfaceTo(aProgress.asOutParam());
    22292205
    22302206    /* return the new state to the caller */
     
    34283404
    34293405/**
    3430  * Implementation for IInternalMachineControl::FinishOnlineMergeMedium().
     3406 * Implementation for IInternalMachineControl::finishOnlineMergeMedium().
    34313407 *
    34323408 * Gets called after the successful completion of an online merge from
     
    34373413 * can continue with the updated state of the medium chain.
    34383414 */
    3439 STDMETHODIMP SessionMachine::FinishOnlineMergeMedium()
     3415HRESULT SessionMachine::finishOnlineMergeMedium()
    34403416{
    34413417    HRESULT rc = S_OK;
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