VirtualBox

Changeset 59590 in vbox for trunk


Ignore:
Timestamp:
Feb 4, 2016 6:58:16 PM (9 years ago)
Author:
vboxsync
Message:

Appliance::i_taskThreadImportOrExport: wrong status codes for unsupported stuff (IPRT and S_OK).

File:
1 edited

Legend:

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

    r59577 r59590  
    11971197DECLCALLBACK(int) Appliance::i_taskThreadImportOrExport(RTTHREAD /* aThread */, void *pvUser)
    11981198{
    1199     TaskOVF* task = static_cast<TaskOVF*>(pvUser);
    1200     AssertReturn(task, VERR_GENERAL_FAILURE);
    1201 
    1202     Appliance *pAppliance = task->pAppliance;
     1199    TaskOVF *pTask = static_cast<TaskOVF*>(pvUser);
     1200    AssertReturn(pTask, VERR_GENERAL_FAILURE);
     1201
     1202    Appliance *pAppliance = pTask->pAppliance;
    12031203
    12041204    LogFlowFuncEnter();
    1205     LogFlowFunc(("Appliance %p taskType=%d\n", pAppliance, task->taskType));
    1206 
    1207     HRESULT taskrc = S_OK;
    1208 
    1209     switch (task->taskType)
     1205    LogFlowFunc(("Appliance %p taskType=%d\n", pAppliance, pTask->taskType));
     1206
     1207    switch (pTask->taskType)
    12101208    {
    12111209        case TaskOVF::Read:
    1212             if (task->locInfo.storageType == VFSType_File)
    1213                 taskrc = pAppliance->i_readFS(task);
    1214             else if (task->locInfo.storageType == VFSType_S3)
    1215                 taskrc = VERR_NOT_IMPLEMENTED;
    1216         break;
     1210            if (pTask->locInfo.storageType == VFSType_File)
     1211                pTask->rc = pAppliance->i_readFS(pTask);
     1212            else
     1213                pTask->rc = E_NOTIMPL;
     1214            break;
    12171215
    12181216        case TaskOVF::Import:
    1219             if (task->locInfo.storageType == VFSType_File)
    1220                 taskrc = pAppliance->i_importFS(task);
    1221             else if (task->locInfo.storageType == VFSType_S3)
    1222                 taskrc = VERR_NOT_IMPLEMENTED;
    1223         break;
     1217            if (pTask->locInfo.storageType == VFSType_File)
     1218                pTask->rc = pAppliance->i_importFS(pTask);
     1219            else
     1220                pTask->rc = E_NOTIMPL;
     1221            break;
    12241222
    12251223        case TaskOVF::Write:
    1226             if (task->locInfo.storageType == VFSType_File)
    1227                 taskrc = pAppliance->i_writeFS(task);
    1228             else if (task->locInfo.storageType == VFSType_S3)
    1229                 taskrc = VERR_NOT_IMPLEMENTED;
    1230         break;
    1231     }
    1232 
    1233     task->rc = taskrc;
    1234 
    1235     if (!task->pProgress.isNull())
    1236         task->pProgress->i_notifyComplete(taskrc);
     1224            if (pTask->locInfo.storageType == VFSType_File)
     1225                pTask->rc = pAppliance->i_writeFS(pTask);
     1226            else
     1227                pTask->rc = E_NOTIMPL;
     1228            break;
     1229
     1230        default:
     1231            AssertFailed();
     1232            pTask->rc = E_FAIL;
     1233            break;
     1234    }
     1235
     1236    if (!pTask->pProgress.isNull())
     1237        pTask->pProgress->i_notifyComplete(pTask->rc);
    12371238
    12381239    LogFlowFuncLeave();
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