VirtualBox

Changeset 74937 in vbox


Ignore:
Timestamp:
Oct 19, 2018 9:50:40 AM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
125951
Message:

Main/MediumIO: Fix progress reporting when streaming the disk image

File:
1 edited

Legend:

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

    r74825 r74937  
    119119        if (FAILED(mRC))
    120120            return;
    121 
    122         /* Set up a per-operation progress interface, can be used freely (for
    123          * binary operations you can use it either on the source or target). */
    124         if (mProgress)
    125         {
    126             mVDIfProgress.pfnProgress = pProgress->i_vdProgressCallback;
    127             int vrc = VDInterfaceAdd(&mVDIfProgress.Core,
    128                                      "Medium::Task::vdInterfaceProgress",
    129                                      VDINTERFACETYPE_PROGRESS,
    130                                      mProgress,
    131                                      sizeof(mVDIfProgress),
    132                                      &mVDOperationIfaces);
    133             AssertRC(vrc);
    134             if (RT_FAILURE(vrc))
    135                 mRC = E_FAIL;
    136         }
    137121    }
    138122
     
    171155    }
    172156
    173     PVDINTERFACE mVDOperationIfaces;
    174 
    175157    const ComObjPtr<MediumIO> mMediumIO;
    176158    AutoCaller mMediumCaller;
     
    187169
    188170    const ComObjPtr<Progress> mProgress;
    189 
    190     VDINTERFACEPROGRESS mVDIfProgress;
    191171
    192172    /* Must have a strong VirtualBox reference during a task otherwise the
     
    436416    HRESULT hrc = S_OK;
    437417    VDINTERFACEIO IfsOutputIO;
     418    VDINTERFACEPROGRESS IfsProgress;
    438419    PVDINTERFACE pIfsOp = NULL;
    439420    PVDISK pDstDisk;
     421
     422    if (mProgress)
     423    {
     424        IfsProgress.pfnProgress = pProgress->i_vdProgressCallback;
     425        int vrc = VDInterfaceAdd(&IfsProgress.Core,
     426                                 "Medium::StreamTask::vdInterfaceProgress",
     427                                 VDINTERFACETYPE_PROGRESS,
     428                                 mProgress,
     429                                 sizeof(IfsProgress),
     430                                 &pIfsOp);
     431    }
    440432
    441433    IfsOutputIO.pfnOpen                   = i_vdStreamOpen;
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