From: Bamvor Jian Zhang <bjzhang@suse.com>
To: xen-devel@lists.xen.org
Cc: jfehlig@suse.com, Bamvor Jian Zhang <bjzhang@suse.com>,
ian.jackson@eu.citrix.com, ian.campbell@citrix.com,
stefano.stabellini@eu.citrix.com
Subject: [PATCH 1/2] expose child fd in order to handle child exit in libvirt
Date: Tue, 5 Nov 2013 17:22:10 +0800 [thread overview]
Message-ID: <1383643331-6703-2-git-send-email-bjzhang@suse.com> (raw)
In-Reply-To: <1383643331-6703-1-git-send-email-bjzhang@suse.com>
libvirt could handle fd and timeout event through
libxl_osevent_hooks. either of these will not inform the child
exit if libvirt set the libxl_sigchld_owner_libxl_always.
add a function for returning the sigchld_selfpipe in order to
handle the child exit in libvirt.
meanwhile, there is only one pipe in ctx, it seems that it is
not worth to add this to libxl_osevent_hooks.
Signed-off-by: Bamvor Jian Zhang <bjzhang@suse.com>
---
tools/libxl/libxl.h | 2 ++
tools/libxl/libxl_fork.c | 5 +++++
2 files changed, 7 insertions(+)
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 1c6675d..11e1bc3 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -1071,6 +1071,8 @@ int libxl_flask_loadpolicy(libxl_ctx *ctx, void *policy, uint32_t size);
int libxl_fd_set_cloexec(libxl_ctx *ctx, int fd, int cloexec);
int libxl_fd_set_nonblock(libxl_ctx *ctx, int fd, int nonblock);
+int libxl_get_pipe_handle(libxl_ctx *ctx, int num);
+
#include <libxl_event.h>
#endif /* LIBXL_H */
diff --git a/tools/libxl/libxl_fork.c b/tools/libxl/libxl_fork.c
index 044ddad..1989258 100644
--- a/tools/libxl/libxl_fork.c
+++ b/tools/libxl/libxl_fork.c
@@ -418,6 +418,11 @@ int libxl__ev_child_xenstore_reopen(libxl__gc *gc, const char *what) {
return rc;
}
+int libxl_get_pipe_handle(libxl_ctx *ctx, int num)
+{
+ return ctx->sigchld_selfpipe[num];
+}
+
/*
* Local variables:
* mode: C
--
1.8.1.4
next prev parent reply other threads:[~2013-11-05 9:22 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-05 9:22 [PATCH 0/2] question on libxl ao Bamvor Jian Zhang
2013-11-05 9:22 ` Bamvor Jian Zhang [this message]
2013-11-05 16:05 ` [PATCH 0/2] question on libxl ao [and 1 more messages] Ian Jackson
2013-11-05 19:19 ` [PATCH 0/3] libxl: event system: SIGCHLD related fixes Ian Jackson
2013-11-05 19:19 ` [PATCH 1/3] libxl: event system: pass gc, not just ctx, to internal sigchld manipulators Ian Jackson
2013-11-06 10:30 ` Ian Campbell
2013-11-05 19:19 ` [PATCH 2/3] libxl: event system: Make libxl_sigchld_owner_libxl_always work Ian Jackson
2013-11-06 10:34 ` Ian Campbell
2013-11-05 19:19 ` [PATCH 3/3] libxl: event system: properly register the SIGCHLD self-pipe Ian Jackson
2013-11-06 10:36 ` Ian Campbell
2013-11-06 10:38 ` [PATCH 0/3] libxl: event system: SIGCHLD related fixes Ian Campbell
2013-11-06 12:08 ` Ian Jackson
2013-11-12 18:27 ` [PATCH v2 " Ian Jackson
2013-11-12 18:27 ` [PATCH 1/3] libxl: event system: pass gc, not just ctx, to internal sigchld manipulators Ian Jackson
2013-11-12 18:27 ` [PATCH 2/3] libxl: event system: Make libxl_sigchld_owner_libxl_always work Ian Jackson
2013-11-12 18:27 ` [PATCH 3/3] libxl: event system: properly register the SIGCHLD self-pipe Ian Jackson
2013-11-13 10:02 ` [PATCH v2 0/3] libxl: event system: SIGCHLD related fixes Ian Campbell
2013-11-21 18:49 ` Ian Jackson
2013-11-20 4:28 ` Jim Fehlig
2013-11-20 15:22 ` 答复: " Bamvor Jian Zhang
2013-11-20 16:40 ` 答复: Re: [PAT CH " Ian Jackson
2013-11-07 3:00 ` [PATCH 0/2] question on libxl ao [and 1 more messages] Bamvor Jian Zhang
2013-11-05 19:23 ` [PATCH 0/2] question on libxl ao [and 1 more messages] " Ian Jackson
2013-11-05 9:22 ` [PATCH 2/2] call ao_how callback explicitly Bamvor Jian Zhang
2013-11-05 15:51 ` Ian Jackson
2013-11-07 14:51 ` Bamvor Jian Zhang
2013-11-07 17:03 ` Ian Jackson
2013-11-08 13:17 ` Bamvor Jian Zhang
2013-11-08 16:07 ` Ian Jackson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1383643331-6703-2-git-send-email-bjzhang@suse.com \
--to=bjzhang@suse.com \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jfehlig@suse.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).