VirtualBox

Ignore:
Timestamp:
Jun 24, 2019 11:31:56 AM (5 years ago)
Author:
vboxsync
Message:

bugref:9416. Fixed progress calculation.

File:
1 edited

Legend:

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

    r79171 r79306  
    18521852                    else
    18531853                    {
     1854                        /* Just skip the rest images if they exist. Only the first image is used as the base image. */
     1855                        if (currImageObjectNum >= 1)
     1856                            continue;
     1857
    18541858                        /* Image format is supported by VBox so extract the file and try to convert
    18551859                         * one to the default format (which is VMDK for now) */
     
    21672171            while (++currOperation < operationCount)
    21682172            {
    2169                 pTask->pProgress->SetNextOperation(BstrFmt("Skipping the cleanup phase. All right.").raw(), 25);
     2173                pTask->pProgress->SetNextOperation(BstrFmt("Skipping the cleanup phase. All right.").raw(), 1);
    21702174                LogRel(("%s: Skipping the cleanup step %d\n", __FUNCTION__, currOperation));
    21712175            }
     
    30353039             * 3. Download the object from the Object Storage:
    30363040             *    - 1 operation (starting and downloadind is one operation)
    3037              * 4. Open the object, extract QCOW2 image and convert one QCOW2->VDI:
     3041             * 4. Open the object, extract an image and convert one to VDI:
    30383042             *    - 1 operation (extracting and conversion are piped) because only 1 base bootable image is imported for now
    30393043             * 5. Create VM with user settings and attach the converted image to VM:
     
    30453049             *    Both require a new Progress object. To work with these functions the original Progress object uses
    30463050             *    the function Progress::waitForOtherProgressCompletion().
    3047              *    Example 1:
    3048              *      1 image was registered in the VBox, 1 VM was created and image was attahced. Next something fails
    3049              *    and we should clean up the disk space. Machine::unregister() return the list of HDDs for deletion.
    3050              *    Machine::deleteConfig() deletes these HDDs but except this a VM setting file, a previous VM setting
    3051              *    file, the snapshots are also deleted. And the original Progress should count these steps correctly.
    3052              *    In this example we will have only couple additional files - VM setting files. As result we
    3053              *    speculate that the number of cleanup operations will be 3: 1 image + 1 setting file + 1 prev setting file.
    3054              *    No snapshots and logs here. But possible situation when the image wasn't attached due to some error.
    3055              *    Thus the number of operations will be 2 instead of 3 (VM registered but no HDDs).
    3056              *    Example 2:
    3057              *      1 image was registered in the VBox, VM wasn't created due to an error. Here we have only
    3058              *    1 operation which uses Progress it's Medium::deleteStorage(). Loop with one interation.
    30593051             *
    3060              *    The problem here is in that we don't know exactly how many operations will be when Progress has been
    3061              *    setting up here. We just may speculate.
     3052             * Some speculation here...
     3053             * Total: 2+2+1(cloud) + 1+1(local) + 1+1+1(cleanup) = 10 operations
     3054             * or
     3055             * Total: 2+2+1(cloud) + 1+1(local) + 1(cleanup) = 8 operations
     3056             * if VM wasn't created we would have only 1 registered image for cleanup.
    30623057             *
    3063              *    What to do if the number of the imported images will be more than 1 in the future?
    3064              *    What to do if some cloud operations won't be needed for the other Cloud providers?
    3065              *    What to do if the number of cloud operations will differ among Cloud providers?
    3066              *    Only Cloud provider shall know the answer on the last two questions.
    3067              *    As result, we speculate about tne number of the operations in the Cloud and we speculate
    3068              *    about the number of the local operations.
    3069              *
    3070              * Total: 2+2+1(cloud) + 1+1(local) + 1+1+1(cleanup) = 10 operations
    3071              *
    3072              * Weight "#define"s for the CLoud operations are located in the file OCICloudClient.h.
     3058             * Weight "#define"s for the Cloud operations are located in the file OCICloudClient.h.
    30733059             * Weight of cloud import operations (1-3 items from above):
    30743060             * Total = 750 = 25+75(start and wait)+25+375(start and wait)+250(download)
     
    30793065             * Weight of local cleanup operations (6 item from above):
    30803066             * Some speculation here...
    3081              * Total = 100 = 50 (1 image) + 25 (1 setting file)+ 25 (1 prev setting file)
     3067             * Total = 3 = 1 (1 image) + 1 (1 setting file)+ 1 (1 prev setting file) - quick operations
     3068             * or
     3069             * Total = 1 (1 image) if VM wasn't created we would have only 1 registered image for now.
    30823070             */
    30833071            try
     
    30903078                                        10, // ULONG cOperations,
    30913079                                        1000, // ULONG ulTotalOperationsWeight,
    3092                                         Utf8Str(tr("Importing VM from Cloud...")), // aFirstOperationDescription
    3093                                         10); // ULONG ulFirstOperationWeight
     3080                                        Utf8Str(tr("Start import VM from the Cloud...")), // aFirstOperationDescription
     3081                                        25); // ULONG ulFirstOperationWeight
    30943082                if (SUCCEEDED(rc))
    30953083                    pTask = new TaskCloud(this, TaskCloud::Import, locInfo, progress);
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