[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH]:libxl__get_free_memory_slack cannot return when creating a vm by xl


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • From: "Jun Zhu (Intern)" <Jun.Zhu@xxxxxxxxxx>
  • Date: Sun, 26 Sep 2010 19:30:12 +0100
  • Accept-language: en-US
  • Acceptlanguage: en-US
  • Cc: "Jun Zhu \(Intern\)" <Jun.Zhu@xxxxxxxxxx>
  • Delivery-date: Sun, 26 Sep 2010 11:31:22 -0700
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: AQHLXajbPTt/z1kZYEu+5klF6GZdzA==
  • Thread-topic: [PATCH]:libxl__get_free_memory_slack cannot return when creating a vm by xl

Hi,

This patch fixes the problem when xl create invokes 
libxl__get_free_memory_slack which does not return. In the 
libxl__fill_dom0_memory_info function, if */memory/target is existed, it 
returns directly, leaving */memory/freemem-slack still empty. 
I don't think it is necessory to check */memory/target in the function 
libxl__fill_dom0_memory_info, since this function is to fill the dom0’s memory 
info. Moreover, it is not correct to believe that */memory/freemem-slack exists 
by checking */memory/target. 

signed-off-by:Jun Zhu<Jun.Zhu@xxxxxxxxxx>

diff -r 0c102f92d61e tools/libxl/libxl.c
--- a/tools/libxl/libxl.c       Sun Sep 26 18:53:15 2010 +0100
+++ b/tools/libxl/libxl.c       Sun Sep 26 19:26:42 2010 +0100
@@ -2779,7 +2779,6 @@ static int libxl__fill_dom0_memory_info(
     int rc;
     libxl_dominfo info;
     libxl_physinfo physinfo;
-    char *target = NULL, *endptr = NULL;
     char *target_path = "/local/domain/0/memory/target";
     char *max_path = "/local/domain/0/memory/static-max";
     char *free_mem_slack_path = "/local/domain/0/memory/freemem-slack";
@@ -2790,19 +2789,6 @@ static int libxl__fill_dom0_memory_info(
 retry_transaction:
     t = xs_transaction_start(ctx->xsh);
 
-    target = libxl__xs_read(gc, t, target_path);
-    if (target) {
-        *target_memkb = strtoul(target, &endptr, 10);
-        if (*endptr != '\0') {
-            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
-                    "invalid memory target %s from %s\n", target, target_path);
-            rc = ERROR_FAIL;
-            goto out;
-        }
-        rc = 0;
-        goto out;
-    }
-
     rc = libxl_domain_info(ctx, &info, 0);
     if (rc < 0)
         return rc;
@@ -2827,12 +2813,10 @@ retry_transaction:
     *target_memkb = (uint32_t) info.current_memkb;
     rc = 0;
 
-out:
     if (!xs_transaction_end(ctx->xsh, t, 0))
         if (errno == EAGAIN)
             goto retry_transaction;
 
-
     return rc;
 }




Jun Zhu
Citrix Systems UK
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.