diff options
author | Olaf Hering <olaf@aepfle.de> | 2011-10-27 11:19:22 +0200 |
---|---|---|
committer | Olaf Hering <olaf@aepfle.de> | 2011-10-27 11:19:22 +0200 |
commit | e5d6417e8abc1047a273dc48b40a90d2b9c7f5c0 (patch) | |
tree | 6c87779b5ccce54f56f2babbbe1213266d15e600 /tools/libxl/libxl_exec.c | |
parent | 0790b64cc8924bf590a1363cdeae69389ef1f1ba (diff) | |
download | xen-e5d6417e8abc1047a273dc48b40a90d2b9c7f5c0.tar.gz xen-e5d6417e8abc1047a273dc48b40a90d2b9c7f5c0.tar.bz2 xen-e5d6417e8abc1047a273dc48b40a90d2b9c7f5c0.zip |
libxl: rename dm_xenstore_record_pid to libxl_spawner_record_pid
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Diffstat (limited to 'tools/libxl/libxl_exec.c')
-rw-r--r-- | tools/libxl/libxl_exec.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tools/libxl/libxl_exec.c b/tools/libxl/libxl_exec.c index d6199d42ea..a91366ab2c 100644 --- a/tools/libxl/libxl_exec.c +++ b/tools/libxl/libxl_exec.c @@ -144,6 +144,31 @@ void libxl_report_child_exitstatus(libxl_ctx *ctx, } } +void libxl_spawner_record_pid(void *for_spawn, pid_t innerchild) +{ + libxl__spawner_starting *starting = for_spawn; + struct xs_handle *xsh; + char *path = NULL, *pid = NULL; + int len; + + if (asprintf(&path, "%s/%s", starting->dom_path, "image/device-model-pid") < 0) + goto out; + + len = asprintf(&pid, "%d", innerchild); + if (len < 0) + goto out; + + /* we mustn't use the parent's handle in the child */ + xsh = xs_daemon_open(); + + xs_write(xsh, XBT_NULL, path, pid, len); + + xs_daemon_close(xsh); +out: + free(path); + free(pid); +} + static int libxl__set_fd_flag(libxl__gc *gc, int fd, int flag) { int flags; |