xmlXPathContextPtr ctxt = NULL;
xmlNodePtr *nodes = NULL;
virStoragePoolSource *src = NULL;
+ char *volname;
size_t i;
int nnodes;
int ret = -1;
if (!(src = virStoragePoolSourceListNewSource(list)))
goto cleanup;
- if (!(src->dir = virXPathString("string(./name)", ctxt))) {
+ if (!(volname = virXPathString("string(./name)", ctxt))) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("failed to extract gluster volume name"));
goto cleanup;
}
- if (pooltype == VIR_STORAGE_POOL_NETFS)
+ if (pooltype == VIR_STORAGE_POOL_NETFS) {
src->format = VIR_STORAGE_POOL_NETFS_GLUSTERFS;
+ src->dir = volname;
+ } else if (pooltype == VIR_STORAGE_POOL_GLUSTER) {
+ src->name = volname;
+
+ if (VIR_STRDUP(src->dir, "/") < 0)
+ goto cleanup;
+ } else {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("unsupported gluster lookup"));
+ goto cleanup;
+ }
if (VIR_ALLOC_N(src->hosts, 1) < 0)
goto cleanup;