From: Peter Krempa Date: Wed, 24 Feb 2021 09:22:52 +0000 (+0100) Subject: storage: Don't report OOM error on failure of glfs_new X-Git-Tag: v7.2.0-rc1~270 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5591ba28896efc33fb936a133c70ddc1f8577f88;p=thirdparty%2Flibvirt.git 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 Reviewed-by: Laine Stump --- diff --git a/src/storage/storage_backend_gluster.c b/src/storage/storage_backend_gluster.c index 8de0cb8a6b..e673922df6 100644 --- a/src/storage/storage_backend_gluster.c +++ b/src/storage/storage_backend_gluster.c @@ -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; } diff --git a/src/storage_file/storage_file_backend_gluster.c b/src/storage_file/storage_file_backend_gluster.c index 9b3b783274..8c7a583886 100644 --- a/src/storage_file/storage_file_backend_gluster.c +++ b/src/storage_file/storage_file_backend_gluster.c @@ -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; }