: libxenlight, enables less than maximum vcpus
PATCH 13/14 : libxenlight, enables less than maximum vcpus
Enable turning on a different amount of vcpus than the maximum during domain creation/restore.
Signed-off-by Andres Lagar-Cavilla <[email protected]>
# HG changeset patch
# User Andres Lagar-Cavilla <[email protected]> # Date 1259597655 18000
# Node ID 0767f0bcfec197d2e4dbde58b36162308f349734 # Parent 5527664fbd0eeb423cb87d249fe74e5ab1321433 Enable turning on a different amount of vcpus than the maximum during domain creation/restore.
Signed-off-by Andres Lagar-Cavilla <[email protected]>
libxl.h +1 -0
@@ -64,6 +64,7 @@ typedef struct {int hpet;int vpt_align;int max_vcpus; +int cur_vcpus;uint32_t max_memkb;uint32_t video_memkb;uint32_t shadow_memkb;
libxl_dom.c +2 -1
@@ -89,7 +89,8 @@ int build_post(struct libxl_ctx *ctx, ui ents[9 ] =libxl_sprintf (ctx,"%lu" , state->store_mfn);for (i =0 ; i < info->max_vcpus; i++) { ents[10 +(i*2 )] =libxl_sprintf (ctx,"cpu/%d/availability" , i); - ents[10 +(i*2 )+1 ] ="online" ; + ents[10 +(i*2 )+1 ] = (i && info->cur_vcpus && (i >= info->cur_vcpus)) + ?"offline" :"online" ; } dom_path =libxl_xs_get_dompath (ctx, domid);
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel