mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-08 12:41:29 +00:00
vbox: Report an error when VBox CAPI initialization fails
If initialization of VBOX fails inside of _pfnInitialize an negative value is returned to signal an error condition to a caller but no error message is printed out. Reporting an error may shed more light into why VBOX failed to initialize. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
10320ad526
commit
5ca7f27f75
@ -429,13 +429,18 @@ static int _pfnInitialize(struct _vboxDriver *driver)
|
||||
{
|
||||
nsresult rc;
|
||||
|
||||
if (!(driver->pFuncs = g_pfnGetFunctions(VBOX_XPCOMC_VERSION)))
|
||||
if (!(driver->pFuncs = g_pfnGetFunctions(VBOX_XPCOMC_VERSION))) {
|
||||
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
|
||||
_("Unable to get pointer to VirtualBox vtable"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
rc = driver->pFuncs->pfnClientInitialize(IVIRTUALBOXCLIENT_IID_STR,
|
||||
&driver->vboxClient);
|
||||
|
||||
if (NS_FAILED(rc)) {
|
||||
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
|
||||
_("Unable to initialize VirtualBox C API client"));
|
||||
return -1;
|
||||
} else {
|
||||
driver->vboxClient->vtbl->GetVirtualBox(driver->vboxClient, &driver->vboxObj);
|
||||
|
Loading…
x
Reference in New Issue
Block a user