aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/libxl_utils.c
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2011-03-15 18:20:46 +0000
committerIan Campbell <ian.campbell@citrix.com>2011-03-15 18:20:46 +0000
commiteca0cebba197edbc6aa452c86e8019ab8b955c81 (patch)
treec247db45b9291d2e8f66aee6416242413150a622 /tools/libxl/libxl_utils.c
parentd9e46835ab53a135e979cb7eb6febc5dc6f71a85 (diff)
downloadxen-eca0cebba197edbc6aa452c86e8019ab8b955c81.tar.gz
xen-eca0cebba197edbc6aa452c86e8019ab8b955c81.tar.bz2
xen-eca0cebba197edbc6aa452c86e8019ab8b955c81.zip
libxl: Make all hidden/static functions take a gc not a ctx
Also ensure that static and hidden functions use the libxl__ prefix not just libxl_ (in the case of static functions only when they use a libxl prefix to start with). This follows the policy described in libxl.h "libxl memory management". Based on a manual audit of: grep ^static tools/libxl/libxl*.[ch]| grep libxl_ctx grep libxl__ tools/libxl/*.h| grep libxl_ctx Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/libxl/libxl_utils.c')
-rw-r--r--tools/libxl/libxl_utils.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/libxl/libxl_utils.c b/tools/libxl/libxl_utils.c
index d13ae65821..37c50f2500 100644
--- a/tools/libxl/libxl_utils.c
+++ b/tools/libxl/libxl_utils.c
@@ -223,7 +223,9 @@ out:
return ret;
}
-static int logrename(libxl_ctx *ctx, const char *old, const char *new) {
+static int logrename(libxl__gc *gc, const char *old, const char *new)
+{
+ libxl_ctx *ctx = libxl__gc_owner(gc);
int r;
r = rename(old, new);
@@ -252,14 +254,14 @@ int libxl_create_logfile(libxl_ctx *ctx, char *name, char **full_name)
for (i = 9; i > 0; i--) {
logfile = libxl__sprintf(&gc, "/var/log/xen/%s.log.%d", name, i);
logfile_new = libxl__sprintf(&gc, "/var/log/xen/%s.log.%d", name, i + 1);
- rc = logrename(ctx, logfile, logfile_new);
+ rc = logrename(&gc, logfile, logfile_new);
if (rc)
goto out;
}
logfile = libxl__sprintf(&gc, "/var/log/xen/%s.log", name);
logfile_new = libxl__sprintf(&gc, "/var/log/xen/%s.log.1", name);
- rc = logrename(ctx, logfile, logfile_new);
+ rc = logrename(&gc, logfile, logfile_new);
if (rc)
goto out;
} else {