VirtualBox

Changeset 22277 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Aug 16, 2009 9:12:50 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
51119
Message:

PDMDRVREG change (big changeset).

Location:
trunk/src/VBox/Devices
Files:
29 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/audio.c

    r20501 r22277  
    19711971/**
    19721972 * Construct an AUDIO driver instance.
    1973  *
    1974  * @returns VBox status.
    1975  * @param   pDrvIns     The driver instance data.
    1976  *                      If the registration structure is needed, pDrvIns->pDrvReg points to it.
    1977  * @param   pCfgHandle  Configuration node handle for the driver. Use this to obtain the configuration
    1978  *                      of the driver instance. It's also found in pDrvIns->pCfgHandle, but like
    1979  *                      iInstance it's expected to be used a bit in this function.
     1973 * 
     1974 * @copydoc FNPDMDRVCONSTRUCT
    19801975 */
    1981 static DECLCALLBACK(int) drvAudioConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfgHandle)
    1982 {
    1983     int rc;
    1984     PDRVAUDIO pThis = PDMINS_2_DATA(pDrvIns, PDRVAUDIO);
    1985     char *drvname;
     1976static DECLCALLBACK(int) drvAudioConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfgHandle, uint32_t fFlags)
     1977{
     1978    PDRVAUDIO   pThis = PDMINS_2_DATA(pDrvIns, PDRVAUDIO);
     1979    char       *drvname;
     1980    int         rc;
    19861981
    19871982    LogFlow(("drvAUDIOConstruct:\n"));
     1983
    19881984    /*
    19891985     * Validate the config.
     
    20772073    /* pfnResume */
    20782074    audioResume,
     2075    /* pfnAttach */
     2076    NULL,
    20792077    /* pfnDetach */
    20802078    NULL,
    20812079    /* pfnPowerOff */
    2082     drvAudioPowerOff
     2080    drvAudioPowerOff,
     2081    /* pfnSoftReset */
     2082    NULL,
     2083    /* u32EndVersion */
     2084    PDM_DRVREG_VERSION
    20832085};
     2086
  • trunk/src/VBox/Devices/Graphics/DevVGA.cpp

    r22274 r22277  
    55355535    PVGASTATE   pThis = PDMINS_2_DATA(pDevIns, PVGASTATE);
    55365536
    5537     AssertMsgReturn(fFlags & PDMDEVATT_FLAGS_NOT_HOT_PLUG,
     5537    AssertMsgReturn(fFlags & PDM_TACH_FLAGS_NOT_HOT_PLUG,
    55385538                    ("VGA device does not support hotplugging\n"),
    55395539                    VERR_INVALID_PARAMETER);
     
    56155615    PVGASTATE   pThis = PDMINS_2_DATA(pDevIns, PVGASTATE);
    56165616
    5617     AssertMsg(fFlags & PDMDEVATT_FLAGS_NOT_HOT_PLUG,
     5617    AssertMsg(fFlags & PDM_TACH_FLAGS_NOT_HOT_PLUG,
    56185618              ("VGA device does not support hotplugging\n"));
    56195619
     
    59895989     * Attach to the display.
    59905990     */
    5991     rc = vgaAttach(pDevIns, 0 /* display LUN # */, PDMDEVATT_FLAGS_NOT_HOT_PLUG);
     5991    rc = vgaAttach(pDevIns, 0 /* display LUN # */, PDM_TACH_FLAGS_NOT_HOT_PLUG);
    59925992    if (RT_FAILURE(rc))
    59935993        return rc;
  • trunk/src/VBox/Devices/Input/DevPS2.cpp

    r21188 r22277  
    15371537    KBDState   *pThis = PDMINS_2_DATA(pDevIns, KBDState *);
    15381538
    1539     AssertMsgReturn(fFlags & PDMDEVATT_FLAGS_NOT_HOT_PLUG,
     1539    AssertMsgReturn(fFlags & PDM_TACH_FLAGS_NOT_HOT_PLUG,
    15401540                    ("PS/2 device does not support hotplugging\n"),
    15411541                    VERR_INVALID_PARAMETER);
     
    17301730     * Attach to the keyboard and mouse drivers.
    17311731     */
    1732     rc = kbdAttach(pDevIns, 0 /* keyboard LUN # */, PDMDEVATT_FLAGS_NOT_HOT_PLUG);
     1732    rc = kbdAttach(pDevIns, 0 /* keyboard LUN # */, PDM_TACH_FLAGS_NOT_HOT_PLUG);
    17331733    if (RT_FAILURE(rc))
    17341734        return rc;
    1735     rc = kbdAttach(pDevIns, 1 /* aux/mouse LUN # */, PDMDEVATT_FLAGS_NOT_HOT_PLUG);
     1735    rc = kbdAttach(pDevIns, 1 /* aux/mouse LUN # */, PDM_TACH_FLAGS_NOT_HOT_PLUG);
    17361736    if (RT_FAILURE(rc))
    17371737        return rc;
  • trunk/src/VBox/Devices/Input/DrvKeyboardQueue.cpp

    r21363 r22277  
    240240 * Construct a keyboard driver instance.
    241241 *
    242  * @returns VBox status.
    243  * @param   pDrvIns     The driver instance data.
    244  *                      If the registration structure is needed, pDrvIns->pDrvReg points to it.
    245  * @param   pCfgHandle  Configuration node handle for the driver. Use this to obtain the configuration
    246  *                      of the driver instance. It's also found in pDrvIns->pCfgHandle, but like
    247  *                      iInstance it's expected to be used a bit in this function.
    248  */
    249 static DECLCALLBACK(int) drvKbdQueueConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfgHandle)
     242 * @copydoc FNPDMDRVCONSTRUCT
     243 */
     244static DECLCALLBACK(int) drvKbdQueueConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfgHandle, uint32_t fFlags)
    250245{
    251246    PDRVKBDQUEUE pDrv = PDMINS_2_DATA(pDrvIns, PDRVKBDQUEUE);
     
    283278     */
    284279    PPDMIBASE pDownBase;
    285     int rc = pDrvIns->pDrvHlp->pfnAttach(pDrvIns, &pDownBase);
     280    int rc = PDMDrvHlpAttach(pDrvIns, fFlags, &pDownBase);
    286281    if (RT_FAILURE(rc))
    287282    {
     
    363358    /* pfnResume */
    364359    drvKbdQueueResume,
     360    /* pfnAttach */
     361    NULL,
    365362    /* pfnDetach */
    366363    NULL,
    367     /** pfnPowerOff */
    368     drvKbdQueuePowerOff
     364    /* pfnPowerOff */
     365    drvKbdQueuePowerOff,
     366    /* pfnSoftReset */
     367    NULL,
     368    /* u32EndVersion */
     369    PDM_DRVREG_VERSION
    369370};
    370371
  • trunk/src/VBox/Devices/Input/DrvMouseQueue.cpp

    r21363 r22277  
    226226
    227227/**
    228  * Construct a mouse driver instance.
    229  *
    230  * @returns VBox status.
    231  * @param   pDrvIns     The driver instance data.
    232  *                      If the registration structure is needed, pDrvIns->pDrvReg points to it.
    233  * @param   pCfgHandle  Configuration node handle for the driver. Use this to obtain the configuration
    234  *                      of the driver instance. It's also found in pDrvIns->pCfgHandle, but like
    235  *                      iInstance it's expected to be used a bit in this function.
    236  */
    237 static DECLCALLBACK(int) drvMouseQueueConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfgHandle)
     228 * Construct a mouse driver instance.
     229 * 
     230 * @copydoc FNPDMDRVCONSTRUCT
     231 */
     232static DECLCALLBACK(int) drvMouseQueueConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfgHandle, uint32_t fFlags)
    238233{
    239234    PDRVMOUSEQUEUE pDrv = PDMINS_2_DATA(pDrvIns, PDRVMOUSEQUEUE);
     
    269264     */
    270265    PPDMIBASE pDownBase;
    271     int rc = pDrvIns->pDrvHlp->pfnAttach(pDrvIns, &pDownBase);
     266    int rc = PDMDrvHlpAttach(pDrvIns, fFlags, &pDownBase);
    272267    if (RT_FAILURE(rc))
    273268    {
     
    349344    /* pfnResume */
    350345    drvMouseQueueResume,
     346    /* pfnAttach */
     347    NULL,
    351348    /* pfnDetach */
    352349    NULL,
    353     /** pfnPowerOff */
    354     drvMouseQueuePowerOff
     350    /* pfnPowerOff */
     351    drvMouseQueuePowerOff,
     352    /* pfnSoftReset */
     353    NULL,
     354    /* u32EndVersion */
     355    PDM_DRVREG_VERSION
    355356};
    356357
    357 
  • trunk/src/VBox/Devices/Network/DrvIntNet.cpp

    r20708 r22277  
    743743 * Construct a TAP network transport driver instance.
    744744 *
    745  * @returns VBox status.
    746  * @param   pDrvIns     The driver instance data.
    747  *                      If the registration structure is needed, pDrvIns->pDrvReg points to it.
    748  * @param   pCfgHandle  Configuration node handle for the driver. Use this to obtain the configuration
    749  *                      of the driver instance. It's also found in pDrvIns->pCfgHandle, but like
    750  *                      iInstance it's expected to be used a bit in this function.
    751  */
    752 static DECLCALLBACK(int) drvIntNetConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfgHandle)
     745 * @copydoc FNPDMDRVCONSTRUCT
     746 */
     747static DECLCALLBACK(int) drvIntNetConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfgHandle, uint32_t fFlags)
    753748{
    754749    PDRVINTNET pThis = PDMINS_2_DATA(pDrvIns, PDRVINTNET);
     
    796791     * Check that no-one is attached to us.
    797792     */
    798     int rc = pDrvIns->pDrvHlp->pfnAttach(pDrvIns, NULL);
    799     if (rc != VERR_PDM_NO_ATTACHED_DRIVER)
    800     {
    801         AssertMsgFailed(("Configuration error: Cannot attach drivers to the TAP driver!\n"));
    802         return VERR_PDM_DRVINS_NO_ATTACH;
    803     }
     793    AssertMsgReturn(PDMDrvHlpNoAttach(pDrvIns) == VERR_PDM_NO_ATTACHED_DRIVER,
     794                    ("Configuration error: Not possible to attach anything to this driver!\n"),
     795                    VERR_PDM_DRVINS_NO_ATTACH);
    804796
    805797    /*
     
    826818     * The name of the internal network to connect to.
    827819     */
    828     rc = CFGMR3QueryString(pCfgHandle, "Network", OpenReq.szNetwork, sizeof(OpenReq.szNetwork));
     820    int rc = CFGMR3QueryString(pCfgHandle, "Network", OpenReq.szNetwork, sizeof(OpenReq.szNetwork));
    829821    if (RT_FAILURE(rc))
    830822        return PDMDRV_SET_ERROR(pDrvIns, rc,
     
    11411133    /* pfnResume */
    11421134    drvIntNetResume,
     1135    /* pfnAttach */
     1136    NULL,
    11431137    /* pfnDetach */
    11441138    NULL,
    11451139    /* pfnPowerOff */
    1146     drvIntNetPowerOff
     1140    drvIntNetPowerOff,
     1141    /* pfnSoftReset */
     1142    NULL,
     1143    /* u32EndVersion */
     1144    PDM_DRVREG_VERSION
    11471145};
    11481146
  • trunk/src/VBox/Devices/Network/DrvNAT.cpp

    r22252 r22277  
    855855 * Construct a NAT network transport driver instance.
    856856 *
    857  * @returns VBox status.
    858  * @param   pDrvIns     The driver instance data.
    859  *                      If the registration structure is needed, pDrvIns->pDrvReg points to it.
    860  * @param   pCfgHandle  Configuration node handle for the driver. Use this to obtain the configuration
    861  *                      of the driver instance. It's also found in pDrvIns->pCfgHandle, but like
    862  *                      iInstance it's expected to be used a bit in this function.
    863  */
    864 static DECLCALLBACK(int) drvNATConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfgHandle)
     857 * @copydoc FNPDMDRVCONSTRUCT
     858 */
     859static DECLCALLBACK(int) drvNATConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfgHandle, uint32_t fFlags)
    865860{
    866861    PDRVNAT pThis = PDMINS_2_DATA(pDrvIns, PDRVNAT);
    867     char szNetAddr[16];
    868     char szNetwork[32]; /* xxx.xxx.xxx.xxx/yy */
    869862
    870863    LogFlow(("drvNATConstruct:\n"));
     
    873866     * Validate the config.
    874867     */
    875     if (!CFGMR3AreValuesValid(pCfgHandle, "PassDomain\0TFTPPrefix\0BootFile\0Network"
    876         "\0NextServer\0DNSProxy\0BindIP\0"
    877         "SocketRcvBuf\0SocketSndBuf\0TcpRcvSpace\0TcpSndSpace\0"))
     868    if (!CFGMR3AreValuesValid(pCfgHandle,
     869                              "PassDomain\0TFTPPrefix\0BootFile\0Network"
     870                              "\0NextServer\0DNSProxy\0BindIP\0"
     871                              "SocketRcvBuf\0SocketSndBuf\0TcpRcvSpace\0TcpSndSpace\0"))
    878872        return PDMDRV_SET_ERROR(pDrvIns, VERR_PDM_DRVINS_UNKNOWN_CFG_VALUES,
    879873                                N_("Unknown NAT configuration option, only supports PassDomain,"
     
    928922
    929923    /* Generate a network address for this network card. */
     924    char szNetwork[32]; /* xxx.xxx.xxx.xxx/yy */
    930925    GET_STRING(rc, pThis, pCfgHandle, "Network", szNetwork[0], sizeof(szNetwork));
    931926    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
     
    940935                                   pDrvIns->iInstance, szNetwork);
    941936
     937    char szNetAddr[16];
    942938    RTStrPrintf(szNetAddr, sizeof(szNetAddr), "%d.%d.%d.%d",
    943939               (Network & 0xFF000000) >> 24, (Network & 0xFF0000) >> 16,
     
    979975#ifdef VBOX_WITH_STATISTICS
    980976        PDMDrvHlpSTAMRegisterF(pDrvIns, &pThis->StatQueuePktSent,    STAMTYPE_COUNTER,
    981                               STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "counting packet sent viai "
    982                               "PDM queue", "/Drivers/NAT%u/QueuePacketSent", pDrvIns->iInstance);
     977                               STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "counting packet sent viai "
     978                               "PDM queue", "/Drivers/NAT%u/QueuePacketSent", pDrvIns->iInstance);
    983979        PDMDrvHlpSTAMRegisterF(pDrvIns, &pThis->StatQueuePktDropped, STAMTYPE_COUNTER,
    984                               STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "counting packet sent via PDM"
    985                               " queue", "/Drivers/NAT%u/QueuePacketDropped", pDrvIns->iInstance);
     980                               STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "counting packet sent via PDM"
     981                               " queue", "/Drivers/NAT%u/QueuePacketDropped", pDrvIns->iInstance);
    986982        PDMDrvHlpSTAMRegisterF(pDrvIns, &pThis->StatConsumerFalse, STAMTYPE_COUNTER,
    987                               STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "counting PDM consumer false"
    988                               " queue", "/Drivers/NAT%u/PDMConsumerFalse", pDrvIns->iInstance);
     983                               STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "counting PDM consumer false"
     984                               " queue", "/Drivers/NAT%u/PDMConsumerFalse", pDrvIns->iInstance);
    989985# ifdef SLIRP_SPLIT_CAN_OUTPUT
    990986        PDMDrvHlpSTAMRegisterF(pDrvIns, &pThis->StatNATRxWakeups, STAMTYPE_COUNTER,
    991                               STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "counting wakeups of NATRX"
    992                               " thread", "/Drivers/NAT%u/NATRxWakeups", pDrvIns->iInstance);
     987                               STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "counting wakeups of NATRX"
     988                               " thread", "/Drivers/NAT%u/NATRxWakeups", pDrvIns->iInstance);
    993989# endif
    994990#endif
     
    11121108    /* pfnResume */
    11131109    NULL,
     1110    /* pfnAttach */
     1111    NULL,
    11141112    /* pfnDetach */
     1113    NULL,
     1114    /* pfnPowerOff */
     1115    NULL,
     1116    /* pfnSoftReset */
    11151117    NULL,
    1116     /* pfnPowerOff */
    1117     NULL
     1118    /* u32EndVersion */
     1119    PDM_DRVREG_VERSION
    11181120};
     1121
  • trunk/src/VBox/Devices/Network/DrvNetSniffer.cpp

    r15518 r22277  
    302302 * Construct a NAT network transport driver instance.
    303303 *
    304  * @returns VBox status.
    305  * @param   pDrvIns     The driver instance data.
    306  *                      If the registration structure is needed, pDrvIns->pDrvReg points to it.
    307  * @param   pCfgHandle  Configuration node handle for the driver. Use this to obtain the configuration
    308  *                      of the driver instance. It's also found in pDrvIns->pCfgHandle, but like
    309  *                      iInstance it's expected to be used a bit in this function.
    310  */
    311 static DECLCALLBACK(int) drvNetSnifferConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfgHandle)
     304 * @copydoc FNPDMDRVCONSTRUCT
     305 */
     306static DECLCALLBACK(int) drvNetSnifferConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfgHandle, uint32_t fFlags)
    312307{
    313308    PDRVNETSNIFFER pThis = PDMINS_2_DATA(pDrvIns, PDRVNETSNIFFER);
     
    380375     */
    381376    PPDMIBASE   pBaseDown;
    382     rc = pDrvIns->pDrvHlp->pfnAttach(pDrvIns, &pBaseDown);
     377    rc = PDMDrvHlpAttach(pDrvIns, fFlags, &pBaseDown);
    383378    if (rc == VERR_PDM_NO_ATTACHED_DRIVER)
    384379        pThis->pConnector = NULL;
     
    458453    /* pfnResume */
    459454    NULL,
     455    /* pfnAttach */
     456    NULL,
    460457    /* pfnDetach */
    461     NULL,
     458    NULL, 
    462459    /* pfnPowerOff */
    463     NULL
     460    NULL,
     461    /* pfnSoftReset */
     462    NULL,
     463    /* u32EndVersion */
     464    PDM_DRVREG_VERSION
    464465};
    465466
  • trunk/src/VBox/Devices/Network/DrvTAP.cpp

    r20708 r22277  
    882882 * Construct a TAP network transport driver instance.
    883883 *
    884  * @returns VBox status.
    885  * @param   pDrvIns     The driver instance data.
    886  *                      If the registration structure is needed, pDrvIns->pDrvReg points to it.
    887  * @param   pCfgHandle  Configuration node handle for the driver. Use this to obtain the configuration
    888  *                      of the driver instance. It's also found in pDrvIns->pCfgHandle, but like
    889  *                      iInstance it's expected to be used a bit in this function.
    890  */
    891 static DECLCALLBACK(int) drvTAPConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfgHandle)
     884 * @copydoc FNPDMDRVCONSTRUCT
     885 */
     886static DECLCALLBACK(int) drvTAPConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfgHandle, uint32_t fFlags)
    892887{
    893888    PDRVTAP pThis = PDMINS_2_DATA(pDrvIns, PDRVTAP);
     
    926921     * Check that no-one is attached to us.
    927922     */
    928     int rc = pDrvIns->pDrvHlp->pfnAttach(pDrvIns, NULL);
    929     if (rc != VERR_PDM_NO_ATTACHED_DRIVER)
    930         return PDMDRV_SET_ERROR(pDrvIns, VERR_PDM_DRVINS_NO_ATTACH,
    931                                 N_("Configuration error: Cannot attach drivers to the TAP driver"));
     923    AssertMsgReturn(PDMDrvHlpNoAttach(pDrvIns) == VERR_PDM_NO_ATTACHED_DRIVER,
     924                    ("Configuration error: Not possible to attach anything to this driver!\n"),
     925                    VERR_PDM_DRVINS_NO_ATTACH);
    932926
    933927    /*
     
    942936     * Read the configuration.
    943937     */
     938    int rc;
    944939#if defined(RT_OS_SOLARIS)   /** @todo Other platforms' TAP code should be moved here from ConsoleImpl & VBoxBFE. */
    945940    rc = CFGMR3QueryStringAlloc(pCfgHandle, "TAPSetupApplication", &pThis->pszSetupApplication);
     
    10961091    /* pfnResume */
    10971092    NULL,
     1093    /* pfnAttach */
     1094    NULL,
    10981095    /* pfnDetach */
     1096    NULL,
     1097    /* pfnPowerOff */
     1098    NULL,
     1099    /* pfnSoftReset */
    10991100    NULL,
    1100     /* pfnPowerOff */
    1101     NULL
     1101    /* u32EndVersion */
     1102    PDM_DRVREG_VERSION
    11021103};
     1104
  • trunk/src/VBox/Devices/PC/DrvACPI.cpp

    r19967 r22277  
    724724 * Construct an ACPI driver instance.
    725725 *
    726  * @returns VBox status.
    727  * @param   pDrvIns     The driver instance data.
    728  *                      If the registration structure is needed, pDrvIns->pDrvReg points to it.
    729  * @param   pCfgHandle  Configuration node handle for the driver. Use this to obtain the configuration
    730  *                      of the driver instance. It's also found in pDrvIns->pCfgHandle, but like
    731  *                      iInstance it's expected to be used a bit in this function.
     726 * @copydoc FNPDMDRVCONSTRUCT
    732727 */
    733 static DECLCALLBACK(int) drvACPIConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfgHandle)
     728static DECLCALLBACK(int) drvACPIConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfgHandle, uint32_t fFlags)
    734729{
    735730    PDRVACPI pThis = PDMINS_2_DATA(pDrvIns, PDRVACPI);
     
    754749     * Check that no-one is attached to us.
    755750     */
    756     int rc = pDrvIns->pDrvHlp->pfnAttach(pDrvIns, NULL);
    757     if (rc != VERR_PDM_NO_ATTACHED_DRIVER)
    758     {
    759         AssertMsgFailed(("Configuration error: Cannot attach drivers to the ACPI driver!\n"));
    760         return VERR_PDM_DRVINS_NO_ATTACH;
    761     }
     751    AssertMsgReturn(PDMDrvHlpNoAttach(pDrvIns) == VERR_PDM_NO_ATTACHED_DRIVER,
     752                    ("Configuration error: Not possible to attach anything to this driver!\n"),
     753                    VERR_PDM_DRVINS_NO_ATTACH);
    762754
    763755    /*
     
    768760    if (!pThis->pPort)
    769761    {
    770         AssertMsgFailed(("Configuration error: "
    771                          "the above device/driver didn't export the ACPI port interface!\n"));
     762        AssertMsgFailed(("Configuration error: the above device/driver didn't export the ACPI port interface!\n"));
    772763        return VERR_PDM_MISSING_INTERFACE_ABOVE;
    773764    }
     
    810801    /* pfnResume */
    811802    NULL,
     803    /* pfnAttach */
     804    NULL,
    812805    /* pfnDetach */
     806    NULL,
     807    /* pfnPowerOff */
     808    NULL,
     809    /* pfnSoftReset */
    813810    NULL,
    814     /* pfnPowerOff */
    815     NULL
     811    /* u32EndVersion */
     812    PDM_DRVREG_VERSION
    816813};
    817814
  • trunk/src/VBox/Devices/Parallel/DrvHostParallel.cpp

    r20961 r22277  
    260260/**
    261261 * Construct a host parallel driver instance.
    262  *
    263  * @returns VBox status.
    264  * @param   pDrvIns     The driver instance data.
    265  *                      If the registration structure is needed,
    266  *                      pDrvIns->pDrvReg points to it.
    267  * @param   pCfgHandle  Configuration node handle for the driver. Use this to
    268  *                      obtain the configuration of the driver instance. It's
    269  *                      also found in pDrvIns->pCfgHandle as it's expected to
    270  *                      be used frequently in this function.
    271  */
    272 static DECLCALLBACK(int) drvHostParallelConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfgHandle)
     262 * 
     263 * @copydoc FNPDMDRVCONSTRUCT
     264 */
     265static DECLCALLBACK(int) drvHostParallelConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfgHandle, uint32_t fFlags)
    273266{
    274267    PDRVHOSTPARALLEL pThis = PDMINS_2_DATA(pDrvIns, PDRVHOSTPARALLEL);
     
    437430    /* pfnResume */
    438431    NULL,
     432    /* pfnAttach */
     433    NULL,
    439434    /* pfnDetach */
    440     NULL,
    441     /** pfnPowerOff */
    442     NULL
     435    NULL,
     436    /* pfnPowerOff */
     437    NULL,
     438    /* pfnSoftReset */
     439    NULL,
     440    /* u32EndVersion */
     441    PDM_DRVREG_VERSION
    443442};
    444443
  • trunk/src/VBox/Devices/Serial/DrvChar.cpp

    r19624 r22277  
    288288/**
    289289 * Construct a char driver instance.
    290  *
    291  * @returns VBox status.
    292  * @param   pDrvIns     The driver instance data.
    293  *                      If the registration structure is needed,
    294  *                      pDrvIns->pDrvReg points to it.
    295  * @param   pCfgHandle  Configuration node handle for the driver. Use this to
    296  *                      obtain the configuration of the driver instance. It's
    297  *                      also found in pDrvIns->pCfgHandle as it's expected to
    298  *                      be used frequently in this function.
    299  */
    300 static DECLCALLBACK(int) drvCharConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfgHandle)
     290 * 
     291 * @copydoc FNPDMDRVCONSTRUCT
     292 */
     293static DECLCALLBACK(int) drvCharConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfgHandle, uint32_t fFlags)
    301294{
    302295    PDRVCHAR pThis = PDMINS_2_DATA(pDrvIns, PDRVCHAR);
     
    326319     */
    327320    PPDMIBASE pBase;
    328     int rc = pDrvIns->pDrvHlp->pfnAttach(pDrvIns, &pBase);
     321    int rc = PDMDrvHlpAttach(pDrvIns, fFlags, &pBase);
    329322    if (RT_FAILURE(rc))
    330323        return rc; /* Don't call PDMDrvHlpVMSetError here as we assume that the driver already set an appropriate error */
     
    428421    /* pfnResume */
    429422    NULL,
     423    /* pfnAttach */
     424    NULL,
    430425    /* pfnDetach */
    431     NULL,
    432     /** pfnPowerOff */
    433     NULL
     426    NULL,
     427    /* pfnPowerOff */
     428    NULL,
     429    /* pfnSoftReset */
     430    NULL,
     431    /* u32EndVersion */
     432    PDM_DRVREG_VERSION
    434433};
    435434
  • trunk/src/VBox/Devices/Serial/DrvHostSerial.cpp

    r22072 r22277  
    11781178/**
    11791179 * Construct a char driver instance.
    1180  *
    1181  * @returns VBox status.
    1182  * @param   pDrvIns     The driver instance data.
    1183  *                      If the registration structure is needed,
    1184  *                      pDrvIns->pDrvReg points to it.
    1185  * @param   pCfgHandle  Configuration node handle for the driver. Use this to
    1186  *                      obtain the configuration of the driver instance. It's
    1187  *                      also found in pDrvIns->pCfgHandle as it's expected to
    1188  *                      be used frequently in this function.
     1180 * 
     1181 * @copydoc FNPDMDRVCONSTRUCT
    11891182 */
    1190 static DECLCALLBACK(int) drvHostSerialConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfgHandle)
     1183static DECLCALLBACK(int) drvHostSerialConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfgHandle, uint32_t fFlags)
    11911184{
    11921185    PDRVHOSTSERIAL pThis = PDMINS_2_DATA(pDrvIns, PDRVHOSTSERIAL);
     
    14651458    /* pfnResume */
    14661459    NULL,
     1460    /* pfnAttach */
     1461    NULL,
    14671462    /* pfnDetach */
     1463    NULL,
     1464    /* pfnPowerOff */
     1465    NULL,
     1466    /* pfnSoftReset */
    14681467    NULL,
    1469     /** pfnPowerOff */
    1470     NULL
     1468    /* u32EndVersion */
     1469    PDM_DRVREG_VERSION
    14711470};
    14721471
  • trunk/src/VBox/Devices/Serial/DrvNamedPipe.cpp

    r18443 r22277  
    396396 * Construct a named pipe stream driver instance.
    397397 *
    398  * @returns VBox status.
    399  * @param   pDrvIns     The driver instance data.
    400  *                      If the registration structure is needed, pDrvIns->pDrvReg points to it.
    401  * @param   pCfgHandle  Configuration node handle for the driver. Use this to obtain the configuration
    402  *                      of the driver instance. It's also found in pDrvIns->pCfgHandle, but like
    403  *                      iInstance it's expected to be used a bit in this function.
    404  */
    405 static DECLCALLBACK(int) drvNamedPipeConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfgHandle)
     398 * @copydoc FNPDMDRVCONSTRUCT
     399 */
     400static DECLCALLBACK(int) drvNamedPipeConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfgHandle, uint32_t fFlags)
    406401{
    407402    int rc;
     
    646641    /* pfnResume */
    647642    NULL,
     643    /* pfnAttach */
     644    NULL,
    648645    /* pfnDetach */
    649646    NULL,
    650647    /* pfnPowerOff */
    651648    drvNamedPipePowerOff,
     649    /* pfnSoftReset */
     650    NULL,
     651    /* u32EndVersion */
     652    PDM_DRVREG_VERSION
    652653};
     654
  • trunk/src/VBox/Devices/Serial/DrvRawFile.cpp

    r19626 r22277  
    1 /** @file
    2  *
    3  * VBox stream devices:
    4  * Raw file output
     1/* $Id$ */
     2/** @file
     3 * VBox stream drivers - Raw file output.
    54 */
    65
     
    2524*   Header Files                                                               *
    2625*******************************************************************************/
    27 #define LOG_GROUP LOG_GROUP_DRV_NAMEDPIPE
     26#define LOG_GROUP LOG_GROUP_DEFAULT
    2827#include <VBox/pdmdrv.h>
    2928#include <iprt/assert.h>
     
    6059    PPDMDRVINS          pDrvIns;
    6160    /** Pointer to the file name. (Freed by MM) */
    62     char                *pszLocation;
     61    char               *pszLocation;
    6362    /** Flag whether VirtualBox represents the server or client side. */
    6463    RTFILE              OutputFile;
     
    121120 * Construct a raw output stream driver instance.
    122121 *
    123  * @returns VBox status.
    124  * @param   pDrvIns     The driver instance data.
    125  *                      If the registration structure is needed, pDrvIns->pDrvReg points to it.
    126  * @param   pCfgHandle  Configuration node handle for the driver. Use this to obtain the configuration
    127  *                      of the driver instance. It's also found in pDrvIns->pCfgHandle, but like
    128  *                      iInstance it's expected to be used a bit in this function.
    129  */
    130 static DECLCALLBACK(int) drvRawFileConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfgHandle)
    131 {
    132     int rc;
    133     char *pszLocation = NULL;
     122 * @copydoc FNPDMDRVCONSTRUCT
     123 */
     124static DECLCALLBACK(int) drvRawFileConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfgHandle, uint32_t fFlags)
     125{
    134126    PDRVRAWFILE pThis = PDMINS_2_DATA(pDrvIns, PDRVRAWFILE);
    135127
     
    149141     */
    150142    if (!CFGMR3AreValuesValid(pCfgHandle, "Location\0"))
    151     {
    152         rc = VERR_PDM_DRVINS_UNKNOWN_CFG_VALUES;
    153         goto out;
    154     }
    155 
    156     rc = CFGMR3QueryStringAlloc(pCfgHandle, "Location", &pszLocation);
     143        AssertFailedReturn(VERR_PDM_DRVINS_UNKNOWN_CFG_VALUES);
     144
     145    int rc = CFGMR3QueryStringAlloc(pCfgHandle, "Location", &pThis->pszLocation);
     146    if (RT_FAILURE(rc))
     147        AssertMsgFailedReturn(("Configuration error: query \"Location\" resulted in %Rrc.\n", rc), rc);
     148
     149    /*
     150     * Open the raw file.
     151     */
     152    rc = RTFileOpen(&pThis->OutputFile, pThis->pszLocation, RTFILE_O_CREATE_REPLACE | RTFILE_O_WRITE | RTFILE_O_DENY_NONE);
    157153    if (RT_FAILURE(rc))
    158154    {
    159         AssertMsgFailed(("Configuration error: query \"Location\" resulted in %Rrc.\n", rc));
    160         goto out;
    161     }
    162     pThis->pszLocation = pszLocation;
    163 
    164     rc = RTFileOpen(&pThis->OutputFile, pThis->pszLocation, RTFILE_O_WRITE | RTFILE_O_CREATE_REPLACE);
    165     if (RT_FAILURE(rc))
    166     {
    167         LogRel(("RawFile%d: CreateFile failed rc=%Rrc\n", pThis->pDrvIns->iInstance));
    168         return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS, N_("RawFile#%d failed to create the raw output file %s"), pDrvIns->iInstance, pszLocation);
    169     }
    170 
    171 out:
    172     if (RT_FAILURE(rc))
    173     {
    174         if (pszLocation)
    175             MMR3HeapFree(pszLocation);
    176         return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS, N_("RawFile#%d failed to initialize"), pDrvIns->iInstance);
    177     }
    178 
    179     LogFlow(("drvRawFileConstruct: location %s\n", pszLocation));
    180     LogRel(("RawFile: location %s\n", pszLocation));
     155        LogRel(("RawFile%d: CreateFile failed rc=%Rrc\n", pDrvIns->iInstance));
     156        return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS, N_("RawFile#%d failed to create the raw output file %s"), pDrvIns->iInstance, pThis->pszLocation);
     157    }
     158
     159    LogFlow(("drvRawFileConstruct: location %s\n", pThis->pszLocation));
     160    LogRel(("RawFile#%u: location %s\n", pDrvIns->iInstance, pThis->pszLocation));
    181161    return VINF_SUCCESS;
    182162}
     
    198178    if (pThis->pszLocation)
    199179        MMR3HeapFree(pThis->pszLocation);
     180
     181    if (pThis->OutputFile != NIL_RTFILE)
     182    {   
     183        RTFileClose(pThis->OutputFile);
     184        pThis->OutputFile = NIL_RTFILE;
     185    }
    200186}
    201187
     
    214200
    215201    if (pThis->OutputFile != NIL_RTFILE)
     202    {   
    216203        RTFileClose(pThis->OutputFile);
     204        pThis->OutputFile = NIL_RTFILE;
     205    }
    217206}
    218207
     
    251240    /* pfnResume */
    252241    NULL,
     242    /* pfnAttach */
     243    NULL,
    253244    /* pfnDetach */
    254245    NULL,
    255246    /* pfnPowerOff */
    256247    drvRawFilePowerOff,
     248    /* pfnSoftReset */
     249    NULL,
     250    /* u32EndVersion */
     251    PDM_DRVREG_VERSION
    257252};
     253
  • trunk/src/VBox/Devices/Storage/DevATA.cpp

    r21188 r22277  
    57155715    unsigned        iInterface;
    57165716
    5717     AssertMsg(fFlags & PDMDEVATT_FLAGS_NOT_HOT_PLUG,
     5717    AssertMsg(fFlags & PDM_TACH_FLAGS_NOT_HOT_PLUG,
    57185718              ("PIIX3IDE: Device does not support hotplugging\n"));
    57195719
     
    58935893    unsigned        iInterface;
    58945894
    5895     AssertMsgReturn(fFlags & PDMDEVATT_FLAGS_NOT_HOT_PLUG,
     5895    AssertMsgReturn(fFlags & PDM_TACH_FLAGS_NOT_HOT_PLUG,
    58965896                    ("PIIX3IDE: Device does not support hotplugging\n"),
    58975897                    VERR_INVALID_PARAMETER);
  • trunk/src/VBox/Devices/Storage/DevBusLogic.cpp

    r21363 r22277  
    25472547    Log(("%s:\n", __FUNCTION__));
    25482548
    2549     AssertMsg(fFlags & PDMDEVATT_FLAGS_NOT_HOT_PLUG,
     2549    AssertMsg(fFlags & PDM_TACH_FLAGS_NOT_HOT_PLUG,
    25502550              ("BusLogic: Device does not support hotplugging\n"));
    25512551
     
    25742574    int rc;
    25752575
    2576     AssertMsgReturn(fFlags & PDMDEVATT_FLAGS_NOT_HOT_PLUG,
     2576    AssertMsgReturn(fFlags & PDM_TACH_FLAGS_NOT_HOT_PLUG,
    25772577                    ("BusLogic: Device does not support hotplugging\n"),
    25782578                    VERR_INVALID_PARAMETER);
  • trunk/src/VBox/Devices/Storage/DevLsiLogicSCSI.cpp

    r21363 r22277  
    50835083    PLSILOGICDEVICE pDevice = &pThis->aDeviceStates[iLUN];
    50845084
    5085     AssertMsg(fFlags & PDMDEVATT_FLAGS_NOT_HOT_PLUG,
     5085    AssertMsg(fFlags & PDM_TACH_FLAGS_NOT_HOT_PLUG,
    50865086              ("LsiLogic: Device does not support hotplugging\n"));
    50875087
     
    51115111    int rc;
    51125112
    5113     AssertMsgReturn(fFlags & PDMDEVATT_FLAGS_NOT_HOT_PLUG,
     5113    AssertMsgReturn(fFlags & PDM_TACH_FLAGS_NOT_HOT_PLUG,
    51145114                    ("LsiLogic: Device does not support hotplugging\n"),
    51155115                    VERR_INVALID_PARAMETER);
  • trunk/src/VBox/Devices/Storage/DrvBlock.cpp

    r18498 r22277  
    515515     * Attach the media driver and query it's interface.
    516516     */
     517    uint32_t fTachFlags = 0; /** @todo figure attachment flags for mount. */
    517518    PPDMIBASE pBase;
    518     int rc = pThis->pDrvIns->pDrvHlp->pfnAttach(pThis->pDrvIns, &pBase);
     519    int rc = PDMDrvHlpAttach(pThis->pDrvIns, fTachFlags, &pBase);
    519520    if (RT_FAILURE(rc))
    520521    {
     
    555556     */
    556557    AssertMsgFailed(("No media interface!\n"));
    557     int rc2 = pThis->pDrvIns->pDrvHlp->pfnDetach(pThis->pDrvIns);
     558    int rc2 = pThis->pDrvIns->pDrvHlp->pfnDetach(pThis->pDrvIns, fTachFlags);
    558559    AssertRC(rc2);
    559560    pThis->pDrvMedia = NULL;
     
    587588     * Detach the media driver and query it's interface.
    588589     */
    589     int rc = pThis->pDrvIns->pDrvHlp->pfnDetach(pThis->pDrvIns);
     590    int rc = pThis->pDrvIns->pDrvHlp->pfnDetach(pThis->pDrvIns, 0 /*fFlags*/);
    590591    if (RT_FAILURE(rc))
    591592    {
     
    668669
    669670/** @copydoc FNPDMDRVDETACH. */
    670 static DECLCALLBACK(void)  drvblockDetach(PPDMDRVINS pDrvIns)
     671static DECLCALLBACK(void)  drvblockDetach(PPDMDRVINS pDrvIns, uint32_t fFlags)
    671672{
    672673    PDRVBLOCK pThis = PDMINS_2_DATA(pDrvIns, PDRVBLOCK);
    673674    pThis->pDrvMedia = NULL;
    674675    pThis->pDrvMediaAsync = NULL;
     676    NOREF(fFlags);
    675677}
    676678
     
    691693 * Construct a block driver instance.
    692694 *
    693  * @returns VBox status.
    694  * @param   pDrvIns     The driver instance data.
    695  *                      If the registration structure is needed, pDrvIns->pDrvReg points to it.
    696  * @param   pCfgHandle  Configuration node handle for the driver. Use this to obtain the configuration
    697  *                      of the driver instance. It's also found in pDrvIns->pCfgHandle, but like
    698  *                      iInstance it's expected to be used a bit in this function.
     695 * @copydoc FNPDMDRVCONSTRUCT
    699696 */
    700 static DECLCALLBACK(int) drvblockConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfgHandle)
     697static DECLCALLBACK(int) drvblockConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfgHandle, uint32_t fFlags)
    701698{
    702699    PDRVBLOCK pThis = PDMINS_2_DATA(pDrvIns, PDRVBLOCK);
     
    867864     */
    868865    PPDMIBASE pBase;
    869     rc = pDrvIns->pDrvHlp->pfnAttach(pDrvIns, &pBase);
     866    rc = PDMDrvHlpAttach(pDrvIns, fFlags, &pBase);
    870867    if (    rc == VERR_PDM_NO_ATTACHED_DRIVER
    871868        &&  pThis->enmType != PDMBLOCKTYPE_HARD_DISK)
     
    926923    /* pfnResume */
    927924    NULL,
     925    /* pfnAttach */
     926    NULL,
    928927    /* pfnDetach */
    929     drvblockDetach
     928    drvblockDetach,
     929    /* pfnPowerOff */
     930    NULL,
     931    /* pfnSoftReset */
     932    NULL,
     933    /* u32EndVersion */
     934    PDM_DRVREG_VERSION
    930935};
     936
  • trunk/src/VBox/Devices/Storage/DrvHostBase.cpp

    r21691 r22277  
    20452045     * Check that there are no drivers below us.
    20462046     */
    2047     PPDMIBASE pBase;
    2048     int rc = pDrvIns->pDrvHlp->pfnAttach(pDrvIns, &pBase);
    2049     if (rc != VERR_PDM_NO_ATTACHED_DRIVER)
    2050     {
    2051         AssertMsgFailed(("Configuration error: No attached driver, please! (rc=%Rrc)\n", rc));
    2052         return VERR_PDM_DRVINS_NO_ATTACH;
    2053     }
     2047    AssertMsgReturn(PDMDrvHlpNoAttach(pDrvIns) == VERR_PDM_NO_ATTACHED_DRIVER,
     2048                    ("Configuration error: Not possible to attach anything to this driver!\n"),
     2049                    VERR_PDM_DRVINS_NO_ATTACH);
    20542050
    20552051    /*
    20562052     * Register saved state.
    20572053     */
    2058     rc = pDrvIns->pDrvHlp->pfnSSMRegister(pDrvIns, pDrvIns->pDrvReg->szDriverName, pDrvIns->iInstance, 1, 0,
    2059                                           NULL, NULL, NULL,
    2060                                           NULL, NULL, drvHostBaseLoadDone);
     2054    int rc = pDrvIns->pDrvHlp->pfnSSMRegister(pDrvIns, pDrvIns->pDrvReg->szDriverName, pDrvIns->iInstance, 1, 0,
     2055                                              NULL, NULL, NULL,
     2056                                              NULL, NULL, drvHostBaseLoadDone);
    20612057    if (RT_FAILURE(rc))
    20622058        return rc;
  • trunk/src/VBox/Devices/Storage/DrvHostDVD.cpp

    r19968 r22277  
    741741 * Construct a host dvd drive driver instance.
    742742 *
    743  * @returns VBox status.
    744  * @param   pDrvIns     The driver instance data.
    745  *                      If the registration structure is needed, pDrvIns->pDrvReg points to it.
    746  * @param   pCfgHandle  Configuration node handle for the driver. Use this to obtain the configuration
    747  *                      of the driver instance. It's also found in pDrvIns->pCfgHandle, but like
    748  *                      iInstance it's expected to be used a bit in this function.
    749  */
    750 static DECLCALLBACK(int) drvHostDvdConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfgHandle)
     743 * @copydoc FNPDMDRVCONSTRUCT
     744 */
     745static DECLCALLBACK(int) drvHostDvdConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfgHandle, uint32_t fFlags)
    751746{
    752747    PDRVHOSTBASE pThis = PDMINS_2_DATA(pDrvIns, PDRVHOSTBASE);
     
    862857    /* pfnResume */
    863858    NULL,
     859    /* pfnAttach */
     860    NULL,
    864861    /* pfnDetach */
    865     NULL
     862    NULL,
     863    /* pfnPowerOff */
     864    NULL,
     865    /* pfnSoftReset */
     866    NULL,
     867    /* u32EndVersion */
     868    PDM_DRVREG_VERSION
    866869};
    867870
  • trunk/src/VBox/Devices/Storage/DrvHostFloppy.cpp

    r11284 r22277  
    147147 * @copydoc FNPDMDRVCONSTRUCT
    148148 */
    149 static DECLCALLBACK(int) drvHostFloppyConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfgHandle)
     149static DECLCALLBACK(int) drvHostFloppyConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfgHandle, uint32_t fFlags)
    150150{
    151151    PDRVHOSTFLOPPY pThis = PDMINS_2_DATA(pDrvIns, PDRVHOSTFLOPPY);
     
    228228    /* pfnResume */
    229229    NULL,
     230    /* pfnAttach */
     231    NULL,
    230232    /* pfnDetach */
    231     NULL
     233    NULL,
     234    /* pfnPowerOff */
     235    NULL,
     236    /* pfnSoftReset */
     237    NULL,
     238    /* u32EndVersion */
     239    PDM_DRVREG_VERSION
    232240};
    233241
  • trunk/src/VBox/Devices/Storage/DrvMediaISO.cpp

    r13840 r22277  
    9090 * Construct a ISO media driver instance.
    9191 *
    92  * @returns VBox status.
    93  * @param   pDrvIns     The driver instance data.
    94  *                      If the registration structure is needed, pDrvIns->pDrvReg points to it.
    95  * @param   pCfgHandle  Configuration node handle for the driver. Use this to obtain the configuration
    96  *                      of the driver instance. It's also found in pDrvIns->pCfgHandle, but like
    97  *                      iInstance it's expected to be used a bit in this function.
    98  */
    99 static DECLCALLBACK(int) drvMediaISOConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfgHandle)
     92 * @copydoc FNPDMDRVCONSTRUCT
     93 */
     94static DECLCALLBACK(int) drvMediaISOConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfgHandle, uint32_t fFlags)
    10095{
    10196    PDRVMEDIAISO pThis = PDMINS_2_DATA(pDrvIns, PDRVMEDIAISO);
     
    348343    /* pfnResume */
    349344    NULL,
     345    /* pfnAttach */
     346    NULL,
    350347    /* pfnDetach */
    351     NULL,
     348    NULL, 
    352349    /* pfnPowerOff */
    353     NULL
     350    NULL,
     351    /* pfnSoftReset */
     352    NULL,
     353    /* u32EndVersion */
     354    PDM_DRVREG_VERSION
    354355};
     356
  • trunk/src/VBox/Devices/Storage/DrvRawImage.cpp

    r13840 r22277  
    9292/**
    9393 * Construct a raw image driver instance.
    94  *
    95  * @returns VBox status.
    96  * @param   pDrvIns     The driver instance data.
    97  *                      If the registration structure is needed, pDrvIns->pDrvReg points to it.
    98  * @param   pCfgHandle  Configuration node handle for the driver. Use this to obtain the configuration
    99  *                      of the driver instance. It's also found in pDrvIns->pCfgHandle, but like
    100  *                      iInstance it's expected to be used a bit in this function.
    101  */
    102 static DECLCALLBACK(int) drvRawImageConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfgHandle)
     94 * 
     95 * @copydoc FNPDMDRVCONSTRUCT
     96 */
     97static DECLCALLBACK(int) drvRawImageConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfgHandle, uint32_t fFlags)
    10398{
    10499    PDRVRAWIMAGE pThis = PDMINS_2_DATA(pDrvIns, PDRVRAWIMAGE);
     
    398393    /* pfnResume */
    399394    NULL,
     395    /* pfnAttach */
     396    NULL,
    400397    /* pfnDetach */
    401     NULL,
     398    NULL, 
    402399    /* pfnPowerOff */
    403     NULL
     400    NULL,
     401    /* pfnSoftReset */
     402    NULL,
     403    /* u32EndVersion */
     404    PDM_DRVREG_VERSION
    404405};
  • trunk/src/VBox/Devices/Storage/DrvSCSI.cpp

    r21321 r22277  
    753753 * Construct a block driver instance.
    754754 *
    755  * @returns VBox status.
    756  * @param   pDrvIns     The driver instance data.
    757  *                      If the registration structure is needed, pDrvIns->pDrvReg points to it.
    758  * @param   pCfgHandle  Configuration node handle for the driver. Use this to obtain the configuration
    759  *                      of the driver instance. It's also found in pDrvIns->pCfgHandle, but like
    760  *                      iInstance it's expected to be used a bit in this function.
    761  */
    762 static DECLCALLBACK(int) drvscsiConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfgHandle)
    763 {
    764     int rc = VINF_SUCCESS;
    765     PDMBLOCKTYPE enmType;
     755 * @copydoc FNPDMDRVCONSTRUCT
     756 */
     757static DECLCALLBACK(int) drvscsiConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfgHandle, uint32_t fFlags)
     758{
    766759    PDRVSCSI pThis = PDMINS_2_DATA(pDrvIns, PDRVSCSI);
    767760
     
    777770     * Try attach driver below and query it's block interface.
    778771     */
    779     rc = pDrvIns->pDrvHlp->pfnAttach(pDrvIns, &pThis->pDrvBase);
     772    int rc = PDMDrvHlpAttach(pDrvIns, fFlags, &pThis->pDrvBase);
    780773    AssertMsgReturn(RT_SUCCESS(rc), ("Attaching driver below failed rc=%Rrc\n", rc), rc);
    781774
     
    817810    pThis->pDrvBlockAsync = (PDMIBLOCKASYNC *)pThis->pDrvBase->pfnQueryInterface(pThis->pDrvBase, PDMINTERFACE_BLOCK_ASYNC);
    818811
    819     enmType = pThis->pDrvBlock->pfnGetType(pThis->pDrvBlock);
     812    PDMBLOCKTYPE enmType = pThis->pDrvBlock->pfnGetType(pThis->pDrvBlock);
    820813    if (enmType != PDMBLOCKTYPE_HARD_DISK)
    821814    {
     
    877870    /* pfnResume */
    878871    NULL,
     872    /* pfnAttach */
     873    NULL,
    879874    /* pfnDetach */
     875    NULL,
     876    /* pfnPowerOff */
     877    NULL,
     878    /* pfnSoftReset */
    880879    NULL,
    881     /* pfnPowerOff */
    882     NULL
     880    /* u32EndVersion */
     881    PDM_DRVREG_VERSION
    883882};
  • trunk/src/VBox/Devices/Storage/DrvSCSIHost.cpp

    r21321 r22277  
    441441 * Construct a block driver instance.
    442442 *
    443  * @returns VBox status.
    444  * @param   pDrvIns     The driver instance data.
    445  *                      If the registration structure is needed, pDrvIns->pDrvReg points to it.
    446  * @param   pCfgHandle  Configuration node handle for the driver. Use this to obtain the configuration
    447  *                      of the driver instance. It's also found in pDrvIns->pCfgHandle, but like
    448  *                      iInstance it's expected to be used a bit in this function.
    449  */
    450 static DECLCALLBACK(int) drvscsihostConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfgHandle)
    451 {
    452     int rc = VINF_SUCCESS;
     443 * @copydoc FNPDMDRVCONSTRUCT
     444 */
     445static DECLCALLBACK(int) drvscsihostConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfgHandle, uint32_t fFlags)
     446{
    453447    PDRVSCSIHOST pThis = PDMINS_2_DATA(pDrvIns, PDRVSCSIHOST);
    454448
     
    475469
    476470    /* Create request queue. */
    477     rc = RTReqCreateQueue(&pThis->pQueueRequests);
     471    int rc = RTReqCreateQueue(&pThis->pQueueRequests);
    478472    AssertMsgReturn(RT_SUCCESS(rc), ("Failed to create request queue rc=%Rrc\n"), rc);
    479473
     
    528522    /* pfnSuspend */
    529523    NULL,
    530     /* pfnResume */
     524    /* pfnAttach */
    531525    NULL,
    532526    /* pfnDetach */
    533     NULL
     527    NULL,
     528    /* pfnPowerOff */
     529    NULL,
     530    /* pfnSoftReset */
     531    NULL,
     532    /* u32EndVersion */
     533    PDM_DRVREG_VERSION
    534534};
  • trunk/src/VBox/Devices/Storage/DrvVD.cpp

    r21806 r22277  
    789789 * Construct a VBox disk media driver instance.
    790790 *
    791  * @returns VBox status.
    792  * @param   pDrvIns     The driver instance data.
    793  *                      If the registration structure is needed, pDrvIns->pDrvReg points to it.
    794  * @param   pCfgHandle  Configuration node handle for the driver. Use this to obtain the configuration
    795  *                      of the driver instance. It's also found in pDrvIns->pCfgHandle as it's expected
    796  *                      to be used frequently in this function.
     791 * @copydoc FNPDMDRVCONSTRUCT
    797792 */
    798793static DECLCALLBACK(int) drvvdConstruct(PPDMDRVINS pDrvIns,
    799                                         PCFGMNODE pCfgHandle)
     794                                        PCFGMNODE pCfgHandle,
     795                                        uint32_t fFlags)
    800796{
    801797    LogFlow(("%s:\n", __FUNCTION__));
     
    885881        PPDMIBASE pBase;
    886882
    887         rc = pDrvIns->pDrvHlp->pfnAttach(pDrvIns, &pBase);
     883        rc = PDMDrvHlpAttach(pDrvIns, fFlags, &pBase);
    888884        if (rc == VERR_PDM_NO_ATTACHED_DRIVER)
    889885        {
     
    13081304    /* pfnResume */
    13091305    drvvdResume,
     1306    /* pfnAttach */
     1307    NULL,
    13101308    /* pfnDetach */
    13111309    NULL,
    13121310    /* pfnPowerOff */
    1313     drvvdPowerOff
     1311    drvvdPowerOff,
     1312    /* pfnSoftReset */
     1313    NULL,
     1314    /* u32EndVersion */
     1315    PDM_DRVREG_VERSION
    13141316};
     1317
  • trunk/src/VBox/Devices/Storage/ISCSIHDDCore.cpp

    r22258 r22277  
    12491249    ISCSIREQ aISCSIReq[4];
    12501250    uint32_t aReqBHS[12];
    1251     LogFlow(("drvISCSIDetach: entering\n"));
     1251    LogFlow(("iscsiDetach: entering\n"));
    12521252
    12531253    RTSemMutexRequest(pImage->Mutex, RT_INDEFINITE_WAIT);
     
    13171317    RTSemMutexRelease(pImage->Mutex);
    13181318
    1319     LogFlow(("drvISCSIDetach: leaving\n"));
     1319    LogFlow(("iscsiDetach: leaving\n"));
    13201320    LogRel(("iSCSI: logout to target %s\n", pImage->pszTargetName));
    13211321    return VINF_SUCCESS;
  • trunk/src/VBox/Devices/Storage/fdc.c

    r21328 r22277  
    26652665    LogFlow (("ideDetach: iLUN=%u\n", iLUN));
    26662666
    2667     AssertMsgReturn(fFlags & PDMDEVATT_FLAGS_NOT_HOT_PLUG,
     2667    AssertMsgReturn(fFlags & PDM_TACH_FLAGS_NOT_HOT_PLUG,
    26682668                    ("The FDC device does not support hotplugging\n"),
    26692669                    VERR_INVALID_PARAMETER);
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette