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] libxl: change semantics of ctx_free and r

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] libxl: change semantics of ctx_free and remove ctx_close
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 30 Dec 2009 05:40:10 -0800
Delivery-date: Wed, 30 Dec 2009 05:40:09 -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 1262176844 0
# Node ID 042f50e7353f741bf3a22adb2616f83a6bd7651f
# Parent  3f654b88e201a1341786a0e8725c25f40c1162b7
libxl: change semantics of ctx_free and remove ctx_close

ctx_close isn't use anywhere, and free reallocate the GC array, which
is quite surprising and lead to memory leaking in xl.c

Signed-off-by: Vincent Hanquez <vincent.hanquez@xxxxxxxxxxxxx>
---
 tools/libxl/libxl.c |   10 ----------
 tools/libxl/libxl.h |    1 -
 2 files changed, 11 deletions(-)

diff -r 3f654b88e201 -r 042f50e7353f tools/libxl/libxl.c
--- a/tools/libxl/libxl.c       Tue Dec 29 15:11:47 2009 +0000
+++ b/tools/libxl/libxl.c       Wed Dec 30 12:40:44 2009 +0000
@@ -52,16 +52,6 @@ int libxl_ctx_free(struct libxl_ctx *ctx
 int libxl_ctx_free(struct libxl_ctx *ctx)
 {
     libxl_free_all(ctx);
-    free(ctx->alloc_ptrs);
-    ctx->alloc_ptrs = calloc(ctx->alloc_maxsize, sizeof(void *));
-    if (!ctx->alloc_ptrs)
-        return ERROR_NOMEM;
-    return 0;
-}
-
-int libxl_ctx_close(struct libxl_ctx *ctx)
-{
-    libxl_ctx_free(ctx);
     free(ctx->alloc_ptrs);
     xc_interface_close(ctx->xch);
     xs_daemon_close(ctx->xsh); 
diff -r 3f654b88e201 -r 042f50e7353f tools/libxl/libxl.h
--- a/tools/libxl/libxl.h       Tue Dec 29 15:11:47 2009 +0000
+++ b/tools/libxl/libxl.h       Wed Dec 30 12:40:44 2009 +0000
@@ -253,7 +253,6 @@ void xl_log(struct libxl_ctx *ctx, int e
 /* context functions */
 int libxl_ctx_init(struct libxl_ctx *ctx);
 int libxl_ctx_free(struct libxl_ctx *ctx);
-int libxl_ctx_close(struct libxl_ctx *ctx);
 int libxl_ctx_set_log(struct libxl_ctx *ctx, libxl_log_callback log_callback, 
void *log_data);
 
 /* domain related functions */

_______________________________________________
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] libxl: change semantics of ctx_free and remove ctx_close, Xen patchbot-unstable <=