libxl/xl: make it possible to specify soft-affinity in domain config file
authorDario Faggioli <dario.faggioli@citrix.com>
Tue, 29 Jul 2014 16:06:52 +0000 (18:06 +0200)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 30 Jul 2014 11:45:25 +0000 (12:45 +0100)
commit3d00662816fe74678c5b233c59e40dca604ca2bd
tree5fe03c180714053efb460cdb9a5d7cb4911f2cea
parent14ea07848b8b0f00ea311ee5413932129b6f6c72
libxl/xl: make it possible to specify soft-affinity in domain config file

To do so, we add the vcpu_soft_affinity array to build_info, and
treat it much like vcpu_hard_affinity. The new config option is
called "cpus_soft".

Note that the vcpu_hard_affinity array, introduced in a previous
patch, and the vcpu_soft_affinity array, introduced here, share
the same LIBXL_HAVE_xxx macro, in libxl.h. That is called
LIBXL_HAVE_BUILDINFO_VCPU_AFFINITY_ARRAYS, and was introduced
together with vcpu_hard_affinity, but only inside a comment.
In this change, we uncomment, and hence properly define it.

In order to avoid having to issue separate calls to
libxl_set_vcpuaffinity() (one for hard affinity and one for soft
affinity) in libxl__build_pre(), in case the caller uses
b_info->cpumap (for the former) and b_info->vcpu_soft_affinity (for
the latter), we also set (again!) a new default for b_info->cpumap.
This allows, from this change on, to always and only deal with
b_info->vcpu_hard_affinity all around libxl internals.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
docs/man/xl.cfg.pod.5
tools/libxl/libxl.h
tools/libxl/libxl_create.c
tools/libxl/libxl_dom.c
tools/libxl/libxl_types.idl
tools/libxl/xl_cmdimpl.c