tools/libxc: Introduce XC_CPUPOOL_POOLID_ANY

Callers to xc_cpupool_create() can either request a specific pool id,
or request that Xen do it for them.  But at the moment, the
"automatic" selection is indicated by using a magic value, 0.  This is
undesirable both because it doesn't obviously have meaning, but also
because '0' is a valid cpupool (albeit one which at the moment can't
be changed).

Introduce a constant, XC_CPUPOOL_POOLID_ANY, to indicate this instead.
Have it be the default for the python bindings.

Manually translate it, even though it's the same underlying value,
because we don't yet have a relaible way of enforcing that these
values are the same.

Signed-off-by: George Dunlap <george.dunlap@citrix.com>
Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
This commit is contained in:
George Dunlap authored and Wei Liu committed 2017-02-16 12:47:10 +00:00
1 parent bc6a499ebc
commit f5cfc3955e
4 files changed
+10 -3

No files matched your search

+1 -1
View File
@@ -1715,7 +1715,7 @@ static PyObject *pyxc_cpupool_create(XcObject *self,
PyObject *args,
PyObject *kwds)
{
uint32_t cpupool = 0, sched = XEN_SCHEDULER_CREDIT;
uint32_t cpupool = XC_CPUPOOL_POOLID_ANY, sched = XEN_SCHEDULER_CREDIT;
static char *kwd_list[] = { "pool", "sched", NULL };
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.