VirtualBox

Changeset 38469 in vbox for trunk/src/VBox/Storage/QED.cpp


Ignore:
Timestamp:
Aug 16, 2011 10:34:32 AM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
73520
Message:

VD: Interface cleanup. Merge the two involved structures (generic interface descriptor and callback table) into one, remove the duplicated interface wrappers in the backends and move the interface definitions into separate headers separating public and private interfaces.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Storage/QED.cpp

    r38463 r38469  
    150150    /** Storage handle. */
    151151    PVDIOSTORAGE        pStorage;
    152     /** I/O interface. */
    153     PVDINTERFACE        pInterfaceIO;
    154     /** Async I/O interface callbacks. */
    155     PVDINTERFACEIOINT   pInterfaceIOCallbacks;
    156152
    157153    /** Pointer to the per-disk VD interface list. */
     
    159155    /** Pointer to the per-image VD interface list. */
    160156    PVDINTERFACE        pVDIfsImage;
    161 
    162     /** Error callback. */
    163     PVDINTERFACE        pInterfaceError;
    164     /** Opaque data for error callback. */
    165     PVDINTERFACEERROR   pInterfaceErrorCallbacks;
     157    /** Error interface. */
     158    PVDINTERFACEERROR   pIfError;
     159    /** I/O interface. */
     160    PVDINTERFACEIOINT   pIfIo;
    166161
    167162    /** Open flags passed by VBoxHD layer. */
     
    186181    uint64_t            cbImage;
    187182    /** Cluster size in bytes. */
    188     size_t              cbCluster;
     183    uint32_t            cbCluster;
    189184    /** Number of entries in the L1 and L2 table. */
    190185    uint32_t            cTableEntries;
    191186    /** Size of an L1 or L2 table rounded to the next cluster size. */
    192     size_t              cbTable;
     187    uint32_t            cbTable;
    193188    /** Pointer to the L1 table. */
    194189    uint64_t            *paL1Table;
     
    272267
    273268/**
    274  * Internal: signal an error to the frontend.
    275  */
    276 DECLINLINE(int) qedError(PQEDIMAGE pImage, int rc, RT_SRC_POS_DECL,
    277                          const char *pszFormat, ...)
    278 {
    279     va_list va;
    280     va_start(va, pszFormat);
    281     if (pImage->pInterfaceError)
    282         pImage->pInterfaceErrorCallbacks->pfnError(pImage->pInterfaceError->pvUser, rc, RT_SRC_POS_ARGS,
    283                                                    pszFormat, va);
    284     va_end(va);
    285     return rc;
    286 }
    287 
    288 /**
    289  * Internal: signal an informational message to the frontend.
    290  */
    291 DECLINLINE(int) qedMessage(PQEDIMAGE pImage, const char *pszFormat, ...)
    292 {
    293     int rc = VINF_SUCCESS;
    294     va_list va;
    295     va_start(va, pszFormat);
    296     if (pImage->pInterfaceError)
    297         rc = pImage->pInterfaceErrorCallbacks->pfnMessage(pImage->pInterfaceError->pvUser,
    298                                                           pszFormat, va);
    299     va_end(va);
    300     return rc;
    301 }
    302 
    303 
    304 DECLINLINE(int) qedFileOpen(PQEDIMAGE pImage, const char *pszFilename,
    305                             uint32_t fOpen)
    306 {
    307     return pImage->pInterfaceIOCallbacks->pfnOpen(pImage->pInterfaceIO->pvUser,
    308                                                   pszFilename, fOpen,
    309                                                   &pImage->pStorage);
    310 }
    311 
    312 DECLINLINE(int) qedFileClose(PQEDIMAGE pImage)
    313 {
    314     return pImage->pInterfaceIOCallbacks->pfnClose(pImage->pInterfaceIO->pvUser,
    315                                                    pImage->pStorage);
    316 }
    317 
    318 DECLINLINE(int) qedFileDelete(PQEDIMAGE pImage, const char *pszFilename)
    319 {
    320     return pImage->pInterfaceIOCallbacks->pfnDelete(pImage->pInterfaceIO->pvUser,
    321                                                     pszFilename);
    322 }
    323 
    324 DECLINLINE(int) qedFileMove(PQEDIMAGE pImage, const char *pszSrc,
    325                             const char *pszDst, unsigned fMove)
    326 {
    327     return pImage->pInterfaceIOCallbacks->pfnMove(pImage->pInterfaceIO->pvUser,
    328                                                   pszSrc, pszDst, fMove);
    329 }
    330 
    331 DECLINLINE(int) qedFileGetFreeSpace(PQEDIMAGE pImage, const char *pszFilename,
    332                                     int64_t *pcbFree)
    333 {
    334     return pImage->pInterfaceIOCallbacks->pfnGetFreeSpace(pImage->pInterfaceIO->pvUser,
    335                                                           pszFilename, pcbFree);
    336 }
    337 
    338 DECLINLINE(int) qedFileGetSize(PQEDIMAGE pImage, uint64_t *pcbSize)
    339 {
    340     return pImage->pInterfaceIOCallbacks->pfnGetSize(pImage->pInterfaceIO->pvUser,
    341                                                      pImage->pStorage, pcbSize);
    342 }
    343 
    344 DECLINLINE(int) qedFileSetSize(PQEDIMAGE pImage, uint64_t cbSize)
    345 {
    346     return pImage->pInterfaceIOCallbacks->pfnSetSize(pImage->pInterfaceIO->pvUser,
    347                                                      pImage->pStorage, cbSize);
    348 }
    349 
    350 DECLINLINE(int) qedFileWriteSync(PQEDIMAGE pImage, uint64_t uOffset,
    351                                  const void *pvBuffer, size_t cbBuffer,
    352                                  size_t *pcbWritten)
    353 {
    354     return pImage->pInterfaceIOCallbacks->pfnWriteSync(pImage->pInterfaceIO->pvUser,
    355                                                        pImage->pStorage, uOffset,
    356                                                        pvBuffer, cbBuffer, pcbWritten);
    357 }
    358 
    359 DECLINLINE(int) qedFileReadSync(PQEDIMAGE pImage, uint64_t uOffset,
    360                                 void *pvBuffer, size_t cbBuffer, size_t *pcbRead)
    361 {
    362     return pImage->pInterfaceIOCallbacks->pfnReadSync(pImage->pInterfaceIO->pvUser,
    363                                                       pImage->pStorage, uOffset,
    364                                                       pvBuffer, cbBuffer, pcbRead);
    365 }
    366 
    367 DECLINLINE(int) qedFileFlushSync(PQEDIMAGE pImage)
    368 {
    369     return pImage->pInterfaceIOCallbacks->pfnFlushSync(pImage->pInterfaceIO->pvUser,
    370                                                        pImage->pStorage);
    371 }
    372 
    373 DECLINLINE(int) qedFileReadUserAsync(PQEDIMAGE pImage, uint64_t uOffset,
    374                                      PVDIOCTX pIoCtx, size_t cbRead)
    375 {
    376     return pImage->pInterfaceIOCallbacks->pfnReadUserAsync(pImage->pInterfaceIO->pvUser,
    377                                                            pImage->pStorage,
    378                                                            uOffset, pIoCtx,
    379                                                            cbRead);
    380 }
    381 
    382 DECLINLINE(int) qedFileWriteUserAsync(PQEDIMAGE pImage, uint64_t uOffset,
    383                                       PVDIOCTX pIoCtx, size_t cbWrite,
    384                                       PFNVDXFERCOMPLETED pfnComplete,
    385                                       void *pvCompleteUser)
    386 {
    387     return pImage->pInterfaceIOCallbacks->pfnWriteUserAsync(pImage->pInterfaceIO->pvUser,
    388                                                             pImage->pStorage,
    389                                                             uOffset, pIoCtx,
    390                                                             cbWrite,
    391                                                             pfnComplete,
    392                                                             pvCompleteUser);
    393 }
    394 
    395 /**
    396  * Internal: read metadata (async)
    397  */
    398 DECLINLINE(int) qedFileReadMetaAsync(PQEDIMAGE pImage,
    399                                      uint64_t uOffset, void *pvBuffer,
    400                                      size_t cbBuffer, PVDIOCTX pIoCtx,
    401                                      PPVDMETAXFER ppMetaXfer,
    402                                      PFNVDXFERCOMPLETED pfnComplete,
    403                                      void *pvCompleteUser)
    404 {
    405     return pImage->pInterfaceIOCallbacks->pfnReadMetaAsync(pImage->pInterfaceIO->pvUser,
    406                                                            pImage->pStorage,
    407                                                            uOffset, pvBuffer,
    408                                                            cbBuffer, pIoCtx,
    409                                                            ppMetaXfer,
    410                                                            pfnComplete,
    411                                                            pvCompleteUser);
    412 }
    413 
    414 /**
    415  * Internal: write metadata (async)
    416  */
    417 DECLINLINE(int) qedFileWriteMetaAsync(PQEDIMAGE pImage,
    418                                       uint64_t uOffset, void *pvBuffer,
    419                                       size_t cbBuffer, PVDIOCTX pIoCtx,
    420                                       PFNVDXFERCOMPLETED pfnComplete,
    421                                       void *pvCompleteUser)
    422 {
    423     return pImage->pInterfaceIOCallbacks->pfnWriteMetaAsync(pImage->pInterfaceIO->pvUser,
    424                                                             pImage->pStorage,
    425                                                             uOffset, pvBuffer,
    426                                                             cbBuffer, pIoCtx,
    427                                                             pfnComplete,
    428                                                             pvCompleteUser);
    429 }
    430 
    431 /**
    432  * Internal: releases a metadata transfer handle (async)
    433  */
    434 DECLINLINE(void) qedFileMetaXferRelease(PQEDIMAGE pImage, PVDMETAXFER pMetaXfer)
    435 {
    436     pImage->pInterfaceIOCallbacks->pfnMetaXferRelease(pImage->pInterfaceIO->pvUser,
    437                                                       pMetaXfer);
    438 }
    439 
    440 DECLINLINE(int) qedFileFlushAsync(PQEDIMAGE pImage, PVDIOCTX pIoCtx,
    441                                   PFNVDXFERCOMPLETED pfnComplete,
    442                                   void *pvCompleteUser)
    443 {
    444     return pImage->pInterfaceIOCallbacks->pfnFlushAsync(pImage->pInterfaceIO->pvUser,
    445                                                         pImage->pStorage,
    446                                                         pIoCtx, pfnComplete,
    447                                                         pvCompleteUser);
    448 }
    449 
    450 
    451 /**
    452269 * Converts the image header to the host endianess and performs basic checks.
    453270 *
     
    753570            /* Read from the image. */
    754571            pL2Entry->offL2Tbl = offL2Tbl;
    755             rc = qedFileReadSync(pImage, offL2Tbl, pL2Entry->paL2Tbl, pImage->cbTable, NULL);
     572            rc = vdIfIoIntFileReadSync(pImage->pIfIo, pImage->pStorage, offL2Tbl,
     573                                       pL2Entry->paL2Tbl, pImage->cbTable, NULL);
    756574            if (RT_SUCCESS(rc))
    757575            {
     
    802620
    803621            pL2Entry->offL2Tbl = offL2Tbl;
    804             rc = qedFileReadMetaAsync(pImage, offL2Tbl, pL2Entry->paL2Tbl,
    805                                       pImage->cbTable, pIoCtx,
    806                                       &pMetaXfer, NULL, NULL);
     622            rc = vdIfIoIntFileReadMetaAsync(pImage->pIfIo, pImage->pStorage,
     623                                            offL2Tbl, pL2Entry->paL2Tbl,
     624                                            pImage->cbTable, pIoCtx,
     625                                            &pMetaXfer, NULL, NULL);
    807626            if (RT_SUCCESS(rc))
    808627            {
    809                 qedFileMetaXferRelease(pImage, pMetaXfer);
     628                vdIfIoIntMetaXferRelease(pImage->pIfIo, pMetaXfer);
    810629#if defined(RT_BIG_ENDIAN)
    811630                qedTableConvertToHostEndianness(pL2Entry->paL2Tbl, pImage->cTableEntries);
     
    1040859            qedTableConvertFromHostEndianess(p1L1TblImg, pImage->paL1Table,
    1041860                                             pImage->cTableEntries);
    1042             rc = qedFileWriteSync(pImage, pImage->offL1Table, paL1TblImg,
    1043                                   pImage->cbTable, NULL);
     861            rc = vdIfIoIntFileWriteSync(pImage->pIfIo, pImage->pStorage,
     862                                        pImage->offL1Table, paL1TblImg,
     863                                        pImage->cbTable, NULL);
    1044864            RTMemFree(paL1TblImg);
    1045865        }
     
    1048868#else
    1049869        /* Write L1 table directly. */
    1050         rc = qedFileWriteSync(pImage, pImage->offL1Table, pImage->paL1Table,
    1051                               pImage->cbTable, NULL);
     870        rc = vdIfIoIntFileWriteSync(pImage->pIfIo, pImage->pStorage, pImage->offL1Table,
     871                                    pImage->paL1Table, pImage->cbTable, NULL);
    1052872#endif
    1053873        if (RT_SUCCESS(rc))
     
    1055875            /* Write header. */
    1056876            qedHdrConvertFromHostEndianess(pImage, &Header);
    1057             rc = qedFileWriteSync(pImage, 0, &Header, sizeof(Header), NULL);
     877            rc = vdIfIoIntFileWriteSync(pImage->pIfIo, pImage->pStorage, 0, &Header,
     878                                        sizeof(Header), NULL);
    1058879            if (RT_SUCCESS(rc))
    1059                 rc = qedFileFlushSync(pImage);
     880                rc = vdIfIoIntFileFlushSync(pImage->pIfIo, pImage->pStorage);
    1060881        }
    1061882    }
     
    1087908            qedTableConvertFromHostEndianess(p1L1TblImg, pImage->paL1Table,
    1088909                                             pImage->cTableEntries);
    1089             rc = qedFileWriteMetaAsync(pImage, pImage->offL1Table, paL1TblImg,
    1090                                        pImage->cbTable, pIoCtx, NULL, NULL);
     910            rc = vdIfIoIntFileWriteMetaAsync(pImage->pIfIo, pImage->pStorage,
     911                                             pImage->offL1Table, paL1TblImg,
     912                                             pImage->cbTable, pIoCtx, NULL, NULL);
    1091913            RTMemFree(paL1TblImg);
    1092914        }
     
    1095917#else
    1096918        /* Write L1 table directly. */
    1097         rc = qedFileWriteMetaAsync(pImage, pImage->offL1Table, pImage->paL1Table,
    1098                                    pImage->cbTable, pIoCtx, NULL, NULL);
     919        rc = vdIfIoIntFileWriteMetaAsync(pImage->pIfIo, pImage->pStorage,
     920                                         pImage->offL1Table, pImage->paL1Table,
     921                                         pImage->cbTable, pIoCtx, NULL, NULL);
    1099922#endif
    1100923        if (RT_SUCCESS(rc) || rc == VERR_VD_ASYNC_IO_IN_PROGRESS)
     
    1102925            /* Write header. */
    1103926            qedHdrConvertFromHostEndianess(pImage, &Header);
    1104             rc = qedFileWriteMetaAsync(pImage, 0, &Header, sizeof(Header),
    1105                                        pIoCtx, NULL, NULL);
     927            rc = vdIfIoIntFileWriteMetaAsync(pImage->pIfIo, pImage->pStorage,
     928                                             0, &Header, sizeof(Header),
     929                                             pIoCtx, NULL, NULL);
    1106930            if (RT_SUCCESS(rc) || rc == VERR_VD_ASYNC_IO_IN_PROGRESS)
    1107                 rc = qedFileFlushAsync(pImage, pIoCtx, NULL, NULL);
     931                rc = vdIfIoIntFileFlushAsync(pImage->pIfIo, pImage->pStorage,
     932                                             pIoCtx, NULL, NULL);
    1108933        }
    1109934    }
     
    11771002{
    11781003    uint64_t cbFile;
    1179     size_t cbTable;
     1004    uint32_t cbTable;
    11801005    uint32_t cTableEntries;
    11811006    uint64_t *paL1Tbl = NULL;
     
    11911016    do
    11921017    {
    1193         rc = qedFileGetSize(pImage, &cbFile);
     1018        rc = vdIfIoIntFileGetSize(pImage->pIfIo, pImage->pStorage, &cbFile);
    11941019        if (RT_FAILURE(rc))
    11951020        {
    1196             rc = qedError(pImage, rc, RT_SRC_POS,
    1197                           N_("Qed: Querying the file size of image '%s' failed"),
    1198                           pImage->pszFilename);
     1021            rc = vdIfError(pImage->pIfError, rc, RT_SRC_POS,
     1022                           N_("Qed: Querying the file size of image '%s' failed"),
     1023                           pImage->pszFilename);
    11991024            break;
    12001025        }
     
    12041029        if (!paL1Tbl)
    12051030        {
    1206             rc = qedError(pImage, VERR_NO_MEMORY, RT_SRC_POS,
     1031            rc = vdIfError(pImage->pIfError, VERR_NO_MEMORY, RT_SRC_POS,
    12071032                          N_("Qed: Allocating memory for the L1 table for image '%s' failed"),
    12081033                          pImage->pszFilename);
     
    12131038        if (!paL2Tbl)
    12141039        {
    1215             rc = qedError(pImage, VERR_NO_MEMORY, RT_SRC_POS,
    1216                           N_("Qed: Allocating memory for the L2 table for image '%s' failed"),
    1217                           pImage->pszFilename);
     1040            rc = vdIfError(pImage->pIfError, VERR_NO_MEMORY, RT_SRC_POS,
     1041                           N_("Qed: Allocating memory for the L2 table for image '%s' failed"),
     1042                           pImage->pszFilename);
    12181043            break;
    12191044        }
     
    12221047        if (!pvClusterBitmap)
    12231048        {
    1224             rc = qedError(pImage, VERR_NO_MEMORY, RT_SRC_POS,
    1225                           N_("Qed: Allocating memory for the cluster bitmap for image '%s' failed"),
    1226                           pImage->pszFilename);
     1049            rc = vdIfError(pImage->pIfError, VERR_NO_MEMORY, RT_SRC_POS,
     1050                           N_("Qed: Allocating memory for the cluster bitmap for image '%s' failed"),
     1051                           pImage->pszFilename);
    12271052            break;
    12281053        }
     
    12311056        if (!qedIsTblOffsetValid(pHeader->u64OffL1Table, cbFile, cbTable, pHeader->u32ClusterSize))
    12321057        {
    1233             rc = qedError(pImage, VERR_VD_GEN_INVALID_HEADER, RT_SRC_POS,
    1234                               N_("Qed: L1 table offset of image '%s' is corrupt (%llu)"),
    1235                               pImage->pszFilename, pHeader->u64OffL1Table);
     1058            rc = vdIfError(pImage->pIfError, VERR_VD_GEN_INVALID_HEADER, RT_SRC_POS,
     1059                           N_("Qed: L1 table offset of image '%s' is corrupt (%llu)"),
     1060                           pImage->pszFilename, pHeader->u64OffL1Table);
    12361061            break;
    12371062        }
    12381063
    12391064        /* Read L1 table. */
    1240         rc = qedFileReadSync(pImage, pHeader->u64OffL1Table, paL1Tbl, cbTable, NULL);
     1065        rc = vdIfIoIntFileReadSync(pImage->pIfIo, pImage->pStorage,
     1066                                   pHeader->u64OffL1Table, paL1Tbl, cbTable, NULL);
    12411067        if (RT_FAILURE(rc))
    12421068        {
    1243             rc = qedError(pImage, VERR_VD_GEN_INVALID_HEADER, RT_SRC_POS,
    1244                               N_("Qed: Reading the L1 table from image '%s' failed"),
    1245                               pImage->pszFilename);
     1069            rc = vdIfError(pImage->pIfError, VERR_VD_GEN_INVALID_HEADER, RT_SRC_POS,
     1070                           N_("Qed: Reading the L1 table from image '%s' failed"),
     1071                           pImage->pszFilename);
    12461072            break;
    12471073        }
     
    12631089            if (!qedIsTblOffsetValid(paL1Tbl[iL1], cbFile, cbTable, pHeader->u32ClusterSize))
    12641090            {
    1265                 rc = qedError(pImage, VERR_VD_GEN_INVALID_HEADER, RT_SRC_POS,
    1266                               N_("Qed: Entry %d of the L1 table from image '%s' is invalid (%llu)"),
    1267                               iL1, pImage->pszFilename, paL1Tbl[iL1]);
     1091                rc = vdIfError(pImage->pIfError, VERR_VD_GEN_INVALID_HEADER, RT_SRC_POS,
     1092                               N_("Qed: Entry %d of the L1 table from image '%s' is invalid (%llu)"),
     1093                               iL1, pImage->pszFilename, paL1Tbl[iL1]);
    12681094                break;
    12691095            }
     
    12741100            if (!fSet)
    12751101            {
    1276                 rc = qedError(pImage, VERR_VD_GEN_INVALID_HEADER, RT_SRC_POS,
    1277                               N_("Qed: Entry %d of the L1 table from image '%s' points to a already used cluster (%llu)"),
    1278                               iL1, pImage->pszFilename, paL1Tbl[iL1]);
     1102                rc = vdIfError(pImage->pIfError, VERR_VD_GEN_INVALID_HEADER, RT_SRC_POS,
     1103                               N_("Qed: Entry %d of the L1 table from image '%s' points to a already used cluster (%llu)"),
     1104                               iL1, pImage->pszFilename, paL1Tbl[iL1]);
    12791105                break;
    12801106            }
    12811107
    12821108            /* Read the linked L2 table and check it. */
    1283             rc = qedFileReadSync(pImage, paL1Tbl[iL1], paL2Tbl, cbTable, NULL);
     1109            rc = vdIfIoIntFileReadSync(pImage->pIfIo, pImage->pStorage,
     1110                                       paL1Tbl[iL1], paL2Tbl, cbTable, NULL);
    12841111            if (RT_FAILURE(rc))
    12851112            {
    1286                 rc = qedError(pImage, rc, RT_SRC_POS,
    1287                               N_("Qed: Reading the L2 table from image '%s' failed"),
    1288                               pImage->pszFilename);
     1113                rc = vdIfError(pImage->pIfError, rc, RT_SRC_POS,
     1114                               N_("Qed: Reading the L2 table from image '%s' failed"),
     1115                               pImage->pszFilename);
    12891116                break;
    12901117            }
     
    12981125                if (!qedIsClusterOffsetValid(paL2Tbl[iL2], cbFile, pHeader->u32ClusterSize))
    12991126                {
    1300                     rc = qedError(pImage, VERR_VD_GEN_INVALID_HEADER, RT_SRC_POS,
    1301                                   N_("Qed: Entry %d of the L2 table from image '%s' is invalid (%llu)"),
    1302                                   iL2, pImage->pszFilename, paL2Tbl[iL2]);
     1127                    rc = vdIfError(pImage->pIfError, VERR_VD_GEN_INVALID_HEADER, RT_SRC_POS,
     1128                                   N_("Qed: Entry %d of the L2 table from image '%s' is invalid (%llu)"),
     1129                                   iL2, pImage->pszFilename, paL2Tbl[iL2]);
    13031130                    break;
    13041131                }
     
    13091136                if (!fSet)
    13101137                {
    1311                     rc = qedError(pImage, VERR_VD_GEN_INVALID_HEADER, RT_SRC_POS,
    1312                                   N_("Qed: Entry %d of the L2 table from image '%s' points to a already used cluster (%llu)"),
    1313                                   iL2, pImage->pszFilename, paL2Tbl[iL2]);
     1138                    rc = vdIfError(pImage->pIfError, VERR_VD_GEN_INVALID_HEADER, RT_SRC_POS,
     1139                                   N_("Qed: Entry %d of the L2 table from image '%s' points to a already used cluster (%llu)"),
     1140                                   iL2, pImage->pszFilename, paL2Tbl[iL2]);
    13141141                    break;
    13151142                }
     
    13461173                qedFlushImage(pImage);
    13471174
    1348             qedFileClose(pImage);
     1175            vdIfIoIntFileClose(pImage->pIfIo, pImage->pStorage);
    13491176            pImage->pStorage = NULL;
    13501177        }
     
    13591186
    13601187        if (fDelete && pImage->pszFilename)
    1361             qedFileDelete(pImage, pImage->pszFilename);
     1188            vdIfIoIntFileDelete(pImage->pIfIo, pImage->pszFilename);
    13621189    }
    13631190
     
    13751202    pImage->uOpenFlags = uOpenFlags;
    13761203
    1377     pImage->pInterfaceError = VDInterfaceGet(pImage->pVDIfsDisk, VDINTERFACETYPE_ERROR);
    1378     if (pImage->pInterfaceError)
    1379         pImage->pInterfaceErrorCallbacks = VDGetInterfaceError(pImage->pInterfaceError);
    1380 
    1381     /* Get I/O interface. */
    1382     pImage->pInterfaceIO = VDInterfaceGet(pImage->pVDIfsImage, VDINTERFACETYPE_IOINT);
    1383     AssertPtrReturn(pImage->pInterfaceIO, VERR_INVALID_PARAMETER);
    1384     pImage->pInterfaceIOCallbacks = VDGetInterfaceIOInt(pImage->pInterfaceIO);
    1385     AssertPtrReturn(pImage->pInterfaceIOCallbacks, VERR_INVALID_PARAMETER);
     1204    pImage->pIfError = VDIfErrorGet(pImage->pVDIfsDisk);
     1205    pImage->pIfIo = VDIfIoIntGet(pImage->pVDIfsImage);
     1206    AssertPtrReturn(pImage->pIfIo, VERR_INVALID_PARAMETER);
    13861207
    13871208    /*
    13881209     * Open the image.
    13891210     */
    1390     rc = qedFileOpen(pImage, pImage->pszFilename,
    1391                      VDOpenFlagsToFileOpenFlags(uOpenFlags,
    1392                                                 false /* fCreate */));
     1211    rc = vdIfIoIntFileOpen(pImage->pIfIo, pImage->pszFilename,
     1212                           VDOpenFlagsToFileOpenFlags(uOpenFlags,
     1213                                                      false /* fCreate */),
     1214                           &pImage->pStorage);
    13931215    if (RT_FAILURE(rc))
    13941216    {
     
    14001222    uint64_t cbFile;
    14011223    QedHeader Header;
    1402     rc = qedFileGetSize(pImage, &cbFile);
     1224    rc = vdIfIoIntFileGetSize(pImage->pIfIo, pImage->pStorage, &cbFile);
    14031225    if (RT_FAILURE(rc))
    14041226        goto out;
    14051227    if (cbFile > sizeof(Header))
    14061228    {
    1407         rc = qedFileReadSync(pImage, 0, &Header, sizeof(Header), NULL);
     1229        rc = vdIfIoIntFileReadSync(pImage->pIfIo, pImage->pStorage, 0, &Header, sizeof(Header), NULL);
    14081230        if (   RT_SUCCESS(rc)
    14091231            && qedHdrConvertToHostEndianess(&Header))
     
    14181240                        rc = qedCheckImage(pImage, &Header);
    14191241                    else
    1420                         rc = qedError(pImage, VERR_NOT_SUPPORTED, RT_SRC_POS,
    1421                                       N_("Qed: Image '%s' needs checking but is opened readonly"),
    1422                                       pImage->pszFilename);
     1242                        rc = vdIfError(pImage->pIfError, VERR_NOT_SUPPORTED, RT_SRC_POS,
     1243                                       N_("Qed: Image '%s' needs checking but is opened readonly"),
     1244                                       pImage->pszFilename);
    14231245                }
    14241246
     
    14321254                        pImage->cbBackingFilename  = Header.u32BackingFilenameSize;
    14331255                        pImage->offBackingFilename = Header.u32OffBackingFilename;
    1434                         rc = qedFileReadSync(pImage, Header.u32OffBackingFilename, pImage->pszBackingFilename,
    1435                                              Header.u32BackingFilenameSize, NULL);
     1256                        rc = vdIfIoIntFileReadSync(pImage->pIfIo, pImage->pStorage,
     1257                                                   Header.u32OffBackingFilename, pImage->pszBackingFilename,
     1258                                                   Header.u32BackingFilenameSize, NULL);
    14361259                    }
    14371260                    else
     
    14541277                    {
    14551278                        /* Read from the image. */
    1456                         rc = qedFileReadSync(pImage, pImage->offL1Table, pImage->paL1Table,
    1457                                              pImage->cbTable, NULL);
     1279                        rc = vdIfIoIntFileReadSync(pImage->pIfIo, pImage->pStorage,
     1280                                                   pImage->offL1Table, pImage->paL1Table,
     1281                                                   pImage->cbTable, NULL);
    14581282                        if (RT_SUCCESS(rc))
    14591283                        {
     
    14671291                            }
    14681292                            else
    1469                                 rc = qedError(pImage, rc, RT_SRC_POS,
    1470                                               N_("Qed: Creating the L2 table cache for image '%s' failed"),
    1471                                               pImage->pszFilename);
     1293                                rc = vdIfError(pImage->pIfError, rc, RT_SRC_POS,
     1294                                               N_("Qed: Creating the L2 table cache for image '%s' failed"),
     1295                                               pImage->pszFilename);
    14721296                        }
    14731297                        else
    1474                             rc = qedError(pImage, rc, RT_SRC_POS,
    1475                                           N_("Qed: Reading the L1 table for image '%s' failed"),
    1476                                           pImage->pszFilename);
     1298                            rc = vdIfError(pImage->pIfError, rc, RT_SRC_POS,
     1299                                           N_("Qed: Reading the L1 table for image '%s' failed"),
     1300                                           pImage->pszFilename);
    14771301                    }
    14781302                    else
    1479                         rc = qedError(pImage, VERR_NO_MEMORY, RT_SRC_POS,
    1480                                       N_("Qed: Out of memory allocating L1 table for image '%s'"),
    1481                                       pImage->pszFilename);
     1303                        rc = vdIfError(pImage->pIfError, VERR_NO_MEMORY, RT_SRC_POS,
     1304                                       N_("Qed: Out of memory allocating L1 table for image '%s'"),
     1305                                       pImage->pszFilename);
    14821306                }
    14831307            }
    14841308            else
    1485                 rc = qedError(pImage, VERR_NOT_SUPPORTED, RT_SRC_POS,
    1486                               N_("Qed: The image '%s' makes use of unsupported features"),
    1487                               pImage->pszFilename);
     1309                rc = vdIfError(pImage->pIfError, VERR_NOT_SUPPORTED, RT_SRC_POS,
     1310                               N_("Qed: The image '%s' makes use of unsupported features"),
     1311                               pImage->pszFilename);
    14881312        }
    14891313        else if (RT_SUCCESS(rc))
     
    15101334{
    15111335    int rc;
    1512     uint64_t uOff;
    15131336    int32_t fOpen;
    15141337
    15151338    if (uImageFlags & VD_IMAGE_FLAGS_FIXED)
    15161339    {
    1517         rc = qedError(pImage, VERR_VD_INVALID_TYPE, RT_SRC_POS, N_("Qed: cannot create fixed image '%s'"), pImage->pszFilename);
     1340        rc = vdIfError(pImage->pIfError, VERR_VD_INVALID_TYPE, RT_SRC_POS, N_("Qed: cannot create fixed image '%s'"), pImage->pszFilename);
    15181341        goto out;
    15191342    }
     
    15241347    pImage->LCHSGeometry = *pLCHSGeometry;
    15251348
    1526     pImage->pInterfaceError = VDInterfaceGet(pImage->pVDIfsDisk, VDINTERFACETYPE_ERROR);
    1527     if (pImage->pInterfaceError)
    1528         pImage->pInterfaceErrorCallbacks = VDGetInterfaceError(pImage->pInterfaceError);
    1529 
    1530     /* Get I/O interface. */
    1531     pImage->pInterfaceIO = VDInterfaceGet(pImage->pVDIfsImage, VDINTERFACETYPE_IOINT);
    1532     AssertPtrReturn(pImage->pInterfaceIO, VERR_INVALID_PARAMETER);
    1533     pImage->pInterfaceIOCallbacks = VDGetInterfaceIOInt(pImage->pInterfaceIO);
    1534     AssertPtrReturn(pImage->pInterfaceIOCallbacks, VERR_INVALID_PARAMETER);
     1349    pImage->pIfError = VDIfErrorGet(pImage->pVDIfsDisk);
     1350    pImage->pIfIo = VDIfIoIntGet(pImage->pVDIfsImage);
     1351    AssertPtrReturn(pImage->pIfIo, VERR_INVALID_PARAMETER);
    15351352
    15361353    /* Create image file. */
    15371354    fOpen = VDOpenFlagsToFileOpenFlags(pImage->uOpenFlags, true /* fCreate */);
    1538     rc = qedFileOpen(pImage, pImage->pszFilename, fOpen);
     1355    rc = vdIfIoIntFileOpen(pImage->pIfIo, pImage->pszFilename, fOpen, &pImage->pStorage);
    15391356    if (RT_FAILURE(rc))
    15401357    {
    1541         rc = qedError(pImage, rc, RT_SRC_POS, N_("Qed: cannot create image '%s'"), pImage->pszFilename);
     1358        rc = vdIfError(pImage->pIfError, rc, RT_SRC_POS, N_("Qed: cannot create image '%s'"), pImage->pszFilename);
    15421359        goto out;
    15431360    }
     
    15581375    if (!pImage->paL1Table)
    15591376    {
    1560         rc = qedError(pImage, VERR_NO_MEMORY, RT_SRC_POS, N_("Qed: cannot allocate memory for L1 table of image '%s'"),
    1561                       pImage->pszFilename);
     1377        rc = vdIfError(pImage->pIfError, VERR_NO_MEMORY, RT_SRC_POS, N_("Qed: cannot allocate memory for L1 table of image '%s'"),
     1378                       pImage->pszFilename);
    15621379        goto out;
    15631380    }
     
    15661383    if (RT_FAILURE(rc))
    15671384    {
    1568         rc = qedError(pImage, rc, RT_SRC_POS, N_("Qed: Failed to create L2 cache for image '%s'"),
    1569                       pImage->pszFilename);
     1385        rc = vdIfError(pImage->pIfError, rc, RT_SRC_POS, N_("Qed: Failed to create L2 cache for image '%s'"),
     1386                       pImage->pszFilename);
    15701387        goto out;
    15711388    }
     
    16031420        {
    16041421            /* Assumption right now is that the L1 table is not modified if the link fails. */
    1605             rc = qedFileSetSize(pImage, pClusterAlloc->cbImageOld);
     1422            rc = vdIfIoIntFileSetSize(pImage->pIfIo, pImage->pStorage, pClusterAlloc->cbImageOld);
    16061423            qedL2TblCacheEntryRelease(pClusterAlloc->pL2Entry); /* Release L2 cache entry. */
    16071424            qedL2TblCacheEntryFree(pImage, pClusterAlloc->pL2Entry); /* Free it, it is not in the cache yet. */
     
    16111428        {
    16121429            /* Assumption right now is that the L2 table is not modified if the link fails. */
    1613             rc = qedFileSetSize(pImage, pClusterAlloc->cbImageOld);
     1430            rc = vdIfIoIntFileSetSize(pImage->pIfIo, pImage->pStorage, pClusterAlloc->cbImageOld);
    16141431            qedL2TblCacheEntryRelease(pClusterAlloc->pL2Entry); /* Release L2 cache entry. */
    16151432        }
     
    16511468            /* Update the link in the on disk L1 table now. */
    16521469            pClusterAlloc->enmAllocState = QEDCLUSTERASYNCALLOCSTATE_L2_LINK;
    1653             rc = qedFileWriteMetaAsync(pImage, pImage->offL1Table + pClusterAlloc->idxL1*sizeof(uint64_t),
    1654                                        &offUpdateLe, sizeof(uint64_t), pIoCtx,
    1655                                        qedAsyncClusterAllocUpdate, pClusterAlloc);
     1470            rc = vdIfIoIntFileWriteMetaAsync(pImage->pIfIo, pImage->pStorage,
     1471                                             pImage->offL1Table + pClusterAlloc->idxL1*sizeof(uint64_t),
     1472                                             &offUpdateLe, sizeof(uint64_t), pIoCtx,
     1473                                             qedAsyncClusterAllocUpdate, pClusterAlloc);
    16561474            if (rc == VERR_VD_ASYNC_IO_IN_PROGRESS)
    16571475                break;
     
    16781496
    16791497            /* Write data. */
    1680             rc = qedFileWriteUserAsync(pImage, offData, pIoCtx, pClusterAlloc->cbToWrite,
    1681                                        qedAsyncClusterAllocUpdate, pClusterAlloc);
     1498            rc = vdIfIoIntFileWriteUserAsync(pImage->pIfIo, pImage->pStorage,
     1499                                             offData, pIoCtx, pClusterAlloc->cbToWrite,
     1500                                             qedAsyncClusterAllocUpdate, pClusterAlloc);
    16821501            if (rc == VERR_VD_ASYNC_IO_IN_PROGRESS)
    16831502                break;
     
    16961515
    16971516            /* Link L2 table and update it. */
    1698             rc = qedFileWriteMetaAsync(pImage, pImage->paL1Table[pClusterAlloc->idxL1] + pClusterAlloc->idxL2*sizeof(uint64_t),
    1699                                        &offUpdateLe, sizeof(uint64_t), pIoCtx,
    1700                                        qedAsyncClusterAllocUpdate, pClusterAlloc);
     1517            rc = vdIfIoIntFileWriteMetaAsync(pImage->pIfIo, pImage->pStorage,
     1518                                             pImage->paL1Table[pClusterAlloc->idxL1] + pClusterAlloc->idxL2*sizeof(uint64_t),
     1519                                             &offUpdateLe, sizeof(uint64_t), pIoCtx,
     1520                                             qedAsyncClusterAllocUpdate, pClusterAlloc);
    17011521            if (rc == VERR_VD_ASYNC_IO_IN_PROGRESS)
    17021522                break;
     
    17351555
    17361556    /* Get I/O interface. */
    1737     PVDINTERFACE pInterfaceIO = VDInterfaceGet(pVDIfsImage, VDINTERFACETYPE_IOINT);
    1738     AssertPtrReturn(pInterfaceIO, VERR_INVALID_PARAMETER);
    1739     PVDINTERFACEIOINT pInterfaceIOCallbacks = VDGetInterfaceIOInt(pInterfaceIO);
    1740     AssertPtrReturn(pInterfaceIOCallbacks, VERR_INVALID_PARAMETER);
     1557    PVDINTERFACEIOINT pIfIo = VDIfIoIntGet(pVDIfsImage);
     1558    AssertPtrReturn(pIfIo, VERR_INVALID_PARAMETER);
    17411559
    17421560    if (   !VALID_PTR(pszFilename)
     
    17501568     * Open the file and read the footer.
    17511569     */
    1752     rc = pInterfaceIOCallbacks->pfnOpen(pInterfaceIO->pvUser, pszFilename,
    1753                                         VDOpenFlagsToFileOpenFlags(VD_OPEN_FLAGS_READONLY,
    1754                                                                    false /* fCreate */),
    1755                                         &pStorage);
     1570    rc = vdIfIoIntFileOpen(pIfIo, pszFilename,
     1571                           VDOpenFlagsToFileOpenFlags(VD_OPEN_FLAGS_READONLY,
     1572                                                      false /* fCreate */),
     1573                           &pStorage);
    17561574    if (RT_SUCCESS(rc))
    1757         rc = pInterfaceIOCallbacks->pfnGetSize(pInterfaceIO->pvUser, pStorage,
    1758                                                &cbFile);
     1575        rc = vdIfIoIntFileGetSize(pIfIo, pStorage, &cbFile);
    17591576
    17601577    if (   RT_SUCCESS(rc)
     
    17631580        QedHeader Header;
    17641581
    1765         rc = pInterfaceIOCallbacks->pfnReadSync(pInterfaceIO->pvUser, pStorage, 0, &Header,
    1766                                                 sizeof(Header), NULL);
     1582        rc = vdIfIoIntFileReadSync(pIfIo, pStorage, 0, &Header, sizeof(Header), NULL);
    17671583        if (   RT_SUCCESS(rc)
    17681584            && qedHdrConvertToHostEndianess(&Header))
     
    17781594
    17791595    if (pStorage)
    1780         pInterfaceIOCallbacks->pfnClose(pInterfaceIO->pvUser, pStorage);
     1596        vdIfIoIntFileClose(pIfIo, pStorage);
    17811597
    17821598out:
     
    18481664    PFNVDPROGRESS pfnProgress = NULL;
    18491665    void *pvUser = NULL;
    1850     PVDINTERFACE pIfProgress = VDInterfaceGet(pVDIfsOperation,
    1851                                               VDINTERFACETYPE_PROGRESS);
    1852     PVDINTERFACEPROGRESS pCbProgress = NULL;
     1666    PVDINTERFACEPROGRESS pIfProgress = VDIfProgressGet(pVDIfsOperation);
    18531667    if (pIfProgress)
    18541668    {
    1855         pCbProgress = VDGetInterfaceProgress(pIfProgress);
    1856         if (pCbProgress)
    1857             pfnProgress = pCbProgress->pfnProgress;
    1858         pvUser = pIfProgress->pvUser;
     1669        pfnProgress = pIfProgress->pfnProgress;
     1670        pvUser = pIfProgress->Core.pvUser;
    18591671    }
    18601672
     
    19361748
    19371749    /* Rename the file. */
    1938     rc = qedFileMove(pImage, pImage->pszFilename, pszFilename, 0);
     1750    rc = vdIfIoIntFileMove(pImage->pIfIo, pImage->pszFilename, pszFilename, 0);
    19391751    if (RT_FAILURE(rc))
    19401752    {
     
    20091821    {
    20101822        LogFlowFunc(("offFile=%llu\n", offFile));
    2011         rc = qedFileReadSync(pImage, offFile, pvBuf, cbToRead, NULL);
     1823        rc = vdIfIoIntFileReadSync(pImage->pIfIo, pImage->pStorage, offFile,
     1824                                   pvBuf, cbToRead, NULL);
    20121825    }
    20131826
     
    20621875    rc = qedConvertToImageOffset(pImage, idxL1, idxL2, offCluster, &offImage);
    20631876    if (RT_SUCCESS(rc))
    2064         rc = qedFileWriteSync(pImage, offImage, pvBuf, cbToWrite, NULL);
     1877        rc = vdIfIoIntFileWriteSync(pImage->pIfIo, pImage->pStorage, offImage,
     1878                                    pvBuf, cbToWrite, NULL);
    20651879    else if (rc == VERR_VD_BLOCK_FREE)
    20661880    {
     
    20991913                     * is a leak of some clusters.
    21001914                     */
    2101                     rc = qedFileWriteSync(pImage, offL2Tbl, pL2Entry->paL2Tbl, pImage->cbTable, NULL);
     1915                    rc = vdIfIoIntFileWriteSync(pImage->pIfIo, pImage->pStorage, offL2Tbl,
     1916                                                pL2Entry->paL2Tbl, pImage->cbTable, NULL);
    21021917                    if (RT_FAILURE(rc))
    21031918                        break;
     
    21061921                    pImage->paL1Table[idxL1] = offL2Tbl;
    21071922                    idxUpdateLe = RT_H2LE_U64(offL2Tbl);
    2108                     rc = qedFileWriteSync(pImage, pImage->offL1Table + idxL1*sizeof(uint64_t),
    2109                                           &idxUpdateLe, sizeof(uint64_t), NULL);
     1923                    rc = vdIfIoIntFileWriteSync(pImage->pIfIo, pImage->pStorage,
     1924                                                pImage->offL1Table + idxL1*sizeof(uint64_t),
     1925                                                &idxUpdateLe, sizeof(uint64_t), NULL);
    21101926                    if (RT_FAILURE(rc))
    21111927                        break;
     
    21201936
    21211937                    /* Write data. */
    2122                     rc = qedFileWriteSync(pImage, offData, pvBuf, cbToWrite, NULL);
     1938                    rc = vdIfIoIntFileWriteSync(pImage->pIfIo, pImage->pStorage,
     1939                                                offData, pvBuf, cbToWrite, NULL);
    21231940                    if (RT_FAILURE(rc))
    21241941                        break;
     
    21271944                    pL2Entry->paL2Tbl[idxL2] = offData;
    21281945                    idxUpdateLe = RT_H2LE_U64(offData);
    2129                     rc = qedFileWriteSync(pImage, pImage->paL1Table[idxL1] + idxL2*sizeof(uint64_t),
    2130                                           &idxUpdateLe, sizeof(uint64_t), NULL);
     1946                    rc = vdIfIoIntFileWriteSync(pImage->pIfIo, pImage->pStorage,
     1947                                                pImage->paL1Table[idxL1] + idxL2*sizeof(uint64_t),
     1948                                                &idxUpdateLe, sizeof(uint64_t), NULL);
    21311949                    qedL2TblCacheEntryRelease(pL2Entry);
    21321950                }
     
    22102028        if (pImage->pStorage)
    22112029        {
    2212             int rc = qedFileGetSize(pImage, &cbFile);
     2030            int rc = vdIfIoIntFileGetSize(pImage->pIfIo, pImage->pStorage, &cbFile);
    22132031            if (RT_SUCCESS(rc))
    22142032                cb += cbFile;
     
    26082426    if (pImage)
    26092427    {
    2610         qedMessage(pImage, "Header: Geometry PCHS=%u/%u/%u LCHS=%u/%u/%u cbSector=%llu\n",
    2611                     pImage->PCHSGeometry.cCylinders, pImage->PCHSGeometry.cHeads, pImage->PCHSGeometry.cSectors,
    2612                     pImage->LCHSGeometry.cCylinders, pImage->LCHSGeometry.cHeads, pImage->LCHSGeometry.cSectors,
    2613                     pImage->cbSize / 512);
     2428        vdIfErrorMessage(pImage->pIfError, "Header: Geometry PCHS=%u/%u/%u LCHS=%u/%u/%u cbSector=%llu\n",
     2429                         pImage->PCHSGeometry.cCylinders, pImage->PCHSGeometry.cHeads, pImage->PCHSGeometry.cSectors,
     2430                         pImage->LCHSGeometry.cCylinders, pImage->LCHSGeometry.cHeads, pImage->LCHSGeometry.cSectors,
     2431                         pImage->cbSize / 512);
    26142432    }
    26152433}
     
    26652483                    pImage->offBackingFilename = (uint32_t)offData;
    26662484                    pImage->cbBackingFilename  = strlen(pszParentFilename);
    2667                     rc = qedFileSetSize(pImage, offData + pImage->cbCluster);
     2485                    rc = vdIfIoIntFileSetSize(pImage->pIfIo, pImage->pStorage,
     2486                                              offData + pImage->cbCluster);
    26682487                }
    26692488
    26702489                if (RT_SUCCESS(rc))
    2671                     rc = qedFileWriteSync(pImage, pImage->offBackingFilename,
    2672                                           pImage->pszBackingFilename, strlen(pImage->pszBackingFilename),
    2673                                           NULL);
     2490                    rc = vdIfIoIntFileWriteSync(pImage->pIfIo, pImage->pStorage,
     2491                                                pImage->offBackingFilename,
     2492                                                pImage->pszBackingFilename,
     2493                                                strlen(pImage->pszBackingFilename),
     2494                                                NULL);
    26742495            }
    26752496        }
     
    27202541                                      &offFile);
    27212542    if (RT_SUCCESS(rc))
    2722         rc = qedFileReadUserAsync(pImage, offFile, pIoCtx, cbToRead);
     2543        rc = vdIfIoIntFileReadUserAsync(pImage->pIfIo, pImage->pStorage, offFile,
     2544                                        pIoCtx, cbToRead);
    27232545
    27242546    if (   (   RT_SUCCESS(rc)
     
    27812603                                      &offImage);
    27822604    if (RT_SUCCESS(rc))
    2783         rc = qedFileWriteUserAsync(pImage, offImage, pIoCtx, cbToWrite,
    2784                                    NULL, NULL);
     2605        rc = vdIfIoIntFileWriteUserAsync(pImage->pIfIo, pImage->pStorage,
     2606                                         offImage, pIoCtx, cbToWrite, NULL, NULL);
    27852607    else if (rc == VERR_VD_BLOCK_FREE)
    27862608    {
     
    28372659                     * is a leak of some clusters.
    28382660                     */
    2839                     rc = qedFileWriteMetaAsync(pImage, offL2Tbl, pL2Entry->paL2Tbl, pImage->cbTable, pIoCtx,
    2840                                                qedAsyncClusterAllocUpdate, pL2ClusterAlloc);
     2661                    rc = vdIfIoIntFileWriteMetaAsync(pImage->pIfIo, pImage->pStorage,
     2662                                                     offL2Tbl, pL2Entry->paL2Tbl, pImage->cbTable, pIoCtx,
     2663                                                     qedAsyncClusterAllocUpdate, pL2ClusterAlloc);
    28412664                    if (rc == VERR_VD_ASYNC_IO_IN_PROGRESS)
    28422665                        break;
     
    28792702
    28802703                        /* Write data. */
    2881                         rc = qedFileWriteUserAsync(pImage, offData, pIoCtx, cbToWrite,
    2882                                                    qedAsyncClusterAllocUpdate, pDataClusterAlloc);
     2704                        rc = vdIfIoIntFileWriteUserAsync(pImage->pIfIo, pImage->pStorage,
     2705                                                         offData, pIoCtx, cbToWrite,
     2706                                                         qedAsyncClusterAllocUpdate, pDataClusterAlloc);
    28832707                        if (rc == VERR_VD_ASYNC_IO_IN_PROGRESS)
    28842708                            break;
     
    29432767    int rc = VINF_SUCCESS;
    29442768
    2945     PFNVDPROGRESS pfnProgress = NULL;
    2946     void *pvUser = NULL;
    2947     PVDINTERFACE pIfProgress = VDInterfaceGet(pVDIfsOperation,
    2948                                               VDINTERFACETYPE_PROGRESS);
    2949     PVDINTERFACEPROGRESS pCbProgress = NULL;
    2950     if (pIfProgress)
    2951     {
    2952         pCbProgress = VDGetInterfaceProgress(pIfProgress);
    2953         if (pCbProgress)
    2954             pfnProgress = pCbProgress->pfnProgress;
    2955         pvUser = pIfProgress->pvUser;
    2956     }
     2769    PVDINTERFACEPROGRESS pIfProgress = VDIfProgressGet(pVDIfsOperation);
    29572770
    29582771    /* Making the image smaller is not supported at the moment. */
     
    29712784         */
    29722785        if (qedByte2Cluster(pImage, pImage->cbTable)*pImage->cTableEntries*pImage->cTableEntries*pImage->cbCluster < cbSize)
    2973             rc = qedError(pImage, VERR_BUFFER_OVERFLOW, RT_SRC_POS,
    2974                           N_("Qed: Resizing the image '%s' is not supported because it would overflow the L1 and L2 table\n"),
    2975                           pImage->pszFilename);
     2786            rc = vdIfError(pImage->pIfError, VERR_BUFFER_OVERFLOW, RT_SRC_POS,
     2787                           N_("Qed: Resizing the image '%s' is not supported because it would overflow the L1 and L2 table\n"),
     2788                           pImage->pszFilename);
    29762789        else
    29772790        {
     
    29842797                pImage->cbSize = cbSizeOld; /* Restore */
    29852798
    2986                 rc = qedError(pImage, rc, RT_SRC_POS, N_("Qed: Resizing the image '%s' failed\n"),
    2987                               pImage->pszFilename);
     2799                rc = vdIfError(pImage->pIfError, rc, RT_SRC_POS, N_("Qed: Resizing the image '%s' failed\n"),
     2800                               pImage->pszFilename);
    29882801            }
    29892802        }
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