VirtualBox

Ignore:
Timestamp:
Mar 13, 2009 2:14:08 PM (16 years ago)
Author:
vboxsync
Message:

OVF: move warnings from IVirtualSystem to IAppliance; fix error messages when OVF wants more than one SCSI controller; API docs

File:
1 edited

Legend:

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

    r17361 r17827  
    163163        CHECK_ERROR_BREAK(pAppliance, Read(bstrOvfFilename));
    164164
    165         RTPrintf("Interpreting %s... ", strOvfFilename.c_str());
    166         CHECK_ERROR_BREAK(pAppliance, Interpret());
     165        // call interpret(); this can yield both warnings and errors, so we need
     166        // to tinker with the error info a bit
     167        RTPrintf("Interpreting %s...\n", strOvfFilename.c_str());
     168        rc = pAppliance->Interpret();
     169        com::ErrorInfo info0(pAppliance);
     170
     171        com::SafeArray<BSTR> aWarnings;
     172        if (SUCCEEDED(pAppliance->GetWarnings(ComSafeArrayAsOutParam(aWarnings))))
     173        {
     174            unsigned cWarnings = aWarnings.size();
     175            for (unsigned i = 0; i < cWarnings; ++i)
     176            {
     177                Bstr bstrWarning(aWarnings[i]);
     178                RTPrintf("WARNING: %ls.\n", bstrWarning.raw());
     179            }
     180        }
     181
     182        if (FAILED(rc))     // during interpret, after printing warnings
     183        {
     184            com::GluePrintErrorInfo(info0);
     185            com::GluePrintErrorContext("Interpret", __FILE__, __LINE__);
     186            break;
     187        }
     188
    167189        RTPrintf("OK.\n");
    168190
     
    470492            if (fExecute)
    471493            {
     494                // go!
    472495                ComPtr<IProgress> progress;
    473496                CHECK_ERROR_BREAK(pAppliance,
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