1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-20 06:50:22 +03:00

storage: Don't report OOM error on failure of glfs_new

OOM isn't the only failure glfs_new can encounter. Report an error which
might give more insight. libgfapi seems to be setting errno but
reporting a system error migt be misleading.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
This commit is contained in:
Peter Krempa 2021-02-24 10:22:52 +01:00
parent 0af84a81fc
commit 5591ba2889
2 changed files with 4 additions and 2 deletions

View File

@ -114,7 +114,8 @@ virStorageBackendGlusterOpen(virStoragePoolObjPtr pool)
/* Actually connect to glfs */
if (!(ret->vol = glfs_new(ret->volname))) {
virReportOOMError();
virReportError(VIR_ERR_OPERATION_FAILED,
_("failed to create glfs object for '%s'"), ret->volname);
goto error;
}

View File

@ -120,7 +120,8 @@ virStorageFileBackendGlusterInit(virStorageSourcePtr src)
(unsigned int)drv->uid, (unsigned int)drv->gid);
if (!(priv->vol = glfs_new(src->volume))) {
virReportOOMError();
virReportError(VIR_ERR_OPERATION_FAILED,
_("failed to create glfs object for '%s'"), src->volume);
goto error;
}