VirtualBox

Changeset 51754 in vbox for trunk/src/VBox/Devices/Storage


Ignore:
Timestamp:
Jun 27, 2014 10:38:09 PM (10 years ago)
Author:
vboxsync
Message:

Main,DrvVD,VD: Implement support for VD plugins from extension packs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/DrvVD.cpp

    r51752 r51754  
    21012101
    21022102/**
     2103 * Loads all configured plugins.
     2104 *
     2105 * @returns VBox status code.
     2106 * @param   pThis    The disk instance.
     2107 * @param   pCfg     CFGM node holding plugin list.
     2108 */
     2109static int drvvdLoadPlugins(PVBOXDISK pThis, PCFGMNODE pCfg)
     2110{
     2111    int rc = VINF_SUCCESS;
     2112    PCFGMNODE pCfgPlugins = CFGMR3GetChild(pCfg, "Plugins");
     2113
     2114    if (pCfgPlugins)
     2115    {
     2116        PCFGMNODE pPluginCur = CFGMR3GetFirstChild(pCfgPlugins);
     2117        while (   pPluginCur
     2118               && RT_SUCCESS(rc))
     2119        {
     2120            char *pszPluginFilename = NULL;
     2121            rc = CFGMR3QueryStringAlloc(pPluginCur, "Path", &pszPluginFilename);
     2122            if (RT_SUCCESS(rc))
     2123                rc = VDPluginLoadFromFilename(pszPluginFilename);
     2124
     2125            pPluginCur = CFGMR3GetNextChild(pPluginCur);
     2126        }
     2127    }
     2128
     2129    return rc;
     2130}
     2131
     2132
     2133/**
    21032134 * Sets up the disk filter chain.
    21042135 *
     
    24312462    /* Try to attach async media port interface above.*/
    24322463    pThis->pDrvMediaAsyncPort = PDMIBASE_QUERY_INTERFACE(pDrvIns->pUpBase, PDMIMEDIAASYNCPORT);
     2464
     2465    /* Before we access any VD API load all given plugins. */
     2466    rc = drvvdLoadPlugins(pThis, pCfg);
     2467    if (RT_FAILURE(rc))
     2468        return PDMDRV_SET_ERROR(pDrvIns, rc, N_("Loading VD plugins failed"));
    24332469
    24342470    /*
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