提交 e20bf467 编写于 作者: J Jim Fehlig

libxl: rename libxlCreateDomEvents to libxlDomEventsRegister

libxlDomEventsRegister better reflects its purpose: register for
domain events from libxl.
上级 47fa97a7
...@@ -464,16 +464,16 @@ static const struct libxl_event_hooks ev_hooks = { ...@@ -464,16 +464,16 @@ static const struct libxl_event_hooks ev_hooks = {
}; };
/* /*
* Register domain events with libxenlight and insert event handles * Register for domain events emitted by libxl.
* in libvirt's event loop.
*/ */
static int static int
libxlCreateDomEvents(virDomainObjPtr vm) libxlDomEventsRegister(virDomainObjPtr vm)
{ {
libxlDomainObjPrivatePtr priv = vm->privateData; libxlDomainObjPrivatePtr priv = vm->privateData;
libxl_event_register_callbacks(priv->ctx, &ev_hooks, vm); libxl_event_register_callbacks(priv->ctx, &ev_hooks, vm);
/* Always enable domain death events */
if (libxl_evenable_domain_death(priv->ctx, vm->def->id, 0, &priv->deathW)) if (libxl_evenable_domain_death(priv->ctx, vm->def->id, 0, &priv->deathW))
goto error; goto error;
...@@ -700,7 +700,7 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm, ...@@ -700,7 +700,7 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
goto error; goto error;
} }
if (libxlCreateDomEvents(vm) < 0) if (libxlDomEventsRegister(vm) < 0)
goto error; goto error;
if (libxlDomainSetVcpuAffinities(driver, vm) < 0) if (libxlDomainSetVcpuAffinities(driver, vm) < 0)
...@@ -791,8 +791,8 @@ libxlReconnectDomain(virDomainObjPtr vm, ...@@ -791,8 +791,8 @@ libxlReconnectDomain(virDomainObjPtr vm,
if (virAtomicIntInc(&driver->nactive) == 1 && driver->inhibitCallback) if (virAtomicIntInc(&driver->nactive) == 1 && driver->inhibitCallback)
driver->inhibitCallback(true, driver->inhibitOpaque); driver->inhibitCallback(true, driver->inhibitOpaque);
/* Recreate domain death et. al. events */ /* Re-register domain death et. al. events */
libxlCreateDomEvents(vm); libxlDomEventsRegister(vm);
virObjectUnlock(vm); virObjectUnlock(vm);
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册