aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/xl.c
diff options
context:
space:
mode:
authorIan Jackson <ian.jackson@eu.citrix.com>2012-04-11 14:14:17 +0100
committerIan Jackson <ian.jackson@eu.citrix.com>2012-04-11 14:14:17 +0100
commit3d2a8f74e6a6067cfc67923d1bea58959427b753 (patch)
tree98286302132564db766b64a0ae0a9f2e57b0e83e /tools/libxl/xl.c
parent378e96065b390d217e2b381a218ccb7bbb5fbe1e (diff)
downloadxen-3d2a8f74e6a6067cfc67923d1bea58959427b753.tar.gz
xen-3d2a8f74e6a6067cfc67923d1bea58959427b753.tar.bz2
xen-3d2a8f74e6a6067cfc67923d1bea58959427b753.zip
libxl: abolish libxl_ctx_postfork
libxl's task has become too complicated (particularly in the presence of both forking and multithreading) to support reuse of the same libxl_ctx after fork. So abolish libxl_ctx_fork. xl instead simply initialises a new libxl_ctx. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Diffstat (limited to 'tools/libxl/xl.c')
-rw-r--r--tools/libxl/xl.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/libxl/xl.c b/tools/libxl/xl.c
index 2b148147f9..62c0abde96 100644
--- a/tools/libxl/xl.c
+++ b/tools/libxl/xl.c
@@ -94,6 +94,14 @@ static void parse_global_config(const char *configfile,
xlu_cfg_destroy(config);
}
+void postfork(void)
+{
+ if (libxl_ctx_alloc(&ctx, LIBXL_VERSION, 0, (xentoollog_logger*)logger)) {
+ fprintf(stderr, "cannot reinit xl context after fork\n");
+ exit(-1);
+ }
+}
+
int main(int argc, char **argv)
{
int opt = 0;