|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] xl, cpupools: Create empty pool if no cpus are specified
# HG changeset patch
# User George Dunlap <george.dunlap@xxxxxxxxxxxxx>
# Date 1335289916 -3600
# Node ID b8e182cc7f2e1394cc80a24598d4cb1c965c3b4a
# Parent 7d53703aa3ffa88cf57d212dd80e90f42647c74e
xl, cpupools: Create empty pool if no cpus are specified
Currently, if "xl cpupool-create" is called with no cpus configured,
xl will choose a cpu at random from the list of unassigned cpus, and
if no unassigned cpus are available, it will fail.
This seems to me to be a poor interface. For one, it makes it impossible
to create an empty cpupool using the xl command-line, except by creating
a pool and then removing the cpus from it. For two, I don't think assigning
a random cpu is a feature; it's not unreasonable for the user to specify
which cpus to add to which pools.
This patch changes the behavior of "xl cpupool-create" to create an empty
pool if no cpus are specified. I believe this interface to be more expected
and more script-friendly.
Signed-off-by: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
diff -r 7d53703aa3ff -r b8e182cc7f2e tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c Thu Apr 12 09:12:58 2012 +0100
+++ b/tools/libxl/xl_cmdimpl.c Tue Apr 24 18:51:56 2012 +0100
@@ -5718,20 +5718,8 @@ int main_cpupoolcreate(int argc, char **
libxl_cpumap_set(&cpumap, i);
n_cpus++;
}
- } else {
- n_cpus = 1;
- n = 0;
- libxl_for_each_cpu(i, freemap)
- if (libxl_cpumap_test(&freemap, i)) {
- n++;
- libxl_cpumap_set(&cpumap, i);
- break;
- }
- if (n < n_cpus) {
- fprintf(stderr, "no free cpu found\n");
- return -ERROR_FAIL;
- }
- }
+ } else
+ n_cpus = 0;
libxl_uuid_generate(&uuid);
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |