From nobody Sun Feb 8 13:32:48 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 1490886770272150.98329307909796; Thu, 30 Mar 2017 08:12:50 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9EF1DC057FA7; Thu, 30 Mar 2017 15:12:01 +0000 (UTC) Received: from colo-mx.corp.redhat.com (unknown [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 71A8217AFA; Thu, 30 Mar 2017 15:12:01 +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 B4C865EC62; Thu, 30 Mar 2017 15:11:57 +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 v2UFBsSP004162 for ; Thu, 30 Mar 2017 11:11:54 -0400 Received: by smtp.corp.redhat.com (Postfix) id 834CC7DE2E; Thu, 30 Mar 2017 15:11:54 +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 D8DE65B82D; Thu, 30 Mar 2017 15:11:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9EF1DC057FA7 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.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 9EF1DC057FA7 From: Peter Krempa To: libvir-list@redhat.com Date: Thu, 30 Mar 2017 17:12:45 +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 1/5] storage: util: Add boolean differentiating between gluster lookup type 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 30 Mar 2017 15:12:02 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The native gluster pool source list data differs from the data used for attaching gluster volumes as netfs pools. Currently the only difference was the format. Since native pools don't use it and later there will be more difference add a boolean to swithc between the types instead. --- src/storage/storage_backend_fs.c | 5 ++--- src/storage/storage_backend_gluster.c | 3 +-- src/storage/storage_util.c | 10 +++++++--- src/storage/storage_util.h | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend= _fs.c index 1fc127a8c..a1b45e149 100644 --- a/src/storage/storage_backend_fs.c +++ b/src/storage/storage_backend_fs.c @@ -185,9 +185,8 @@ virStorageBackendFileSystemNetFindPoolSources(virConnec= tPtr conn ATTRIBUTE_UNUSE retNFS =3D virStorageBackendFileSystemNetFindNFSPoolSources(&state); - retGluster =3D virStorageBackendFindGlusterPoolSources(state.host, - VIR_STORAGE_POOL_= NETFS_GLUSTERFS, - &state.list, fals= e); + retGluster =3D virStorageBackendFindGlusterPoolSources(state.host, &st= ate.list, + true, false); if (retGluster < 0) goto cleanup; diff --git a/src/storage/storage_backend_gluster.c b/src/storage/storage_ba= ckend_gluster.c index 52c9ee372..cde7f9edb 100644 --- a/src/storage/storage_backend_gluster.c +++ b/src/storage/storage_backend_gluster.c @@ -513,8 +513,7 @@ virStorageBackendGlusterFindPoolSources(virConnectPtr c= onn ATTRIBUTE_UNUSED, } if ((rc =3D virStorageBackendFindGlusterPoolSources(source->hosts[0].n= ame, - 0, /* currently igno= red */ - &list, true)) < 0) + &list, false, true))= < 0) goto cleanup; if (rc =3D=3D 0) { diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c index 7687eb89a..cad706199 100644 --- a/src/storage/storage_util.c +++ b/src/storage/storage_util.c @@ -2839,18 +2839,21 @@ virStorageBackendDeleteLocal(virConnectPtr conn ATT= RIBUTE_UNUSED, /** * virStorageBackendFindGlusterPoolSources: * @host: host to detect volumes on - * @pooltype: src->format is set to this value * @list: list of storage pool sources to be filled + * @netfs: lookup will be used with netfs pools * @report: report error if the 'gluster' cli tool is missing * * Looks up gluster volumes on @host and fills them to @list. * + * If @netfs is specified the data is tweaked so that it can be used with = netfs + * type pools. Otherwise the data is for use with native gluster pools. + * * Returns number of volumes on the host on success, or -1 on error. */ int virStorageBackendFindGlusterPoolSources(const char *host, - int pooltype, virStoragePoolSourceListPtr list, + bool netfs, bool report) { char *glusterpath =3D NULL; @@ -2918,7 +2921,8 @@ virStorageBackendFindGlusterPoolSources(const char *h= ost, if (VIR_STRDUP(src->hosts[0].name, host) < 0) goto cleanup; - src->format =3D pooltype; + if (netfs) + src->format =3D VIR_STORAGE_POOL_NETFS_GLUSTERFS; } ret =3D nnodes; diff --git a/src/storage/storage_util.h b/src/storage/storage_util.h index fa3b6522c..741baa78d 100644 --- a/src/storage/storage_util.h +++ b/src/storage/storage_util.h @@ -94,8 +94,8 @@ int virStorageBackendRefreshLocal(virConnectPtr conn, virStoragePoolObjPtr pool); int virStorageBackendFindGlusterPoolSources(const char *host, - int pooltype, virStoragePoolSourceListPtr li= st, + bool netfs, bool report); bool virStorageBackendDeviceIsEmpty(const char *devpath, --=20 2.12.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list