Changeset 93855 in vbox for trunk/src/VBox/Main/src-client
- Timestamp:
- Feb 19, 2022 3:49:11 PM (3 years ago)
- Location:
- trunk/src/VBox/Main/src-client
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r93561 r93855 10879 10879 10880 10880 /** 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 */ 10887 PPDMLED * 10888 Console::i_getLedSet(uint32_t iLedSet) 10889 { 10890 AssertReturn(iLedSet < RT_ELEMENTS(maLedSets), NULL); 10891 return maLedSets[iLedSet].papLeds; 10892 } 10893 10894 /** 10881 10895 * @interface_method_impl{VMM2USERMETHODS,pfnQueryGenericObject} 10882 10896 */ … … 11191 11205 LogFlowFunc(("iInstance=%d\n", pDrvIns->iInstance)); 11192 11206 11207 com::Guid uuid(COM_IIDOF(IConsole)); 11208 IConsole *pIConsole = (IConsole *)PDMDrvHlpQueryGenericUserObject(pDrvIns, uuid.raw()); 11209 Console *pConsole = static_cast<Console *>(pIConsole); 11210 11193 11211 /* 11194 11212 * Validate configuration. 11195 11213 */ 11196 11214 PDMDRV_VALIDATE_CONFIG_RETURN(pDrvIns, 11197 "papLeds|"11198 "pmapMediumAttachments|"11199 11215 "DeviceInstance|" 11200 "pConsole|" 11216 "iLedSet|" 11217 "HasMediumAttachments|" 11201 11218 "First|" 11202 11219 "Last", … … 11205 11222 ("Configuration error: Not possible to attach anything to this driver!\n"), 11206 11223 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); 11207 11230 11208 11231 /* … … 11213 11236 pThis->IMediaNotify.pfnEjected = Console::i_drvStatus_MediumEjected; 11214 11237 pThis->pDrvIns = pDrvIns; 11238 pThis->pConsole = pConsole; 11239 pThis->pmapMediumAttachments = &pConsole->mapMediumAttachments; 11240 pThis->papLeds = pConsole->i_getLedSet(iLedSet); 11215 11241 pThis->pszDeviceInstance = NULL; 11216 11242 … … 11218 11244 * Read config. 11219 11245 */ 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) 11227 11252 { 11228 11253 rc = pHlp->pfnCFGMQueryStringAlloc(pCfg, "DeviceInstance", &pThis->pszDeviceInstance); 11229 11254 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 } 11234 11256 rc = pHlp->pfnCFGMQueryU32Def(pCfg, "First", &pThis->iFirstLUN, 0); 11235 11257 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 691 691 InsertConfigString(pLunL0, "Driver", "MainStatus"); 692 692 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 695 696 if (pmapMediumAttachments) 696 697 { 697 InsertConfigInteger(pCfg, "pmapMediumAttachments", (uintptr_t)pmapMediumAttachments); 698 InsertConfigInteger(pCfg, "pConsole", (uintptr_t)this); 698 InsertConfigInteger(pCfg, "HasMediumAttachments", 1); 699 699 AssertPtr(pcszDevice); 700 700 Utf8Str deviceInstance = Utf8StrFmt("%s/%u", pcszDevice, uInstance); … … 1464 1464 * Bandwidth groups. 1465 1465 */ 1466 PCFGMNODE pAc; 1467 PCFGMNODE pAcFile; 1468 PCFGMNODE pAcFileBwGroups; 1466 1469 ComPtr<IBandwidthControl> bwCtrl; 1470 com::SafeIfaceArray<IBandwidthGroup> bwGroups; 1471 1467 1472 hrc = pMachine->COMGETTER(BandwidthControl)(bwCtrl.asOutParam()); H(); 1468 1473 1469 com::SafeIfaceArray<IBandwidthGroup> bwGroups;1470 1474 hrc = bwCtrl->GetAllBandwidthGroups(ComSafeArrayAsOutParam(bwGroups)); H(); 1471 1475 1472 PCFGMNODE pAc;1473 1476 InsertConfigNode(pPDM, "AsyncCompletion", &pAc); 1474 PCFGMNODE pAcFile;1475 1477 InsertConfigNode(pAc, "File", &pAcFile); 1476 PCFGMNODE pAcFileBwGroups;1477 1478 InsertConfigNode(pAcFile, "BwGroups", &pAcFileBwGroups); 1478 1479 #ifdef VBOX_WITH_NETSHAPER 1479 1480 PCFGMNODE pNetworkShaper; 1481 PCFGMNODE pNetworkBwGroups; 1482 1480 1483 InsertConfigNode(pPDM, "NetworkShaper", &pNetworkShaper); 1481 PCFGMNODE pNetworkBwGroups;1482 1484 InsertConfigNode(pNetworkShaper, "BwGroups", &pNetworkBwGroups); 1483 1485 #endif /* VBOX_WITH_NETSHAPER */ … … 1486 1488 { 1487 1489 Bstr strName; 1490 LONG64 cMaxBytesPerSec; 1491 BandwidthGroupType_T enmType; 1492 1488 1493 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 1489 1497 if (strName.isEmpty()) 1490 1498 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();1495 1499 1496 1500 if (enmType == BandwidthGroupType_Disk)
Note:
See TracChangeset
for help on using the changeset viewer.