提交 ce5055d7 编写于 作者: P Peter Krempa

storage: gluster: Report error if no volumes were found in pool lookup

Similarly to the 'netfs' pool, return an error if the host does not have
any volumes.
上级 7bdb4b8f
......@@ -490,6 +490,7 @@ virStorageBackendGlusterFindPoolSources(virConnectPtr conn ATTRIBUTE_UNUSED,
};
virStoragePoolSourcePtr source = NULL;
char *ret = NULL;
int rc;
size_t i;
virCheckFlags(0, NULL);
......@@ -510,11 +511,18 @@ virStorageBackendGlusterFindPoolSources(virConnectPtr conn ATTRIBUTE_UNUSED,
goto cleanup;
}
if (virStorageBackendFindGlusterPoolSources(source->hosts[0].name,
0, /* currently ignored */
&list) < 0)
if ((rc = virStorageBackendFindGlusterPoolSources(source->hosts[0].name,
0, /* currently ignored */
&list)) < 0)
goto cleanup;
if (rc == 0) {
virReportError(VIR_ERR_OPERATION_FAILED,
_("no storage pools were found on host '%s'"),
source->hosts[0].name);
goto cleanup;
}
if (!(ret = virStoragePoolSourceListFormat(&list)))
goto cleanup;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册