- Timestamp:
- Dec 4, 2013 5:03:51 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/HostImpl.cpp
r49764 r49778 275 275 * Create and initialize the USB Proxy Service. 276 276 */ 277 # if defined 277 # if defined(RT_OS_DARWIN) 278 278 m->pUSBProxyService = new USBProxyServiceDarwin(this); 279 # elif defined 279 # elif defined(RT_OS_LINUX) 280 280 m->pUSBProxyService = new USBProxyServiceLinux(this); 281 # elif defined 281 # elif defined(RT_OS_OS2) 282 282 m->pUSBProxyService = new USBProxyServiceOs2(this); 283 # elif defined 283 # elif defined(RT_OS_SOLARIS) 284 284 m->pUSBProxyService = new USBProxyServiceSolaris(this); 285 # elif defined 285 # elif defined(RT_OS_WINDOWS) 286 286 m->pUSBProxyService = new USBProxyServiceWindows(this); 287 # elif defined 287 # elif defined(RT_OS_FREEBSD) 288 288 m->pUSBProxyService = new USBProxyServiceFreeBSD(this); 289 289 # else … … 302 302 m->hostDnsMonitorProxy.init(HostDnsMonitor::getHostDnsMonitor(), m->pParent); 303 303 304 #if defined 304 #if defined(RT_OS_WINDOWS) 305 305 m->pHostPowerService = new HostPowerServiceWin(m->pParent); 306 #elif defined 306 #elif defined(RT_OS_DARWIN) 307 307 m->pHostPowerService = new HostPowerServiceDarwin(m->pParent); 308 308 #else … … 414 414 #endif 415 415 416 #if defined 416 #if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_FREEBSD) 417 417 /* Extract the list of configured host-only interfaces */ 418 418 std::set<Utf8Str> aConfiguredNames; … … 448 448 } 449 449 450 #endif /* defined 450 #endif /* defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_FREEBSD) */ 451 451 452 452 /* Confirm a successful initialization */ … … 471 471 #ifdef VBOX_WITH_RESOURCE_USAGE_API 472 472 PerformanceCollector *aCollector = m->pParent->performanceCollector(); 473 i_unregisterMetrics 473 i_unregisterMetrics(aCollector); 474 474 #endif /* VBOX_WITH_RESOURCE_USAGE_API */ 475 475 /* … … 523 523 { 524 524 AutoWriteLock alock(m->pParent->getMediaTreeLockHandle() COMMA_LOCKVAL_SRC_POS); 525 525 526 MediaList *pList; 526 aDVDDrives.resize(0);527 527 HRESULT rc = i_getDrives(DeviceType_DVD, true /* fRefresh */, pList); 528 if (SUCCEEDED(rc)) 529 { 530 aDVDDrives.resize(pList->size()); 531 size_t i = 0; 532 for (MediaList::const_iterator it= pList->begin(); it!= pList->end(); ++it, ++i) 533 { 534 (*it).queryInterfaceTo(aDVDDrives[i].asOutParam()); 535 } 536 } 537 538 return rc; 528 if (FAILED(rc)) 529 return rc; 530 531 aDVDDrives.resize(pList->size()); 532 size_t i = 0; 533 for (MediaList::const_iterator it = pList->begin(); it != pList->end(); ++it, ++i) 534 (*it).queryInterfaceTo(aDVDDrives[i].asOutParam()); 535 536 return S_OK; 539 537 } 540 538 … … 550 548 551 549 MediaList *pList; 552 aFloppyDrives.resize(0);553 550 HRESULT rc = i_getDrives(DeviceType_Floppy, true /* fRefresh */, pList); 554 if (SUCCEEDED(rc)) 555 { 556 aFloppyDrives.resize(pList->size()); 557 size_t i = 0; 558 for (MediaList::const_iterator it = pList->begin(); it != pList->end(); ++it, ++i) 559 { 560 (*it).queryInterfaceTo(aFloppyDrives[i].asOutParam()); 561 } 562 } 563 564 return rc; 551 if (FAILED(rc)) 552 return rc; 553 554 aFloppyDrives.resize(pList->size()); 555 size_t i = 0; 556 for (MediaList::const_iterator it = pList->begin(); it != pList->end(); ++it, ++i) 557 (*it).queryInterfaceTo(aFloppyDrives[i].asOutParam()); 558 559 return S_OK; 565 560 } 566 561 … … 591 586 iface.createObject(); 592 587 /* remove the curly bracket at the end */ 593 if (SUCCEEDED(iface->init (name, name, Guid(IfGuid), HostNetworkInterfaceType_Bridged)))588 if (SUCCEEDED(iface->init(name, name, Guid(IfGuid), HostNetworkInterfaceType_Bridged))) 594 589 { 595 590 // iface->setVirtualBox(m->pParent); … … 617 612 HRESULT Host::getNetworkInterfaces(std::vector<ComPtr<IHostNetworkInterface> > &aNetworkInterfaces) 618 613 { 619 aNetworkInterfaces.resize(0);620 614 #if defined(RT_OS_WINDOWS) || defined(VBOX_WITH_NETFLT) /*|| defined(RT_OS_OS2)*/ 621 615 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 616 622 617 # ifdef VBOX_WITH_HOSTNETIF_API 623 618 int rc = i_updateNetIfList(); 624 619 if (rc) 625 {626 620 Log(("Failed to get host network interface list with rc=%Rrc\n", rc)); 627 } 621 628 622 aNetworkInterfaces.resize(m->llNetIfs.size()); 629 623 size_t i = 0; 630 624 for (HostNetworkInterfaceList::iterator it = m->llNetIfs.begin(); it != m->llNetIfs.end(); ++it, ++i) 631 {632 625 (*it).queryInterfaceTo(aNetworkInterfaces[i].asOutParam()); 633 }634 626 635 627 return S_OK; 636 637 628 # else 638 629 std::list<ComObjPtr<HostNetworkInterface> > list; … … 784 775 # endif /* RT_OS_LINUX */ 785 776 786 SafeIfaceArray<IHostNetworkInterface> networkInterfaces 777 SafeIfaceArray<IHostNetworkInterface> networkInterfaces(list); 787 778 networkInterfaces.detachTo(ComSafeArrayOutArg(aNetworkInterfaces)); 788 779 789 780 return S_OK; 790 791 781 # endif 792 782 #else … … 798 788 HRESULT Host::getUSBDevices(std::vector<ComPtr<IHostUSBDevice> > &aUSBDevices) 799 789 { 800 aUSBDevices.resize(0);801 790 #ifdef VBOX_WITH_USB 802 791 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 792 803 793 HRESULT rc = i_checkUSBProxyService(); 804 if (FAILED(rc)) return rc; 794 if (FAILED(rc)) 795 return rc; 796 805 797 SafeIfaceArray<IHostUSBDevice> resultArr; 806 798 rc = m->pUSBProxyService->getDeviceCollection(ComSafeArrayAsOutParam(resultArr)); 807 if (FAILED(rc)) return rc; 799 if (FAILED(rc)) 800 return rc; 801 808 802 aUSBDevices.resize(resultArr.size()); 809 803 for (size_t i = 0; i < resultArr.size(); ++i) 810 804 { 811 Com ObjPtr<IHostUSBDevice> iHu = resultArr[i];805 ComPtr<IHostUSBDevice> iHu = resultArr[i]; 812 806 iHu.queryInterfaceTo(aUSBDevices[i].asOutParam()); 813 807 } 814 808 815 return rc; 816 809 return S_OK; 817 810 #else 818 811 /* Note: The GUI depends on this method returning E_NOTIMPL with no … … 825 818 ReturnComNotImplemented(); 826 819 #endif 827 return S_OK;828 820 } 829 821 … … 835 827 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 836 828 837 aNameServers.resize(0);838 829 com::SafeArray<BSTR> resultArr; 839 resultArr.setNull();840 830 HRESULT rc = m->hostDnsMonitorProxy.GetNameServers(ComSafeArrayAsOutParam(resultArr)); 841 if (FAILED(rc)) return rc; 831 if (FAILED(rc)) 832 return rc; 833 842 834 aNameServers.resize(resultArr.size()); 843 835 for (size_t i = 0; i < resultArr.size(); ++i) 844 {845 836 aNameServers[i] = com::Utf8Str(resultArr[i]); 846 } 847 return rc;837 838 return S_OK; 848 839 } 849 840 … … 854 845 HRESULT Host::getDomainName(com::Utf8Str &aDomainName) 855 846 { 856 BSTR bstr;857 HRESULT rc = m->hostDnsMonitorProxy.GetDomainName(&bstr);858 if SUCCEEDED(rc)859 aDomainName = com::Utf8Str(bstr);860 return rc;861 847 /* XXX: note here should be synchronization with thread polling state 862 848 * changes in name resoving system on host */ 849 Bstr tmpName; 850 HRESULT rc = m->hostDnsMonitorProxy.GetDomainName(tmpName.asOutParam()); 851 if (FAILED(rc)) 852 return rc; 853 854 aDomainName = com::Utf8Str(tmpName); 855 856 return S_OK; 863 857 } 864 858 … … 870 864 { 871 865 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 866 872 867 com::SafeArray<BSTR> resultArr; 873 aSearchStrings.resize(0);874 resultArr.setNull();875 868 HRESULT rc = m->hostDnsMonitorProxy.GetSearchStrings(ComSafeArrayAsOutParam(resultArr)); 876 if (FAILED(rc)) return rc; 869 if (FAILED(rc)) 870 return rc; 871 877 872 aSearchStrings.resize(resultArr.size()); 878 873 for (size_t i = 0; i < resultArr.size(); ++i) 879 {880 874 aSearchStrings[i] = com::Utf8Str(resultArr[i]); 881 } 882 return rc;875 876 return S_OK; 883 877 } 884 878 885 879 HRESULT Host::getUSBDeviceFilters(std::vector<ComPtr<IHostUSBDeviceFilter> > &aUSBDeviceFilters) 886 880 { 887 aUSBDeviceFilters.resize(0);888 881 #ifdef VBOX_WITH_USB 889 882 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 883 890 884 HRESULT rc = i_checkUSBProxyService(); 891 if (FAILED(rc)) return rc; 885 if (FAILED(rc)) 886 return rc; 887 892 888 aUSBDeviceFilters.resize(m->llUSBDeviceFilters.size()); 893 889 size_t i = 0; 894 890 for (USBDeviceFilterList::iterator it = m->llUSBDeviceFilters.begin(); it != m->llUSBDeviceFilters.end(); ++it, ++i) 895 {896 891 (*it).queryInterfaceTo(aUSBDeviceFilters[i].asOutParam()); 897 } 898 899 return rc; 892 893 return S_OK; 900 894 #else 901 895 /* Note: The GUI depends on this method returning E_NOTIMPL with no … … 999 993 if (RT_FAILURE(vrc)) 1000 994 return E_FAIL; /** @todo error reporting? */ 995 1001 996 aDescription = Utf8Str(szCPUModel); 997 1002 998 return S_OK; 1003 999 } … … 1265 1261 /* No need to lock anything. If there ever will - watch out, the function 1266 1262 * called below grabs the VirtualBox lock. */ 1267 IHostNetworkInterface *iHn = aHostInterface; 1268 IProgress *iHn2 = aProgress; 1269 1270 int r = NetIfCreateHostOnlyNetworkInterface(m->pParent, &iHn, &iHn2); 1263 1264 int r = NetIfCreateHostOnlyNetworkInterface(m->pParent, aHostInterface.asOutParam(), aProgress.asOutParam()); 1271 1265 if (RT_SUCCESS(r)) 1272 1266 { 1273 if ( !iHn)1267 if (aHostInterface.isNull()) 1274 1268 return setError(E_FAIL, 1275 1269 tr("Unable to create a host network interface")); … … 1328 1322 return setError(VBOX_E_OBJECT_NOT_FOUND, 1329 1323 tr("Host network interface with UUID {%RTuuid} does not exist"), 1330 Guid 1324 Guid(aId).raw()); 1331 1325 rc = iface->COMGETTER(Name)(name.asOutParam()); 1332 1326 ComAssertComRCRet(rc, rc); … … 1383 1377 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1384 1378 1385 clearError();1386 1379 MultiResult rc = i_checkUSBProxyService(); 1387 if (FAILED(rc)) return rc; 1380 if (FAILED(rc)) 1381 return rc; 1388 1382 1389 1383 ComObjPtr<HostUSBDeviceFilter> pFilter; … … 1443 1437 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1444 1438 1445 clearError();1446 1439 MultiResult rc = i_checkUSBProxyService(); 1447 if (FAILED(rc)) return rc; 1440 if (FAILED(rc)) 1441 return rc; 1448 1442 1449 1443 if (!m->llUSBDeviceFilters.size()) … … 1460 1454 /* iterate to the position... */ 1461 1455 USBDeviceFilterList::iterator it = m->llUSBDeviceFilters.begin(); 1462 std::advance 1456 std::advance(it, aPosition); 1463 1457 /* ...get an element from there... */ 1464 1458 filter = *it; … … 1590 1584 std::vector<ComPtr<IHostNetworkInterface> > &aNetworkInterfaces) 1591 1585 { 1592 aNetworkInterfaces.resize(0);1593 1586 #ifdef VBOX_WITH_HOSTNETIF_API 1594 1587 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); … … 1630 1623 SafeIfaceArray<IHostUSBDevice> devsvec; 1631 1624 HRESULT rc = COMGETTER(USBDevices)(ComSafeArrayAsOutParam(devsvec)); 1632 if (FAILED(rc)) return rc; 1625 if (FAILED(rc)) 1626 return rc; 1633 1627 1634 1628 for (size_t i = 0; i < devsvec.size(); ++i) … … 1636 1630 Bstr address; 1637 1631 rc = devsvec[i]->COMGETTER(Address)(address.asOutParam()); 1638 if (FAILED(rc)) return rc; 1632 if (FAILED(rc)) 1633 return rc; 1639 1634 if (address == aName) 1640 1635 { 1641 return (Com ObjPtr<IHostUSBDevice>(devsvec[i]).queryInterfaceTo(aDevice.asOutParam()));1636 return (ComPtr<IHostUSBDevice>(devsvec[i]).queryInterfaceTo(aDevice.asOutParam())); 1642 1637 } 1643 1638 } … … 1664 1659 SafeIfaceArray<IHostUSBDevice> devsvec; 1665 1660 HRESULT rc = COMGETTER(USBDevices)(ComSafeArrayAsOutParam(devsvec)); 1666 if (FAILED(rc)) return rc; 1661 if (FAILED(rc)) 1662 return rc; 1667 1663 1668 1664 for (size_t i = 0; i < devsvec.size(); ++i) … … 1670 1666 Bstr id; 1671 1667 rc = devsvec[i]->COMGETTER(Id)(id.asOutParam()); 1672 if (FAILED(rc)) return rc; 1668 if (FAILED(rc)) 1669 return rc; 1673 1670 if (Guid(id) == aId) 1674 1671 { 1675 return (Com ObjPtr<IHostUSBDevice>(devsvec[i]).queryInterfaceTo(aDevice.asOutParam()));1676 } 1677 } 1678 return setErrorNoLog (VBOX_E_OBJECT_NOT_FOUND, tr (1679 "Could not find a USB device with uuid {%RTuuid}"),1680 aId.raw());1672 return (ComPtr<IHostUSBDevice>(devsvec[i]).queryInterfaceTo(aDevice.asOutParam())); 1673 } 1674 } 1675 return setErrorNoLog(VBOX_E_OBJECT_NOT_FOUND, 1676 tr("Could not find a USB device with uuid {%RTuuid}"), 1677 aId.raw()); 1681 1678 1682 1679 #else /* !VBOX_WITH_USB */ … … 1704 1701 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 1705 1702 HostVideoInputDeviceList list; 1706 aVideoInputDevices.resize(0); 1707 1708 HRESULT hr = HostVideoInputDevice::queryHostDevices(m->pParent, &list); 1709 1710 if (SUCCEEDED(hr)) 1711 { 1712 aVideoInputDevices.resize(list.size()); 1713 size_t i = 0; 1714 for (HostVideoInputDeviceList::const_iterator it = list.begin(); it != list.end(); ++it, ++i) 1715 { 1716 (*it).queryInterfaceTo(aVideoInputDevices[i].asOutParam()); 1717 } 1718 } 1719 1720 return hr; 1703 1704 HRESULT rc = HostVideoInputDevice::queryHostDevices(m->pParent, &list); 1705 if (FAILED(rc)) 1706 return rc; 1707 1708 aVideoInputDevices.resize(list.size()); 1709 size_t i = 0; 1710 for (HostVideoInputDeviceList::const_iterator it = list.begin(); it != list.end(); ++it, ++i) 1711 (*it).queryInterfaceTo(aVideoInputDevices[i].asOutParam()); 1712 1713 return S_OK; 1721 1714 } 1722 1715 … … 1729 1722 #ifdef VBOX_WITH_USB 1730 1723 AutoCaller autoCaller(this); 1731 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 1724 if (FAILED(autoCaller.rc())) 1725 return autoCaller.rc(); 1732 1726 1733 1727 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); … … 1741 1735 pFilter.createObject(); 1742 1736 rc = pFilter->init(this, f); 1743 if (FAILED(rc)) break; 1737 if (FAILED(rc)) 1738 break; 1744 1739 1745 1740 m->llUSBDeviceFilters.push_back(pFilter); … … 1763 1758 #ifdef VBOX_WITH_USB 1764 1759 AutoCaller autoCaller(this); 1765 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 1760 if (FAILED(autoCaller.rc())) 1761 return autoCaller.rc(); 1766 1762 1767 1763 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); … … 1962 1958 * @param strLocationFull Name (path) of host drive to look for. 1963 1959 * @param fRefresh Whether to refresh the host drives list (see getDrives()) 1964 * @param pMedium Medium object, if found …1960 * @param pMedium Medium object, if found 1965 1961 * @return VBOX_E_OBJECT_NOT_FOUND if not found, or S_OK if found, or errors from getDrives(). 1966 1962 */ … … 2170 2166 { 2171 2167 AutoCaller autoCaller(this); 2172 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 2168 if (FAILED(autoCaller.rc())) 2169 return autoCaller.rc(); 2173 2170 2174 2171 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); … … 2182 2179 { 2183 2180 AutoCaller autoCaller(this); 2184 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 2181 if (FAILED(autoCaller.rc())) 2182 return autoCaller.rc(); 2185 2183 2186 2184 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); … … 2212 2210 { 2213 2211 AutoCaller autoCaller(this); 2214 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 2212 if (FAILED(autoCaller.rc())) 2213 return autoCaller.rc(); 2215 2214 2216 2215 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); … … 2443 2442 if (!gLibHalCheckPresence()) 2444 2443 return false; 2445 gDBusErrorInit 2444 gDBusErrorInit(&dbusError); 2446 2445 DBusConnection *dbusConnection = gDBusBusGet(DBUS_BUS_SYSTEM, &dbusError); 2447 2446 if (dbusConnection != 0) … … 2450 2449 if (halContext != 0) 2451 2450 { 2452 if (gLibHalCtxSetDBusConnection 2451 if (gLibHalCtxSetDBusConnection(halContext, dbusConnection)) 2453 2452 { 2454 2453 if (gLibHalCtxInit(halContext, &dbusError)) … … 2490 2489 if ((vendor != 0) && (vendor[0] != 0)) 2491 2490 { 2492 description = Utf8StrFmt 2493 2491 description = Utf8StrFmt("%s %s", 2492 vendor, product); 2494 2493 } 2495 2494 else … … 2501 2500 hostDVDDriveObj->init(m->pParent, DeviceType_DVD, 2502 2501 Bstr(devNode), Bstr(description)); 2503 list.push_back 2502 list.push_back(hostDVDDriveObj); 2504 2503 } 2505 2504 else … … 2515 2514 hostDVDDriveObj->init(m->pParent, DeviceType_DVD, 2516 2515 Bstr(devNode)); 2517 list.push_back 2516 list.push_back(hostDVDDriveObj); 2518 2517 } 2519 2518 if (vendor != 0) … … 2596 2595 if (!gLibHalCheckPresence()) 2597 2596 return false; 2598 gDBusErrorInit 2597 gDBusErrorInit(&dbusError); 2599 2598 DBusConnection *dbusConnection = gDBusBusGet(DBUS_BUS_SYSTEM, &dbusError); 2600 2599 if (dbusConnection != 0) … … 2603 2602 if (halContext != 0) 2604 2603 { 2605 if (gLibHalCtxSetDBusConnection 2604 if (gLibHalCtxSetDBusConnection(halContext, dbusConnection)) 2606 2605 { 2607 2606 if (gLibHalCtxInit(halContext, &dbusError)) … … 2653 2652 if ((vendor != 0) && (vendor[0] != 0)) 2654 2653 { 2655 description = Utf8StrFmt 2656 2654 description = Utf8StrFmt("%s %s", 2655 vendor, product); 2657 2656 } 2658 2657 else … … 2664 2663 hostFloppyDrive->init(m->pParent, DeviceType_DVD, 2665 2664 Bstr(devNode), Bstr(description)); 2666 list.push_back 2665 list.push_back(hostFloppyDrive); 2667 2666 } 2668 2667 else … … 2678 2677 hostFloppyDrive->init(m->pParent, DeviceType_DVD, 2679 2678 Bstr(devNode)); 2680 list.push_back 2679 list.push_back(hostFloppyDrive); 2681 2680 } 2682 2681 if (vendor != 0) … … 2833 2832 hostDVDDriveObj.createObject(); 2834 2833 hostDVDDriveObj->init(m->pParent, DeviceType_DVD, Bstr(rawDevName)); 2835 list.push_back 2834 list.push_back(hostDVDDriveObj); 2836 2835 } 2837 2836 free(rawDevName); … … 2925 2924 { 2926 2925 AutoCaller autoCaller(this); 2927 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 2926 if (FAILED(autoCaller.rc())) 2927 return autoCaller.rc(); 2928 2928 2929 2929 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); … … 2950 2950 tr("The USB Proxy Service has not yet been ported to this host")); 2951 2951 default: 2952 return setWarning 2953 tr("Could not load the Host USB Proxy service"),2954 2952 return setWarning(E_FAIL, "%s: %Rrc", 2953 tr("Could not load the Host USB Proxy service"), 2954 m->pUSBProxyService->getLastError()); 2955 2955 } 2956 2956 } … … 3054 3054 fsRootUsageUsed, 3055 3055 fsRootUsageFree); 3056 aCollector->registerBaseMetric 3056 aCollector->registerBaseMetric(fsRootUsage); 3057 3057 3058 3058 aCollector->registerMetric(new pm::Metric(fsRootUsage, fsRootUsageTotal, 0)); … … 3093 3093 pm::BaseMetric *fsLoad = new pm::HostDiskLoadRaw(hal, this, strName + "/Load", 3094 3094 *it, fsLoadUtil); 3095 aCollector->registerBaseMetric 3095 aCollector->registerBaseMetric(fsLoad); 3096 3096 3097 3097 aCollector->registerMetric(new pm::Metric(fsLoad, fsLoadUtil, 0)); … … 3110 3110 pm::BaseMetric *fsUsage = new pm::HostDiskUsage(hal, this, strName + "/Usage", 3111 3111 *it, fsUsageTotal); 3112 aCollector->registerBaseMetric 3112 aCollector->registerBaseMetric(fsUsage); 3113 3113 3114 3114 aCollector->registerMetric(new pm::Metric(fsUsage, fsUsageTotal, 0)); … … 3153 3153 pm::BaseMetric *cpuLoad = new pm::HostCpuLoadRaw(hal, this, cpuLoadUser, cpuLoadKernel, 3154 3154 cpuLoadIdle); 3155 aCollector->registerBaseMetric 3155 aCollector->registerBaseMetric(cpuLoad); 3156 3156 pm::BaseMetric *cpuMhz = new pm::HostCpuMhz(hal, this, cpuMhzSM); 3157 aCollector->registerBaseMetric 3157 aCollector->registerBaseMetric(cpuMhz); 3158 3158 pm::BaseMetric *ramUsage = new pm::HostRamUsage(hal, this, 3159 3159 ramUsageTotal, 3160 3160 ramUsageUsed, 3161 3161 ramUsageFree); 3162 aCollector->registerBaseMetric 3162 aCollector->registerBaseMetric(ramUsage); 3163 3163 pm::BaseMetric *ramVmm = new pm::HostRamVmm(aCollector->getGuestManager(), this, 3164 3164 ramVMMUsed, … … 3166 3166 ramVMMBallooned, 3167 3167 ramVMMShared); 3168 aCollector->registerBaseMetric 3168 aCollector->registerBaseMetric(ramVmm); 3169 3169 3170 3170 aCollector->registerMetric(new pm::Metric(cpuLoad, cpuLoadUser, 0)); … … 3258 3258 } 3259 3259 3260 void Host::i_unregisterMetrics 3260 void Host::i_unregisterMetrics(PerformanceCollector *aCollector) 3261 3261 { 3262 3262 aCollector->unregisterMetricsFor(this);
Note:
See TracChangeset
for help on using the changeset viewer.