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-changelog

[Xen-changelog] [xen-unstable] libxenlight: do not try to set memory tar

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] libxenlight: do not try to set memory target with a number we haven't
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 11 Jan 2010 23:25:29 -0800
Delivery-date: Mon, 11 Jan 2010 23:25:52 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1263279794 0
# Node ID 55109e7326cc47b95eaa43f8038e18026746048d
# Parent  3edbffaab2069e4eaa3f866a24819b906fa6093b
libxenlight: do not try to set memory target with a number we haven't
verified in set-mem.

checking that memory string conversion what done properly instead of
sending a request to balloon a domain to 0 memory.

Signed-off-by: Vincent Hanquez <vincent.hanquez@xxxxxxxxxxxxx>
---
 tools/libxl/xl.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletion(-)

diff -r 3edbffaab206 -r 55109e7326cc tools/libxl/xl.c
--- a/tools/libxl/xl.c  Tue Jan 12 07:02:29 2010 +0000
+++ b/tools/libxl/xl.c  Tue Jan 12 07:03:14 2010 +0000
@@ -993,6 +993,8 @@ void set_memory_target(char *p, char *me
 {
     struct libxl_ctx ctx;
     uint32_t domid;
+    uint32_t memorykb;
+    char *endptr;
 
     if (libxl_ctx_init(&ctx, LIBXL_VERSION)) {
         fprintf(stderr, "cannot init xl context\n");
@@ -1004,7 +1006,13 @@ void set_memory_target(char *p, char *me
         fprintf(stderr, "%s is an invalid domain identifier\n", p);
         exit(2);
     }
-    libxl_set_memory_target(&ctx, domid, atoi(mem));
+    memorykb = strtoul(mem, &endptr, 10);
+    if (*endptr != '\0') {
+        fprintf(stderr, "invalid memory size: %s\n", mem);
+        exit(3);
+    }
+    printf("setting domid %d memory to : %d\n", domid, memorykb);
+    libxl_set_memory_target(&ctx, domid, memorykb);
 }
 
 int main_memset(int argc, char **argv)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] libxenlight: do not try to set memory target with a number we haven't, Xen patchbot-unstable <=