[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] xl: expose max_cpu_id from `xl info`

On 03/14/2012 12:24 PM, Andrew Cooper wrote:
> <snip>
>>>> Is this true: nr_cpus = max_cpu_id + 1 ?
>>>> Zhigang
>>> if and only if all cpus are online.
>>> nr_cpus is set to nr_online_cpus() in the hypercall, while max_cpu_id
>>> is set to nr_cpu_ids-1.
>>> nr_cpus is liable to change during runtime, while max_cpu_id is not.
>>> ~Andrew
>> If this is the case, I think nr_cpus is a bit confusing. Can we make
>> it always representing the number of physical cpus (from hypervisor's
>> viewpoint, not dom0)?
>> Zhigang
> No.  The names here reflect the hypercall name parameters.  The
> hypercall cant be changed because it is an ABI, and the "name : value"
> pairs here cant be changed because of backward compatibility with the
> previous toolstack.
Ok. Thanks for you info. I think nr_online_cpus() is the right thing here: it
represents online physical cpus from hypervisor's viewpoint.

It's fine to add this output here if  you need it. But for most of the xen
users, the current nr_cpus should be what they want (for how many pcpus they can

Other ways to get full hardware info could be BIOS/SMBIOS/DMI, and I think it's
better than xl info.



Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.