diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2009-12-01 14:03:42 +0000 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2009-12-01 14:03:42 +0000 |
commit | 6a56a7c67b4e6fbbb2988046c38822cc1b3dc4e3 (patch) | |
tree | 2c0557ed507f560aa26ddd8af41f4b4227cca09a /tools/libxl/libxl_exec.c | |
parent | 95b697252f765f9433c45f7115ed9ce0abcbf170 (diff) | |
download | xen-6a56a7c67b4e6fbbb2988046c38822cc1b3dc4e3.tar.gz xen-6a56a7c67b4e6fbbb2988046c38822cc1b3dc4e3.tar.bz2 xen-6a56a7c67b4e6fbbb2988046c38822cc1b3dc4e3.zip |
libxenlight: wait for pv qemu initialization
this patch makes libxl_create_stubdom wait for pv qemu to be properly
initialized before unpausing the stubdom.
A new libxl_device_model_starting pointer is used to wait for pv qemu
initialization while the libxl_device_model_starting pointer given by
the user is initialized to a new structure with an empty for_spawn
member, because nothing that was spawn has to be waited for anymore.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Diffstat (limited to 'tools/libxl/libxl_exec.c')
-rw-r--r-- | tools/libxl/libxl_exec.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/libxl/libxl_exec.c b/tools/libxl/libxl_exec.c index de79b64e73..52af20231e 100644 --- a/tools/libxl/libxl_exec.c +++ b/tools/libxl/libxl_exec.c @@ -99,7 +99,7 @@ pid_t libxl_waitpid_instead_default(pid_t pid, int *status, int flags) { int libxl_spawn_spawn(struct libxl_ctx *ctx, - struct libxl_spawn_starting *for_spawn, + libxl_device_model_starting *starting, const char *what, void (*intermediate_hook)(struct libxl_ctx *ctx, void *for_spawn, @@ -107,9 +107,10 @@ int libxl_spawn_spawn(struct libxl_ctx *ctx, pid_t child, got; int status; pid_t intermediate; + struct libxl_spawn_starting *for_spawn = starting->for_spawn; if (for_spawn) { - for_spawn->what= strdup(what); + for_spawn->what= libxl_sprintf(ctx, "%s", what); if (!for_spawn->what) return ERROR_NOMEM; } @@ -130,7 +131,7 @@ int libxl_spawn_spawn(struct libxl_ctx *ctx, if (!child) return 0; /* caller runs child code */ if (child<0) exit(255); - intermediate_hook(ctx, for_spawn, child); + intermediate_hook(ctx, starting, child); if (!for_spawn) _exit(0); /* just detach then */ |