VirtualBox

Changeset 54523 in vbox


Ignore:
Timestamp:
Feb 26, 2015 8:45:50 AM (10 years ago)
Author:
vboxsync
Message:

VBoxManageControlVM: explicitly call SaveMachine for a few more functions

File:
1 edited

Legend:

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

    r54421 r54523  
    8585{
    8686    using namespace com;
     87    bool fNeedsSaving = false;
    8788    HRESULT rc;
    8889
     
    100101    CHECK_ERROR_RET(machine, LockMachine(a->session, LockType_Shared), 1);
    101102
     103    ComPtr<IConsole> console;
     104    ComPtr<IMachine> sessionMachine;
     105
    102106    do
    103107    {
    104108        /* get the associated console */
    105         ComPtr<IConsole> console;
    106109        CHECK_ERROR_BREAK(a->session, COMGETTER(Console)(console.asOutParam()));
    107110        /* ... and session machine */
    108         ComPtr<IMachine> sessionMachine;
    109111        CHECK_ERROR_BREAK(a->session, COMGETTER(Machine)(sessionMachine.asOutParam()));
    110112
     
    561563#undef ITERATE_TO_NEXT_TERM
    562564            }
    563             /* commit changes */
    564565            if (SUCCEEDED(rc))
    565                 CHECK_ERROR(sessionMachine, SaveSettings());
     566                fNeedsSaving = true;
    566567        }
    567568        else if (!strncmp(a->argv[1], "nicproperty", 11))
     
    603604                            Bstr bstrValue = &pDelimiter[1];
    604605                            CHECK_ERROR(adapter, SetProperty(bstrName.raw(), bstrValue.raw()));
     606                            if (SUCCEEDED(rc))
     607                                fNeedsSaving = true;
    605608                        }
    606609                        else
     
    665668
    666669                    CHECK_ERROR(adapter, COMSETTER(PromiscModePolicy)(enmPromiscModePolicy));
     670                    if (SUCCEEDED(rc))
     671                        fNeedsSaving = true;
    667672                }
    668673                else
     
    16631668    } while (0);
    16641669
     1670    /* The client has to trigger saving the state explicitely. */
     1671    if (fNeedsSaving)
     1672        CHECK_ERROR(sessionMachine, SaveSettings());
     1673
    16651674    a->session->UnlockMachine();
    16661675
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