mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-01 17:35:17 +00:00
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: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
84490f20b0
commit
0b8c17203e
@ -358,16 +358,22 @@ virshInit(vshControl *ctl)
|
|||||||
/* set up the library error handler */
|
/* set up the library error handler */
|
||||||
virSetErrorFunc(NULL, vshErrorHandler);
|
virSetErrorFunc(NULL, vshErrorHandler);
|
||||||
|
|
||||||
if (virEventRegisterDefaultImpl() < 0)
|
if (virEventRegisterDefaultImpl() < 0) {
|
||||||
|
vshReportError(ctl);
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (virThreadCreate(&ctl->eventLoop, true, vshEventLoop, ctl) < 0)
|
if (virThreadCreate(&ctl->eventLoop, true, vshEventLoop, ctl) < 0) {
|
||||||
|
vshReportError(ctl);
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
ctl->eventLoopStarted = true;
|
ctl->eventLoopStarted = true;
|
||||||
|
|
||||||
if ((ctl->eventTimerId = virEventAddTimeout(-1, vshEventTimeout, ctl,
|
if ((ctl->eventTimerId = virEventAddTimeout(-1, vshEventTimeout, ctl,
|
||||||
NULL)) < 0)
|
NULL)) < 0) {
|
||||||
|
vshReportError(ctl);
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (ctl->connname) {
|
if (ctl->connname) {
|
||||||
/* Connecting to a named connection must succeed, but we delay
|
/* Connecting to a named connection must succeed, but we delay
|
||||||
|
Loading…
x
Reference in New Issue
Block a user