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 11/14]: libxenlight, write vcpu availability paths in

To: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 11/14]: libxenlight, write vcpu availability paths in xenstore
From: Andres Lagar-Cavilla <andres@xxxxxxxxxxxxxxxx>
Date: Mon, 30 Nov 2009 14:16:34 -0500
Cc:
Delivery-date: Mon, 30 Nov 2009 11:18:12 -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)
Write cpu availability paths to xenstore. Otherwise,
no vcpus other than the first are enabled.

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


# HG changeset patch
# User Andres Lagar-Cavilla <andres@xxxxxxxxxxxxxxxx>
# Date 1259434282 18000
# Node ID e350e5449b66b63eaf4ab13e3b418473cd5e7827
# Parent  9c274dac208ff294bf1d31646910e472cf95cb60
Write cpu availability paths to xenstore. Otherwise, 
no vcpus other than the first are enabled.

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

diff -r 9c274dac208f -r e350e5449b66 libxl_dom.c
--- a/libxl_dom.c
+++ b/libxl_dom.c
@@ -74,8 +74,9 @@ int build_post(struct libxl_ctx *ctx, ui
     char *dom_path, *vm_path;
     xs_transaction_t t;
     char **ents;
+    int i;
 
-    ents = libxl_calloc(ctx, 10 * 2, sizeof(char *));
+    ents = libxl_calloc(ctx, (10 + info->max_vcpus) * 2, sizeof(char *));
     ents[0] = "memory/static-max";
     ents[1] = libxl_sprintf(ctx, "%d", info->max_memkb);
     ents[2] = "memory/target";
@@ -86,6 +87,10 @@ int build_post(struct libxl_ctx *ctx, ui
     ents[7] = libxl_sprintf(ctx, "%"PRIu32, state->store_port);
     ents[8] = "store/ring-ref";
     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";
+    }
 
     dom_path = libxl_xs_get_dompath(ctx, domid);
     if (!dom_path)
@@ -104,6 +109,8 @@ retry_transaction:
             goto retry_transaction;
     xs_introduce_domain(ctx->xsh, domid, state->store_mfn, state->store_port);
     free(vm_path);
+    libxl_free(ctx, ents);
+    libxl_free(ctx, dom_path);
     return 0;
 }
 
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH 11/14]: libxenlight, write vcpu availability paths in xenstore, Andres Lagar-Cavilla <=