mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-21 19:02:25 +00:00
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.
This commit is contained in:
parent
7bdb4b8fda
commit
ce5055d7bc
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user