提交 0b8c1720 编写于 作者: D Daniel P. Berrange

virsh: report errors in virshInit()

There are several functions in virshInit which can fail, especially
when running win32 builds under WINE. Currently virsh just exits
without reporting what error happened.
Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
上级 84490f20
......@@ -358,16 +358,22 @@ virshInit(vshControl *ctl)
/* set up the library error handler */
virSetErrorFunc(NULL, vshErrorHandler);
if (virEventRegisterDefaultImpl() < 0)
if (virEventRegisterDefaultImpl() < 0) {
vshReportError(ctl);
return false;
}
if (virThreadCreate(&ctl->eventLoop, true, vshEventLoop, ctl) < 0)
if (virThreadCreate(&ctl->eventLoop, true, vshEventLoop, ctl) < 0) {
vshReportError(ctl);
return false;
}
ctl->eventLoopStarted = true;
if ((ctl->eventTimerId = virEventAddTimeout(-1, vshEventTimeout, ctl,
NULL)) < 0)
NULL)) < 0) {
vshReportError(ctl);
return false;
}
if (ctl->connname) {
/* Connecting to a named connection must succeed, but we delay
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册