VirtualBox

Ignore:
Timestamp:
Feb 19, 2018 1:38:37 PM (7 years ago)
Author:
vboxsync
Message:

bugref:8345. CHECK_ERROR_BREAK was replaced by CHECK_ERROR_RET.

File:
1 edited

Legend:

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

    r70582 r71054  
    360360        /* Start the moving */
    361361        ComPtr<IProgress> progress;
    362         do
    363         {
    364             /* we have to open a session for this task */
    365             CHECK_ERROR_BREAK(srcMachine, LockMachine(a->session, LockType_Write));
    366             ComPtr<IMachine> sessionMachine;
    367             do
    368             {
    369                 CHECK_ERROR_BREAK(a->session, COMGETTER(Machine)(sessionMachine.asOutParam()));
    370                 CHECK_ERROR_BREAK(sessionMachine, MoveTo(Bstr(pszTargetFolder).raw(),
    371                                        Bstr(pszType).raw(),
    372                                        progress.asOutParam()));
    373                 rc = showProgress(progress);
    374                 CHECK_PROGRESS_ERROR_RET(progress, ("Move VM failed"), RTEXITCODE_FAILURE);
    375 //              CHECK_ERROR_BREAK(sessionMachine, SaveSettings());
    376             } while (0);
    377 
    378             sessionMachine.setNull();
    379             CHECK_ERROR_BREAK(a->session, UnlockMachine());
    380         } while (0);
    381     }
    382 
    383     RTPrintf("Machine has been successfully moved into %s\n", pszTargetFolder);
     362
     363        /* we have to open a session for this task */
     364        CHECK_ERROR_RET(srcMachine, LockMachine(a->session, LockType_Write), RTEXITCODE_FAILURE);
     365        ComPtr<IMachine> sessionMachine;
     366
     367        CHECK_ERROR_RET(a->session, COMGETTER(Machine)(sessionMachine.asOutParam()), RTEXITCODE_FAILURE);
     368        CHECK_ERROR_RET(sessionMachine, MoveTo(Bstr(pszTargetFolder).raw(),
     369                               Bstr(pszType).raw(),
     370                               progress.asOutParam()), RTEXITCODE_FAILURE);
     371        rc = showProgress(progress);
     372        CHECK_PROGRESS_ERROR_RET(progress, ("Move VM failed"), RTEXITCODE_FAILURE);
     373
     374        sessionMachine.setNull();
     375        CHECK_ERROR_RET(a->session, UnlockMachine(), RTEXITCODE_FAILURE);
     376
     377//        do
     378//        {
     379//            /* we have to open a session for this task */
     380//            CHECK_ERROR_BREAK(srcMachine, LockMachine(a->session, LockType_Write));
     381//            ComPtr<IMachine> sessionMachine;
     382//            do
     383//            {
     384//                CHECK_ERROR_BREAK(a->session, COMGETTER(Machine)(sessionMachine.asOutParam()));
     385//                CHECK_ERROR_BREAK(sessionMachine, MoveTo(Bstr(pszTargetFolder).raw(),
     386//                                       Bstr(pszType).raw(),
     387//                                       progress.asOutParam()));
     388//                rc = showProgress(progress);
     389//                CHECK_PROGRESS_ERROR_RET(progress, ("Move VM failed"), RTEXITCODE_FAILURE);
     390////              CHECK_ERROR_BREAK(sessionMachine, SaveSettings());
     391//            } while (0);
     392//
     393//            sessionMachine.setNull();
     394//            CHECK_ERROR_BREAK(a->session, UnlockMachine());
     395//        } while (0);
     396        RTPrintf("Machine has been successfully moved into %s\n", pszTargetFolder);
     397    }
    384398
    385399    return RTEXITCODE_SUCCESS;
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