VirtualBox

Changeset 24746 in vbox for trunk


Ignore:
Timestamp:
Nov 17, 2009 11:02:47 PM (15 years ago)
Author:
vboxsync
Message:

AsyncCompletion: Make it possible to enable the new I/O path with a CFGM key. The RTFile* API is still used if the key is not present

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Config.kmk

    r24615 r24746  
    516516endif
    517517# Enable the new I/O path
    518 #if1of ($(KBUILD_TARGET), linux solaris win freebsd darwin)
    519 # VBOX_WITH_NEW_IO_CODE = 1
    520 #endif
     518if1of ($(KBUILD_TARGET), linux solaris win freebsd darwin)
     519 VBOX_WITH_NEW_IO_CODE = 1
     520endif
    521521
    522522#
  • trunk/src/VBox/Devices/Storage/DrvVD.cpp

    r24612 r24746  
    10111011    AssertRC(rc);
    10121012
    1013 #ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
    1014     pThis->VDIAsyncIOCallbacks.cbSize                  = sizeof(VDINTERFACEASYNCIO);
    1015     pThis->VDIAsyncIOCallbacks.enmInterface            = VDINTERFACETYPE_ASYNCIO;
    1016     pThis->VDIAsyncIOCallbacks.pfnOpen                 = drvvdAsyncIOOpen;
    1017     pThis->VDIAsyncIOCallbacks.pfnClose                = drvvdAsyncIOClose;
    1018     pThis->VDIAsyncIOCallbacks.pfnGetSize              = drvvdAsyncIOGetSize;
    1019     pThis->VDIAsyncIOCallbacks.pfnSetSize              = drvvdAsyncIOSetSize;
    1020     pThis->VDIAsyncIOCallbacks.pfnReadSync             = drvvdAsyncIOReadSync;
    1021     pThis->VDIAsyncIOCallbacks.pfnWriteSync            = drvvdAsyncIOWriteSync;
    1022     pThis->VDIAsyncIOCallbacks.pfnFlushSync            = drvvdAsyncIOFlushSync;
    1023     pThis->VDIAsyncIOCallbacks.pfnReadAsync            = drvvdAsyncIOReadAsync;
    1024     pThis->VDIAsyncIOCallbacks.pfnWriteAsync           = drvvdAsyncIOWriteAsync;
    1025     pThis->VDIAsyncIOCallbacks.pfnFlushAsync           = drvvdAsyncIOFlushAsync;
    1026 
    1027     rc = VDInterfaceAdd(&pThis->VDIAsyncIO, "DrvVD_AsyncIO", VDINTERFACETYPE_ASYNCIO,
    1028                         &pThis->VDIAsyncIOCallbacks, pThis, &pThis->pVDIfsDisk);
    1029     AssertRC(rc);
    1030 #endif
    1031 
    10321013    /* This is just prepared here, the actual interface is per-image, so it's
    10331014     * added later. No need to have separate callback tables. */
     
    10491030     */
    10501031    bool        fHostIP = false;
     1032    bool        fUseNewIo = false;
    10511033    unsigned    iLevel = 0;
    10521034    PCFGMNODE   pCurNode = pCfgHandle;
     
    10631045                                          "Format\0Path\0"
    10641046                                          "ReadOnly\0TempReadOnly\0HonorZeroWrites\0"
    1065                                           "HostIPStack\0");
     1047                                          "HostIPStack\0UseNewIo\0");
    10661048        }
    10671049        else
     
    11171099                break;
    11181100            }
     1101            rc = CFGMR3QueryBoolDef(pCurNode, "UseNewIo", &fUseNewIo, false);
     1102            if (RT_FAILURE(rc))
     1103            {
     1104                rc = PDMDRV_SET_ERROR(pDrvIns, rc,
     1105                                      N_("DrvVD: Configuration error: Querying \"UseNewIo\" as boolean failed"));
     1106                break;
     1107            }
    11191108        }
    11201109
     
    11681157                                &pThis->pVDIfsDisk);
    11691158        }
     1159
     1160        if (RT_SUCCESS(rc) && fUseNewIo)
     1161        {
     1162#ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
     1163            pThis->VDIAsyncIOCallbacks.cbSize        = sizeof(VDINTERFACEASYNCIO);
     1164            pThis->VDIAsyncIOCallbacks.enmInterface  = VDINTERFACETYPE_ASYNCIO;
     1165            pThis->VDIAsyncIOCallbacks.pfnOpen       = drvvdAsyncIOOpen;
     1166            pThis->VDIAsyncIOCallbacks.pfnClose      = drvvdAsyncIOClose;
     1167            pThis->VDIAsyncIOCallbacks.pfnGetSize    = drvvdAsyncIOGetSize;
     1168            pThis->VDIAsyncIOCallbacks.pfnSetSize    = drvvdAsyncIOSetSize;
     1169            pThis->VDIAsyncIOCallbacks.pfnReadSync   = drvvdAsyncIOReadSync;
     1170            pThis->VDIAsyncIOCallbacks.pfnWriteSync  = drvvdAsyncIOWriteSync;
     1171            pThis->VDIAsyncIOCallbacks.pfnFlushSync  = drvvdAsyncIOFlushSync;
     1172            pThis->VDIAsyncIOCallbacks.pfnReadAsync  = drvvdAsyncIOReadAsync;
     1173            pThis->VDIAsyncIOCallbacks.pfnWriteAsync = drvvdAsyncIOWriteAsync;
     1174            pThis->VDIAsyncIOCallbacks.pfnFlushAsync = drvvdAsyncIOFlushAsync;
     1175
     1176            rc = VDInterfaceAdd(&pThis->VDIAsyncIO, "DrvVD_AsyncIO", VDINTERFACETYPE_ASYNCIO,
     1177                                &pThis->VDIAsyncIOCallbacks, pThis, &pThis->pVDIfsDisk);
     1178#else /* !VBOX_WITH_PDM_ASYNC_COMPLETION */
     1179            rc = PDMDrvHlpVMSetError(pDrvIns, VERR_PDM_DRVINS_UNKNOWN_CFG_VALUES,
     1180                                     RT_SRC_POS, N_("DrvVD: Configuration error: Async Completion Framework not compiled in"));
     1181#endif /* !VBOX_WITH_PDM_ASYNC_COMPLETION */
     1182        }
     1183
    11701184        if (RT_SUCCESS(rc))
    11711185        {
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