From nobody Mon Feb 9 09:15:51 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 14913084939231001.9787991149016; Tue, 4 Apr 2017 05:21:33 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8425B61D24; Tue, 4 Apr 2017 12:21:31 +0000 (UTC) Received: from colo-mx.corp.redhat.com (unknown [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 570C97E4FF; Tue, 4 Apr 2017 12:21:31 +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 0E94CB3484; Tue, 4 Apr 2017 12:21:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v34CKCTa007137 for ; Tue, 4 Apr 2017 08:20:12 -0400 Received: by smtp.corp.redhat.com (Postfix) id 23D6A84739; Tue, 4 Apr 2017 12:20:12 +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 4CA968400E; Tue, 4 Apr 2017 12:20:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8425B61D24 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.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 8425B61D24 From: Peter Krempa To: libvir-list@redhat.com Date: Tue, 4 Apr 2017 14:20:59 +0200 Message-Id: <367c38394f8164684daf01d5477ede1503ba6d2d.1491308364.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: Peter Krempa , abologna@redhat.com Subject: [libvirt] [PATCH v3 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 04 Apr 2017 12:21:33 +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 | 16 ++++++++++++= ++-- tests/virstorageutildata/gluster-parse-basic-native.xml | 3 ++- .../virstorageutildata/gluster-parse-multivol-native.xml | 9 ++++++--- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c index 1e44a2da4..7cc125a38 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,14 +2863,25 @@ 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 (pooltype =3D=3D VIR_STORAGE_POOL_NETFS) + if (pooltype =3D=3D VIR_STORAGE_POOL_NETFS) { src->format =3D VIR_STORAGE_POOL_NETFS_GLUSTERFS; + src->dir =3D volname; + } else if (pooltype =3D=3D VIR_STORAGE_POOL_GLUSTER) { + src->name =3D 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; 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.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list