From nobody Sun Feb 8 18:09:07 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1490886791831868.681302452124; Thu, 30 Mar 2017 08:13:11 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7812FC0528AC; Thu, 30 Mar 2017 15:12:14 +0000 (UTC) Received: from colo-mx.corp.redhat.com (unknown [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3030C5B83A; Thu, 30 Mar 2017 15:12:14 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id DBFD55EC66; Thu, 30 Mar 2017 15:12:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v2UFBwHb004193 for ; Thu, 30 Mar 2017 11:11:58 -0400 Received: by smtp.corp.redhat.com (Postfix) id C0DBE7DE2E; Thu, 30 Mar 2017 15:11:58 +0000 (UTC) Received: from angien.brq.redhat.com (dhcp129-47.brq.redhat.com [10.34.129.47]) by smtp.corp.redhat.com (Postfix) with ESMTP id 203E35B82D; Thu, 30 Mar 2017 15:11:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 7812FC0528AC Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 7812FC0528AC From: Peter Krempa To: libvir-list@redhat.com Date: Thu, 30 Mar 2017 17:12:49 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH v2 5/5] storage: gluster: Use volume name as "" field in the XML X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 30 Mar 2017 15:12:15 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" For native gluster pools the field denotes a directory inside the pool. For the actual pool name the field has to be used. --- src/storage/storage_util.c | 15 +++++++++++= +--- tests/virstorageutildata/gluster-parse-basic-native.xml | 3 ++- .../virstorageutildata/gluster-parse-multivol-native.xml | 9 ++++++--- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c index 19c73497f..241b6890a 100644 --- a/src/storage/storage_util.c +++ b/src/storage/storage_util.c @@ -2846,6 +2846,7 @@ virStorageUtilGlusterExtractPoolSources(const char *h= ost, xmlXPathContextPtr ctxt =3D NULL; xmlNodePtr *nodes =3D NULL; virStoragePoolSource *src =3D NULL; + char *volname; size_t i; int nnodes; int ret =3D -1; @@ -2862,12 +2863,22 @@ virStorageUtilGlusterExtractPoolSources(const char = *host, if (!(src =3D virStoragePoolSourceListNewSource(list))) goto cleanup; - if (!(src->dir =3D virXPathString("string(./name)", ctxt))) { + if (!(volname =3D virXPathString("string(./name)", ctxt))) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("failed to extract gluster volume name")); goto cleanup; } + if (netfs) { + src->format =3D VIR_STORAGE_POOL_NETFS_GLUSTERFS; + src->dir =3D volname; + } else { + src->name =3D volname; + + if (VIR_STRDUP(src->dir, "/") < 0) + goto cleanup; + } + if (VIR_ALLOC_N(src->hosts, 1) < 0) goto cleanup; src->nhost =3D 1; @@ -2875,8 +2886,6 @@ virStorageUtilGlusterExtractPoolSources(const char *h= ost, if (VIR_STRDUP(src->hosts[0].name, host) < 0) goto cleanup; - if (netfs) - src->format =3D VIR_STORAGE_POOL_NETFS_GLUSTERFS; } ret =3D nnodes; diff --git a/tests/virstorageutildata/gluster-parse-basic-native.xml b/test= s/virstorageutildata/gluster-parse-basic-native.xml index fbde06f3b..895d0f3fd 100644 --- a/tests/virstorageutildata/gluster-parse-basic-native.xml +++ b/tests/virstorageutildata/gluster-parse-basic-native.xml @@ -1,6 +1,7 @@ - + + vol0 diff --git a/tests/virstorageutildata/gluster-parse-multivol-native.xml b/t= ests/virstorageutildata/gluster-parse-multivol-native.xml index d2d8fefc6..c758ac5aa 100644 --- a/tests/virstorageutildata/gluster-parse-multivol-native.xml +++ b/tests/virstorageutildata/gluster-parse-multivol-native.xml @@ -1,14 +1,17 @@ - + + aaa - + + test - + + test1 --=20 2.12.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list