提交 331a02a7 编写于 作者: J Jim Fehlig

libxl: Move setup of child processing code to driver initialization

Informing libxl how to handle its child proceses should be done once
during driver initialization, not once for each domain-specific
libxl_ctx object.  The related libxl documentation in
$xen-src/tools/libxl/libxl_event.h even mentions that "it is best to
call this at initialisation".
Signed-off-by: NJim Fehlig <jfehlig@suse.com>
上级 57db83ae
......@@ -536,14 +536,6 @@ const struct libxl_event_hooks ev_hooks = {
.disaster = NULL,
};
static const libxl_childproc_hooks libxl_child_hooks = {
#ifdef LIBXL_HAVE_SIGCHLD_OWNER_SELECTIVE_REAP
.chldowner = libxl_sigchld_owner_libxl_always_selective_reap,
#else
.chldowner = libxl_sigchld_owner_libxl,
#endif
};
int
libxlDomainObjPrivateInitCtx(virDomainObjPtr vm)
{
......@@ -580,8 +572,6 @@ libxlDomainObjPrivateInitCtx(virDomainObjPtr vm)
goto cleanup;
}
libxl_childproc_setmode(priv->ctx, &libxl_child_hooks, priv);
ret = 0;
cleanup:
......
......@@ -473,6 +473,14 @@ static const libxl_osevent_hooks libxl_osevent_callbacks = {
.timeout_deregister = libxlTimeoutDeregisterEventHook,
};
static const libxl_childproc_hooks libxl_child_hooks = {
#ifdef LIBXL_HAVE_SIGCHLD_OWNER_SELECTIVE_REAP
.chldowner = libxl_sigchld_owner_libxl_always_selective_reap,
#else
.chldowner = libxl_sigchld_owner_libxl,
#endif
};
static int
libxlStateInitialize(bool privileged,
virStateInhibitCallback callback ATTRIBUTE_UNUSED,
......@@ -521,6 +529,9 @@ libxlStateInitialize(bool privileged,
/* Register the callbacks providing access to libvirt's event loop */
libxl_osevent_register_hooks(cfg->ctx, &libxl_osevent_callbacks, cfg->ctx);
/* Setup child process handling. See $xen-src/tools/libxl/libxl_event.h */
libxl_childproc_setmode(cfg->ctx, &libxl_child_hooks, cfg->ctx);
libxl_driver->config = cfg;
if (virFileMakePath(cfg->stateDir) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册