提交 e3f5dbcd 编写于 作者: C Cole Robinson

storage: Report errors in FindPoolSources

上级 8fe128a4
......@@ -440,15 +440,24 @@ storageFindPoolSources(virConnectPtr conn,
char *ret = NULL;
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;
}
backend = virStorageBackendForType(backend_type);
if (backend == NULL)
goto cleanup;
if (backend->findPoolSources)
ret = backend->findPoolSources(conn, srcSpec, flags);
if (!backend->findPoolSources) {
virStorageReportError(conn, VIR_ERR_NO_SUPPORT,
_("pool type '%s' does not support source "
"discovery"), type);
goto cleanup;
}
ret = backend->findPoolSources(conn, srcSpec, flags);
cleanup:
return ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册