mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-27 15:05:17 +00:00
storage: Report errors in FindPoolSources
This commit is contained in:
parent
8fe128a46c
commit
e3f5dbcdf0
@ -440,15 +440,24 @@ storageFindPoolSources(virConnectPtr conn,
|
|||||||
char *ret = NULL;
|
char *ret = NULL;
|
||||||
|
|
||||||
backend_type = virStoragePoolTypeFromString(type);
|
backend_type = virStoragePoolTypeFromString(type);
|
||||||
if (backend_type < 0)
|
if (backend_type < 0) {
|
||||||
|
virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR,
|
||||||
|
_("unknown storage pool type %s"), type);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
backend = virStorageBackendForType(backend_type);
|
backend = virStorageBackendForType(backend_type);
|
||||||
if (backend == NULL)
|
if (backend == NULL)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (backend->findPoolSources)
|
if (!backend->findPoolSources) {
|
||||||
ret = backend->findPoolSources(conn, srcSpec, flags);
|
virStorageReportError(conn, VIR_ERR_NO_SUPPORT,
|
||||||
|
_("pool type '%s' does not support source "
|
||||||
|
"discovery"), type);
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = backend->findPoolSources(conn, srcSpec, flags);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user