diff options
author | 2012-09-14 15:47:00 +0800 | |
---|---|---|
committer | 2012-09-17 14:59:37 -0400 | |
commit | 75b198b3e7b2c8b4106afbd42f8bb795c4773511 (patch) | |
tree | 68898b072c8882d60d08c2677e8964074ac64f2d /src/lxc | |
parent | use virBitmap to store cpu affinity info (diff) | |
download | libvirt-75b198b3e7b2c8b4106afbd42f8bb795c4773511.tar.gz libvirt-75b198b3e7b2c8b4106afbd42f8bb795c4773511.tar.bz2 libvirt-75b198b3e7b2c8b4106afbd42f8bb795c4773511.zip |
use virBitmap to store numa nodemask info.
Diffstat (limited to 'src/lxc')
-rw-r--r-- | src/lxc/lxc_controller.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c index dc45a6a04..44ec7aa4a 100644 --- a/src/lxc/lxc_controller.c +++ b/src/lxc/lxc_controller.c @@ -418,20 +418,19 @@ static int virLXCControllerSetupNUMAPolicy(virLXCControllerPtr ctrl) /* Convert nodemask to NUMA bitmask. */ nodemask_zero(&mask); - for (i = 0; i < VIR_DOMAIN_CPUMASK_LEN; i++) { - if (ctrl->def->numatune.memory.nodemask[i]) { - if (i > NUMA_NUM_NODES) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Host cannot support NUMA node %d"), i); - return -1; - } - if (i > maxnode && !warned) { - VIR_WARN("nodeset is out of range, there is only %d NUMA " - "nodes on host", maxnode); - warned = true; - } - nodemask_set(&mask, i); + i = -1; + while ((i = virBitmapNextSetBit(ctrl->def->numatune.memory.nodemask, i)) >= 0) { + if (i > NUMA_NUM_NODES) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Host cannot support NUMA node %d"), i); + return -1; + } + if (i > maxnode && !warned) { + VIR_WARN("nodeset is out of range, there is only %d NUMA " + "nodes on host", maxnode); + warned = true; } + nodemask_set(&mask, i); } mode = ctrl->def->numatune.memory.mode; |