VirtualBox

Changeset 71992 in vbox


Ignore:
Timestamp:
Apr 24, 2018 7:26:23 AM (7 years ago)
Author:
vboxsync
Message:

bugref:8345. Fixed the progress operation counter.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/MachineImplMoveVM.cpp

    r71990 r71992  
    889889        {
    890890            /*
    891              * Fix the progress count
    892              * In instance, the whole "move vm" operation is failed on 9th step. But total count is 20.
     891             * Fix the progress counter
     892             * In instance, the whole "move vm" operation is failed on 5th step. But total count is 20.
    893893             * Where 20 = 2 * 10 operations, where 10 is the real number of operations. And this value was doubled
    894894             * earlier in the init() exactly for one reason - rollback operation. Because in this case we must do
    895895             * the same operations but in backward direction.
    896              * Thus now we want to correct progress operation count from 9 to 11. Why?
    897              * Because we should have evaluated count as "20/2 + (20/2 - 9)" = 11 or just "20 - 9" = 11
     896             * Thus now we want to correct the progress counter from 5 to 15. Why?
     897             * Because we should have evaluated the counter as "20/2 + (20/2 - 5)" = 15 or just "20 - 5" = 15
     898             * And because the 5th step failed it shouldn't be counted.
     899             * As result, we need to rollback 4 operations.
     900             * Thus we start from "operation + 1" and finish when "i < operationCount - operation".
    898901             */
    899             for (ULONG i = operation; i < operationCount - operation; ++i)
     902            for (ULONG i = operation + 1; i < operationCount - operation; ++i)
    900903            {
    901904                rc = taskMoveVM->m_pProgress->SetNextOperation(BstrFmt("Skip the empty operation %d...", i + 1).raw(), 1);
     
    947950        /* Restore an original path to XML setting file */
    948951        {
    949             LogRelFunc(("Rollback scenario: Restore an original path to XML setting file\n"));
     952            LogRelFunc(("Rollback scenario: restoration of the original path to XML setting file\n"));
    950953            Utf8Str strOriginalSettingsFilePath = taskMoveVM->vmFolders[VBox_SettingFolder];
    951954            strOriginalSettingsFilePath.append(RTPATH_DELIMITER).append(Utf8Str(bstrMachineName)).append(".vbox");
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