On Wed, 2015-02-25 at 10:24 +0100, Dario Faggioli wrote:
On Tue, 2015-02-24 at 13:10 +0000, Ian Campbell wrote:
> On Tue, 2015-02-24 at 12:41 +0000, Anthony PERARD wrote:
> > What libxl API those provide this information, if it exist?
> >
> > I found libxl_get_online_cpus() but that not enough. They want a
> > bitmap.
>
> I think that is all which currently exists, at least at the libxl level,
> you may need to add a new interface.
>
> It'd be worth looking into the various host numa interfaces -- perhaps
> one of them indirectly exposes what you want?
>
Given Daniel's latest emails, I'm not sure this is useful but
libxl_get_cpu_topology() should put LIBXL_CPUTOPOLOGY_INVALID_ENTRY in
all the fields of the i-eth element of the array it returns, if the
i-eth pcpu is offline (see the implementation of XEN_SYSCTL_topologyinfo
in xen/common/sysctl.c).
So, scanning that array and constructing the bitmap according to whether
or not we find that marker on the various elements would be the way to
go, I would say.
It could work, yes, although if there were other reasons for INVALID
entry it would fall down.
Thinking about it, it might be a better idea long term to expose a some
specific interfaces for managing or interrogating host CPU status rather
than inferring it through other means, it's not like the hypercall would
be very hard to setup and plumb through.
But as you say, Daniel's response might have made this all moot anyway,
or at least deferrable.
Ian.
I've actually never tested this, i.e., I've never tried
offlining a pcpu
on the host. I'll give it a go as soon as I find 5 minutes, and let know
if it works.
Regards,
Dario