diff options
author | Olaf Hering <olaf@aepfle.de> | 2011-10-27 11:23:29 +0200 |
---|---|---|
committer | Olaf Hering <olaf@aepfle.de> | 2011-10-27 11:23:29 +0200 |
commit | a0a7be4493620aa7935c322181665ceed7bb6657 (patch) | |
tree | 3bc9c9323e27d15c6d57be2dd777cf8a2a72e688 /tools/libxl/libxl_exec.c | |
parent | 05a3635760240a0b92014a6c77d35ac8b5231b52 (diff) | |
download | xen-a0a7be4493620aa7935c322181665ceed7bb6657.tar.gz xen-a0a7be4493620aa7935c322181665ceed7bb6657.tar.bz2 xen-a0a7be4493620aa7935c322181665ceed7bb6657.zip |
libxl: add libxl__spawn_confirm_offspring_startup
libxl__spawn_confirm_offspring_startup() is a generic version of
libxl__confirm_device_model_startup().
Use libxl__spawn_confirm_offspring_startup for device model.
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 | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tools/libxl/libxl_exec.c b/tools/libxl/libxl_exec.c index 6113f9ed0e..95151c07b1 100644 --- a/tools/libxl/libxl_exec.c +++ b/tools/libxl/libxl_exec.c @@ -262,6 +262,30 @@ err: return -1; } +static int detach_offspring(libxl__gc *gc, + libxl__spawner_starting *starting) +{ + int rc; + rc = libxl__spawn_detach(gc, starting->for_spawn); + if (starting->for_spawn) + free(starting->for_spawn); + free(starting); + return rc; +} + +int libxl__spawn_confirm_offspring_startup(libxl__gc *gc, + uint32_t timeout, char *what, + char *path, char *state, + libxl__spawner_starting *starting) +{ + int detach; + int problem = libxl__wait_for_offspring(gc, starting->domid, timeout, what, + path, state, + starting->for_spawn, NULL, NULL); + detach = detach_offspring(gc, starting); + return problem ? problem : detach; +} + static int libxl__set_fd_flag(libxl__gc *gc, int fd, int flag) { int flags; |