VirtualBox

Changeset 11258 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Aug 8, 2008 2:38:28 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
34336
Message:

API/Host: New method for querying the number of CPUs online.

Location:
trunk/src/VBox/Main
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/HostImpl.cpp

    r10896 r11258  
    9999#include <VBox/err.h>
    100100#include <iprt/string.h>
    101 /** @todo the following line becomes obsolete after switching to Mp runtime functions */
    102 #include <iprt/system.h>
    103101#include <iprt/mp.h>
    104102#include <iprt/time.h>
     
    682680    AutoWriteLock alock (this);
    683681    CHECK_READY();
    684     *count = RTSystemProcessorGetCount();
    685     /** @todo after implementing the Mp runtime on all platforms replace with
    686      * *count = RTMpGetOnlineCount(); */
     682    *count = RTMpGetCount();
     683    return S_OK;
     684}
     685
     686/**
     687 * Returns the number of online logical processors
     688 *
     689 * @returns COM status code
     690 * @param   count address of result variable
     691 */
     692STDMETHODIMP Host::COMGETTER(ProcessorOnlineCount)(ULONG *count)
     693{
     694    if (!count)
     695        return E_POINTER;
     696    AutoWriteLock alock (this);
     697    CHECK_READY();
     698    *count = RTMpGetOnlineCount();
    687699    return S_OK;
    688700}
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r11083 r11258  
    49764976  <interface
    49774977     name="IHost" extends="$unknown"
    4978      uuid="D56DC1AF-8D1B-4A06-86D7-26016E0E2B74"
     4978     uuid="489fb370-c227-4d43-9761-ceb28484fd9f"
    49794979     wsmap="managed"
    49804980     >
     
    50465046    <attribute name="processorCount" type="unsigned long" readonly="yes">
    50475047      <desc>Number of (logical) CPUs installed in the host system.</desc>
     5048    </attribute>
     5049
     5050    <attribute name="processorOnlineCount" type="unsigned long" readonly="yes">
     5051      <desc>Number of (logical) CPUs online in the host system.</desc>
    50485052    </attribute>
    50495053
  • trunk/src/VBox/Main/include/HostImpl.h

    r10896 r11258  
    8282    STDMETHOD(COMGETTER(NetworkInterfaces))(IHostNetworkInterfaceCollection **networkInterfaces);
    8383    STDMETHOD(COMGETTER(ProcessorCount))(ULONG *count);
     84    STDMETHOD(COMGETTER(ProcessorOnlineCount))(ULONG *count);
    8485    STDMETHOD(GetProcessorSpeed)(ULONG cpuId, ULONG *speed);
    8586    STDMETHOD(GetProcessorDescription)(ULONG cpuId, BSTR *description);
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