info->id = virEventAddHandle(fd, vir_events, libxlFDEventCallback,
info, libxlOSEventHookInfoFree);
if (info->id < 0) {
+ VIR_WARN("Failed to add event watch for FD %d", fd);
VIR_FREE(info);
return -1;
}
info->id = virEventAddTimeout(timeout, libxlTimerCallback,
info, libxlOSEventHookInfoFree);
if (info->id < 0) {
+ VIR_WARN("Failed to add event timer callback");
VIR_FREE(info);
return -1;
}
handler->cleanup_log_timer = virEventAddTimeout(CLEANER_LOG_TIMEOUT_MS,
virLogCleanerTimer,
handler, NULL);
+ if (handler->cleanup_log_timer < 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Unable to add log cleanup timer"));
+ }
return handler->cleanup_log_timer;
}
virLogHandlerDomainLogFileEvent,
handler,
NULL)) < 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to add watch on log FD %1$d"), file->pipefd);
VIR_DELETE_ELEMENT(handler->files, handler->nfiles - 1, handler->nfiles);
goto error;
}
virLogHandlerDomainLogFileEvent,
handler,
NULL)) < 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to add watch on log FD %1$d"), file->pipefd);
VIR_DELETE_ELEMENT(handler->files, handler->nfiles - 1, handler->nfiles);
goto error;
}
if ((ctrl->timerShutdown = virEventAddTimeout(-1,
virLXCControllerQuitTimer, ctrl,
- NULL)) < 0)
+ NULL)) < 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Unable to add shutdown timer"));
goto error;
+ }
cleanup:
virLXCControllerDriverFree(driver);
virEventRemoveTimeout(data->mdevctlTimeout);
data->mdevctlTimeout = virEventAddTimeout(100, submitMdevctlUpdate,
data, NULL);
+ if (data->mdevctlTimeout < 0) {
+ VIR_WARN("Unable to add mdev update timer");
+ }
}
priv->watch = virEventAddHandle(udev_monitor_get_fd(priv->udev_monitor),
VIR_EVENT_HANDLE_READABLE,
udevEventHandleCallback, virObjectRef(priv), virObjectUnref);
- if (priv->watch == -1)
+ if (priv->watch == -1) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to add watch on udev FD %1$d"),
+ udev_monitor_get_fd(priv->udev_monitor));
goto unlock;
+ }
if (mdevctlEnableMonitor(priv) < 0)
goto unlock;
VIR_EVENT_HANDLE_READABLE,
virRemoteSSHHelperEventOnStdin,
&proxy,
- NULL)) < 0)
+ NULL)) < 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Unable to add watch on stdin"));
goto cleanup;
+ }
if ((proxy.stdoutWatch = virEventAddHandle(STDOUT_FILENO,
0,
virRemoteSSHHelperEventOnStdout,
&proxy,
- NULL)) < 0)
+ NULL)) < 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Unable to add watch on stdout"));
goto cleanup;
+ }
if (virNetSocketAddIOCallback(proxy.sock,
VIR_EVENT_HANDLE_READABLE,
ka->intervalStart = now - (ka->interval - timeout);
ka->timer = virEventAddTimeout(timeout * 1000, virKeepAliveTimer,
ka, virObjectUnref);
- if (ka->timer < 0)
+ if (ka->timer < 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Unable to add keepalive timer"));
goto cleanup;
+ }
/* the timer now has another reference to this object */
virObjectRef(ka);
virNetClientStreamEventTimer,
st,
virObjectUnref)) < 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Unable to add timer to event loop"));
virObjectUnref(st);
goto cleanup;
}
client->sockTimer = virEventAddTimeout(-1, virNetServerClientSockTimerFunc,
client, NULL);
- if (client->sockTimer < 0)
+ if (client->sockTimer < 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Unable to add socket timer"));
goto error;
+ }
/* Prepare one for packet receive */
if (!(client->rx = virNetMessageNew(true)))
svc->timer = virEventAddTimeout(-1, virNetServerServiceTimerFunc,
svc, virObjectUnref);
if (svc->timer < 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Unable to add service timer"));
virObjectUnref(svc);
goto error;
}