VirtualBox

Changeset 93855 in vbox for trunk/src/VBox/Main/src-client


Ignore:
Timestamp:
Feb 19, 2022 3:49:11 PM (3 years ago)
Author:
vboxsync
Message:

Main/Console: remove statements that write pointers for led set, console, and medium attachments from the console subsystem, completing more, but not all remaining similar pointer removal requested in bugref:10053

Location:
trunk/src/VBox/Main/src-client
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/ConsoleImpl.cpp

    r93561 r93855  
    1087910879
    1088010880/**
     10881 * Internal function to get LED set off of Console instance
     10882 *
     10883 * @returns pointer to PDMLED object
     10884 *
     10885 * @param   pDevIns     The device insatnce data.
     10886 */
     10887PPDMLED *
     10888Console::i_getLedSet(uint32_t iLedSet)
     10889{
     10890    AssertReturn(iLedSet < RT_ELEMENTS(maLedSets), NULL);
     10891    return maLedSets[iLedSet].papLeds;
     10892}
     10893
     10894/**
    1088110895 * @interface_method_impl{VMM2USERMETHODS,pfnQueryGenericObject}
    1088210896 */
     
    1119111205    LogFlowFunc(("iInstance=%d\n", pDrvIns->iInstance));
    1119211206
     11207    com::Guid uuid(COM_IIDOF(IConsole));
     11208    IConsole *pIConsole = (IConsole *)PDMDrvHlpQueryGenericUserObject(pDrvIns, uuid.raw());
     11209    Console *pConsole = static_cast<Console *>(pIConsole);
     11210
    1119311211    /*
    1119411212     * Validate configuration.
    1119511213     */
    1119611214    PDMDRV_VALIDATE_CONFIG_RETURN(pDrvIns,
    11197                                   "papLeds|"
    11198                                   "pmapMediumAttachments|"
    1119911215                                  "DeviceInstance|"
    11200                                   "pConsole|"
     11216                                  "iLedSet|"
     11217                                  "HasMediumAttachments|"
    1120111218                                  "First|"
    1120211219                                  "Last",
     
    1120511222                    ("Configuration error: Not possible to attach anything to this driver!\n"),
    1120611223                    VERR_PDM_DRVINS_NO_ATTACH);
     11224
     11225    PCPDMDRVHLPR3 const pHlp = pDrvIns->pHlpR3;
     11226
     11227    uint32_t iLedSet;
     11228    int rc = pHlp->pfnCFGMQueryU32Def(pCfg, "iLedSet", &iLedSet, 0);
     11229    AssertLogRelMsgRCReturn(rc, ("Configuration error: Failed to query the \"iLedSet\" value! rc=%Rrc\n", rc), rc);
    1120711230
    1120811231    /*
     
    1121311236    pThis->IMediaNotify.pfnEjected          = Console::i_drvStatus_MediumEjected;
    1121411237    pThis->pDrvIns                          = pDrvIns;
     11238    pThis->pConsole                         = pConsole;
     11239    pThis->pmapMediumAttachments            = &pConsole->mapMediumAttachments;
     11240    pThis->papLeds                          = pConsole->i_getLedSet(iLedSet);
    1121511241    pThis->pszDeviceInstance                = NULL;
    1121611242
     
    1121811244     * Read config.
    1121911245     */
    11220     PCPDMDRVHLPR3 const pHlp = pDrvIns->pHlpR3;
    11221     int rc = pHlp->pfnCFGMQueryPtr(pCfg, "papLeds", (void **)&pThis->papLeds);
    11222     AssertLogRelMsgRCReturn(rc, ("Configuration error: Failed to query the \"papLeds\" value! rc=%Rrc\n", rc), rc);
    11223 
    11224     rc = pHlp->pfnCFGMQueryPtrDef(pCfg, "pmapMediumAttachments", (void **)&pThis->pmapMediumAttachments, NULL);
    11225     AssertLogRelMsgRCReturn(rc, ("Configuration error: Failed to query the \"pmapMediumAttachments\" value! rc=%Rrc\n", rc), rc);
    11226     if (pThis->pmapMediumAttachments)
     11246    uint32_t fHasMediumAttachments;
     11247    rc = pHlp->pfnCFGMQueryU32Def(pCfg, "HasMediumAttachments", &fHasMediumAttachments, 0);
     11248    AssertLogRelMsgRCReturn(RT_SUCCESS(rc) || rc == VERR_CFGM_VALUE_NOT_FOUND,
     11249         ("Configuration error: Failed to query the \"HasMediumAttachments\" value! rc=%Rrc\n", rc), rc);
     11250
     11251    if (fHasMediumAttachments)
    1122711252    {
    1122811253        rc = pHlp->pfnCFGMQueryStringAlloc(pCfg, "DeviceInstance", &pThis->pszDeviceInstance);
    1122911254        AssertLogRelMsgRCReturn(rc, ("Configuration error: Failed to query the \"DeviceInstance\" value! rc=%Rrc\n", rc), rc);
    11230         rc = pHlp->pfnCFGMQueryPtr(pCfg, "pConsole", (void **)&pThis->pConsole);
    11231         AssertLogRelMsgRCReturn(rc, ("Configuration error: Failed to query the \"pConsole\" value! rc=%Rrc\n", rc), rc);
    11232     }
    11233 
     11255    }
    1123411256    rc = pHlp->pfnCFGMQueryU32Def(pCfg, "First", &pThis->iFirstLUN, 0);
    1123511257    AssertLogRelMsgRCReturn(rc, ("Configuration error: Failed to query the \"First\" value! rc=%Rrc\n", rc), rc);
  • trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp

    r93628 r93855  
    691691    InsertConfigString(pLunL0,  "Driver",               "MainStatus");
    692692    InsertConfigNode(pLunL0,    "Config", &pCfg);
    693     PLEDSET pLS = i_allocateDriverLeds(uLast - uFirst + 1, enmType, ppaSubTypes);
    694     InsertConfigInteger(pCfg,   "papLeds", (uintptr_t)pLS->papLeds);
     693    InsertConfigInteger(pCfg,   "iLedSet", mcLedSets);
     694    (void) i_allocateDriverLeds(uLast - uFirst + 1, enmType, ppaSubTypes);
     695
    695696    if (pmapMediumAttachments)
    696697    {
    697         InsertConfigInteger(pCfg,   "pmapMediumAttachments", (uintptr_t)pmapMediumAttachments);
    698         InsertConfigInteger(pCfg,   "pConsole", (uintptr_t)this);
     698        InsertConfigInteger(pCfg,   "HasMediumAttachments", 1);
    699699        AssertPtr(pcszDevice);
    700700        Utf8Str deviceInstance = Utf8StrFmt("%s/%u", pcszDevice, uInstance);
     
    14641464         * Bandwidth groups.
    14651465         */
     1466        PCFGMNODE pAc;
     1467        PCFGMNODE pAcFile;
     1468        PCFGMNODE pAcFileBwGroups;
    14661469        ComPtr<IBandwidthControl> bwCtrl;
     1470        com::SafeIfaceArray<IBandwidthGroup> bwGroups;
     1471
    14671472        hrc = pMachine->COMGETTER(BandwidthControl)(bwCtrl.asOutParam());                   H();
    14681473
    1469         com::SafeIfaceArray<IBandwidthGroup> bwGroups;
    14701474        hrc = bwCtrl->GetAllBandwidthGroups(ComSafeArrayAsOutParam(bwGroups));              H();
    14711475
    1472         PCFGMNODE pAc;
    14731476        InsertConfigNode(pPDM, "AsyncCompletion", &pAc);
    1474         PCFGMNODE pAcFile;
    14751477        InsertConfigNode(pAc,  "File", &pAcFile);
    1476         PCFGMNODE pAcFileBwGroups;
    14771478        InsertConfigNode(pAcFile,  "BwGroups", &pAcFileBwGroups);
    14781479#ifdef VBOX_WITH_NETSHAPER
    14791480        PCFGMNODE pNetworkShaper;
     1481        PCFGMNODE pNetworkBwGroups;
     1482
    14801483        InsertConfigNode(pPDM, "NetworkShaper",  &pNetworkShaper);
    1481         PCFGMNODE pNetworkBwGroups;
    14821484        InsertConfigNode(pNetworkShaper, "BwGroups", &pNetworkBwGroups);
    14831485#endif /* VBOX_WITH_NETSHAPER */
     
    14861488        {
    14871489            Bstr strName;
     1490            LONG64 cMaxBytesPerSec;
     1491            BandwidthGroupType_T enmType;
     1492
    14881493            hrc = bwGroups[i]->COMGETTER(Name)(strName.asOutParam());                       H();
     1494            hrc = bwGroups[i]->COMGETTER(Type)(&enmType);                                   H();
     1495            hrc = bwGroups[i]->COMGETTER(MaxBytesPerSec)(&cMaxBytesPerSec);                 H();
     1496
    14891497            if (strName.isEmpty())
    14901498                return pVMM->pfnVMR3SetError(pUVM, VERR_CFGM_NO_NODE, RT_SRC_POS, N_("No bandwidth group name specified"));
    1491             BandwidthGroupType_T enmType = BandwidthGroupType_Null;
    1492             hrc = bwGroups[i]->COMGETTER(Type)(&enmType);                                   H();
    1493             LONG64 cMaxBytesPerSec = 0;
    1494             hrc = bwGroups[i]->COMGETTER(MaxBytesPerSec)(&cMaxBytesPerSec);                 H();
    14951499
    14961500            if (enmType == BandwidthGroupType_Disk)
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