VirtualBox

Ignore:
Timestamp:
May 31, 2017 8:32:04 PM (8 years ago)
Author:
vboxsync
Message:

Main: Reworking IAppliance export to use new TAR creator. Changes protected by VBOX_WITH_NEW_TAR_CREATOR define (currently not defined).

File:
1 edited

Legend:

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

    r67172 r67184  
    660660               MediumVariant_T aVariant,
    661661               SecretKeyStore *pSecretKeyStore,
     662#ifdef VBOX_WITH_NEW_TAR_CREATOR
     663               RTVFSIOSTREAM aVfsIosDst,
     664#else
    662665               VDINTERFACEIO *aVDImageIOIf,
    663666               void *aVDImageIOUser,
     667#endif
    664668               MediumLockList *aSourceMediumLockList,
    665669               bool fKeepSourceMediumLockList = false)
     
    675679
    676680        mVDImageIfaces = aMedium->m->vdImageIfaces;
     681
     682#ifdef VBOX_WITH_NEW_TAR_CREATOR
     683        int vrc = VDIfCreateFromVfsStream(aVfsIosDst, RTFILE_O_WRITE, &mpVfsIoIf);
     684        AssertRCReturnVoidStmt(vrc, mRC = E_FAIL);
     685
     686        vrc = VDInterfaceAdd(&mpVfsIoIf->Core, "Medium::ExportTaskVfsIos",
     687                             VDINTERFACETYPE_IO, mpVfsIoIf,
     688                             sizeof(VDINTERFACEIO), &mVDImageIfaces);
     689        AssertRCReturnVoidStmt(vrc, mRC = E_FAIL);
     690#else
     691
    677692        if (aVDImageIOIf)
    678693        {
     
    682697            AssertRCReturnVoidStmt(vrc, mRC = E_FAIL);
    683698        }
     699#endif
    684700        m_strTaskName = "createExport";
    685701    }
     
    689705        if (!mfKeepSourceMediumLockList && mpSourceMediumLockList)
    690706            delete mpSourceMediumLockList;
     707#ifdef VBOX_WITH_NEW_TAR_CREATOR
     708        if (mpVfsIoIf)
     709        {
     710            VDIfDestroyFromVfsStream(mpVfsIoIf);
     711            mpVfsIoIf = NULL;
     712        }
     713#endif
    691714    }
    692715
     
    696719    MediumVariant_T mVariant;
    697720    PVDINTERFACE mVDImageIfaces;
     721    PVDINTERFACEIO mpVfsIoIf; /**< Pointer to the VFS I/O stream to VD I/O interface wrapper. */
    698722    SecretKeyStore *m_pSecretKeyStore;
    699723
     
    60966120                             MediumVariant_T aVariant,
    60976121                             SecretKeyStore *pKeyStore,
     6122#ifdef VBOX_WITH_NEW_TAR_CREATOR
     6123                             RTVFSIOSTREAM hVfsIosDst,
     6124#else
    60986125                             PVDINTERFACEIO aVDImageIOIf, void *aVDImageIOUser,
     6126#endif
    60996127                             const ComObjPtr<Progress> &aProgress)
    61006128{
     
    61366164
    61376165        /* setup task object to carry out the operation asynchronously */
    6138         pTask = new Medium::ExportTask(this, aProgress, aFilename, aFormat,
    6139                                        aVariant, pKeyStore, aVDImageIOIf,
    6140                                        aVDImageIOUser, pSourceMediumLockList);
     6166        pTask = new Medium::ExportTask(this, aProgress, aFilename, aFormat, aVariant,
     6167#ifdef VBOX_WITH_NEW_TAR_CREATOR
     6168                                       pKeyStore, hVfsIosDst, pSourceMediumLockList);
     6169#else
     6170                                       pKeyStore, aVDImageIOIf, aVDImageIOUser, pSourceMediumLockList);
     6171#endif
    61416172        rc = pTask->rc();
    61426173        AssertComRC(rc);
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