diff options
author | Ian Jackson <ian.jackson@eu.citrix.com> | 2012-05-11 18:59:06 +0100 |
---|---|---|
committer | Ian Jackson <ian.jackson@eu.citrix.com> | 2012-05-11 18:59:06 +0100 |
commit | b71db3824995ca27b106a2d9fab1a24f93244a4f (patch) | |
tree | 4febbd9b3677745cfb28f740eec744bccd729c19 /tools/libxl/libxl.h | |
parent | 172af31d56bad27a570c3f4e2bd1e82083afa0b0 (diff) | |
download | xen-b71db3824995ca27b106a2d9fab1a24f93244a4f.tar.gz xen-b71db3824995ca27b106a2d9fab1a24f93244a4f.tar.bz2 xen-b71db3824995ca27b106a2d9fab1a24f93244a4f.zip |
libxl: convert console callback to libxl_asyncprogress_how
Remove the old console callback. (Its reentrancy properties were
troublesome: in principle, the event loop might be reentered during
the callback, and the libxl__domain_create_state swept out from under
the feet of the domain creation.)
As a side effect of the new code arrangements, the console callback
for non-bootloader-using PV guests now occurs near the end of domain
creation, in the same place as for HVM guests, rather than near the
start.
The new arrangements should in principle mean that by the time the
console is described as ready by the callback, the xenstore key is
indeed ready. So in the future the timeout might be removed from
the console client.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Diffstat (limited to 'tools/libxl/libxl.h')
-rw-r--r-- | tools/libxl/libxl.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h index ba0f4dee4b..979940a14b 100644 --- a/tools/libxl/libxl.h +++ b/tools/libxl/libxl.h @@ -509,18 +509,19 @@ int libxl_ctx_alloc(libxl_ctx **pctx, int version, int libxl_ctx_free(libxl_ctx *ctx /* 0 is OK */); /* domain related functions */ -typedef int (*libxl_console_ready)(libxl_ctx *ctx, uint32_t domid, void *priv); - /* fixme-ao Need to review this API. If we keep it, the reentrancy - * properties need to be documented but they may turn out to be too - * awkward */ int libxl_domain_create_new(libxl_ctx *ctx, libxl_domain_config *d_config, - libxl_console_ready cb, void *priv, uint32_t *domid, - const libxl_asyncop_how *ao_how); + uint32_t *domid, + const libxl_asyncop_how *ao_how, + const libxl_asyncprogress_how *aop_console_how); int libxl_domain_create_restore(libxl_ctx *ctx, libxl_domain_config *d_config, - libxl_console_ready cb, void *priv, uint32_t *domid, int restore_fd, - const libxl_asyncop_how *ao_how); + const libxl_asyncop_how *ao_how, + const libxl_asyncprogress_how *aop_console_how); + /* A progress report will be made via ao_console_how, of type + * domain_create_console_available, when the domain's primary + * console is available and can be connected to. + */ void libxl_domain_config_init(libxl_domain_config *d_config); void libxl_domain_config_dispose(libxl_domain_config *d_config); |