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 | |
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')
-rw-r--r-- | tools/libxl/libxl_dm.c | 27 | ||||
-rw-r--r-- | tools/libxl/libxl_exec.c | 25 | ||||
-rw-r--r-- | tools/libxl/libxl_internal.h | 4 |
3 files changed, 29 insertions, 27 deletions
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c index 84df8d0921..d579056e71 100644 --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -516,31 +516,6 @@ static char ** libxl__build_device_model_args(libxl__gc *gc, } } -static void dm_xenstore_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__vfb_and_vkb_from_device_model_info(libxl__gc *gc, libxl_device_model_info *info, libxl_device_vfb *vfb, @@ -896,7 +871,7 @@ retry_transaction: } rc = libxl__spawn_spawn(gc, p->for_spawn, "device model", - dm_xenstore_record_pid, p); + libxl_spawner_record_pid, p); if (rc < 0) goto out_close; if (!rc) { /* inner child */ 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; diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h index 0039ac7d82..e77ff23df9 100644 --- a/tools/libxl/libxl_internal.h +++ b/tools/libxl/libxl_internal.h @@ -267,7 +267,7 @@ typedef struct { } libxl__spawn_starting; typedef struct { - char *dom_path; /* from libxl_malloc, only for dm_xenstore_record_pid */ + char *dom_path; /* from libxl_malloc, only for libxl_spawner_record_pid */ int domid; libxl__spawn_starting *for_spawn; } libxl__spawner_starting; @@ -318,6 +318,8 @@ _hidden int libxl__spawn_spawn(libxl__gc *gc, void *hook_data); _hidden int libxl__destroy_device_model(libxl__gc *gc, uint32_t domid); +_hidden void libxl_spawner_record_pid(void *for_spawn, pid_t innerchild); + /* Logs errors. A copy of "what" is taken. Return values: * < 0 error, for_spawn need not be detached * +1 caller is the parent, must call detach on *for_spawn eventually |