VirtualBox

Changeset 88306 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Mar 26, 2021 9:17:46 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
143523
Message:

VMM/PDMDevHlp: Added pfnSTAMDeregisterByPrefix. bugref:9890

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/PDMDevHlp.cpp

    r88290 r88306  
    12981298    }
    12991299    AssertRC(rc);
     1300}
     1301
     1302
     1303/**
     1304 * @interface_method_impl{PDMDEVHLPR3,pfnSTAMDeregisterByPrefix}
     1305 */
     1306static DECLCALLBACK(int) pdmR3DevHlp_STAMDeregisterByPrefix(PPDMDEVINS pDevIns, const char *pszPrefix)
     1307{
     1308    PDMDEV_ASSERT_DEVINS(pDevIns);
     1309    PVM pVM = pDevIns->Internal.s.pVMR3;
     1310    VM_ASSERT_EMT(pVM);
     1311
     1312    int rc;
     1313    if (*pszPrefix == '/')
     1314        rc = STAMR3DeregisterByPrefix(pVM->pUVM, pszPrefix);
     1315    else
     1316    {
     1317        char    szQualifiedPrefix[1024];
     1318        ssize_t cch;
     1319        if (pDevIns->pReg->cMaxInstances == 1)
     1320            cch = RTStrPrintf2(szQualifiedPrefix, sizeof(szQualifiedPrefix), "/Devices/%s/%s", pDevIns->pReg->szName, pszPrefix);
     1321        else
     1322            cch = RTStrPrintf2(szQualifiedPrefix, sizeof(szQualifiedPrefix), "/Devices/%s#%u/%s",
     1323                               pDevIns->pReg->szName, pDevIns->iInstance, pszPrefix);
     1324        AssertReturn(cch > 0, VERR_OUT_OF_RANGE);
     1325        rc = STAMR3DeregisterByPrefix(pVM->pUVM, szQualifiedPrefix);
     1326    }
     1327    AssertRC(rc);
     1328    return rc;
    13001329}
    13011330
     
    44114440    pdmR3DevHlp_CpuGetGuestMicroarch,
    44124441    pdmR3DevHlp_CpuGetGuestAddrWidths,
    4413     0,
     4442    pdmR3DevHlp_STAMDeregisterByPrefix,
    44144443    0,
    44154444    0,
     
    47594788    pdmR3DevHlp_CpuGetGuestMicroarch,
    47604789    pdmR3DevHlp_CpuGetGuestAddrWidths,
    4761     0,
     4790    pdmR3DevHlp_STAMDeregisterByPrefix,
    47624791    0,
    47634792    0,
     
    52645293    pdmR3DevHlp_CpuGetGuestMicroarch,
    52655294    pdmR3DevHlp_CpuGetGuestAddrWidths,
    5266     0,
     5295    pdmR3DevHlp_STAMDeregisterByPrefix,
    52675296    0,
    52685297    0,
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