VirtualBox

Changeset 74886 in vbox for trunk/src/VBox/Main/src-server


Ignore:
Timestamp:
Oct 17, 2018 3:21:01 PM (6 years ago)
Author:
vboxsync
Message:

Main/Appliance: mark the OCI specific code for moving to the extpack (it can't work to have specific code in the generic API, the rules will be always too volatile), and additionally fix lock order issues originating in the "too smart" code for figuring out the first disk. The previous code was getting the base medium which was kind of a workaround for limitations in the image upload logic, which were temporary and are about to be resolved.

File:
1 edited

Legend:

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

    r74873 r74886  
    659659    i_parseURI(aPath, m->locInfo);
    660660
     661    /** @todo r=klaus all of this code should be made fully generic, applicable
     662     * to any cloud provider. This implies changing the method names accordingly
     663     * and (more importantly) moving all the cloud specific checking code to the
     664     * actual ICloudClient implementation in the corresponding extpack. It will
     665     * move the check to the async task, but that's a bearable cost, not getting
     666     * the error straight from the API call but a tiny bit later through the
     667     * Progress object. */
    661668    if (m->locInfo.storageType == VFSType_OCI)//(isCloudDestination(aPath))
    662669    {
     
    857864    try
    858865    {
     866        /** @todo r=klaus all of this code should be made fully generic,
     867         * doing only what is common for all cloud providers, i.e. pretty
     868         * much nothing. The logic and data types need to be moved to the
     869         * extension pack, anything else will not work. */
     870
    859871        //remove all disks from the VirtualSystemDescription exept one
    860872        for (list<ComObjPtr<VirtualSystemDescription> >::const_iterator
     
    875887            itSkipped = skipped.begin();
    876888
    877             ComObjPtr<Medium> ptrSourceDisk;
     889            Utf8Str strBootLocation;
    878890            while (itSkipped != skipped.end())
    879891            {
    880                 Utf8Str path = (*itSkipped)->strVBoxCurrent;
    881                 // Locate the Medium object for this entry (by location/path).
    882                 Log(("Finding source disk \"%s\"\n", path.c_str()));
    883                 rc = mVirtualBox->i_findHardDiskByLocation(path, true , &ptrSourceDisk);
    884                 if (SUCCEEDED(rc))
    885                     break;
     892                if (strBootLocation.isEmpty())
     893                    strBootLocation = (*itSkipped)->strVBoxCurrent;
    886894                else
    887                     ++itSkipped;
    888             }
    889 
    890             ComPtr<IMedium> pBootableBaseMedium;
    891             // returns pBootableMedium if there are no diff images
    892             rc = ptrSourceDisk->COMGETTER(Base)(pBootableBaseMedium.asOutParam());
    893             if (FAILED(rc))
    894                 throw rc;
    895 
    896             //Get base bootable disk location
    897             Bstr bstrBootLocation;
    898             rc = pBootableBaseMedium->COMGETTER(Location)(bstrBootLocation.asOutParam());
    899             if (FAILED(rc)) throw rc;
    900             Utf8Str strBootLocation = bstrBootLocation;
    901 
    902             skipped = vsdescThis->i_findByType(VirtualSystemDescriptionType_HardDiskImage);
    903             itSkipped = skipped.begin();
    904             while (itSkipped != skipped.end())
    905             {
    906                 Utf8Str path = (*itSkipped)->strVBoxCurrent;
    907                 // Locate the Medium object for this entry (by location/path).
    908                 Log(("Finding disk \"%s\"\n", path.c_str()));
    909                 ComObjPtr<Medium> ptrDisk;
    910                 rc = mVirtualBox->i_findHardDiskByLocation(path, true , &ptrDisk);
    911                 if (FAILED(rc))
    912                     throw rc;
    913 
    914                 if (!path.equalsIgnoreCase(strBootLocation))
    915895                    (*itSkipped)->skipIt = true;
    916 
    917896                ++itSkipped;
    918897            }
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