WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 13/14]: libxenlight, enables less than maximum vcpus

To: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 13/14]: libxenlight, enables less than maximum vcpus
From: Andres Lagar-Cavilla <andres@xxxxxxxxxxxxxxxx>
Date: Mon, 30 Nov 2009 14:17:42 -0500
Cc:
Delivery-date: Mon, 30 Nov 2009 11:19:39 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.23 (X11/20090817)
Enable turning on a different amount of vcpus than
the maximum during domain creation/restore.

Signed-off-by: Andres Lagar-Cavilla <andres@xxxxxxxxxxxxxxxx>

# HG changeset patch
# User Andres Lagar-Cavilla <andres@xxxxxxxxxxxxxxxx>
# 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 <andres@xxxxxxxxxxxxxxxx>

diff -r 5527664fbd0e -r 0767f0bcfec1 libxl.h
--- a/libxl.h
+++ b/libxl.h
@@ -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;
diff -r 5527664fbd0e -r 0767f0bcfec1 libxl_dom.c
--- a/libxl_dom.c
+++ b/libxl_dom.c
@@ -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
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH 13/14]: libxenlight, enables less than maximum vcpus, Andres Lagar-Cavilla <=