From nobody Sun Feb 8 23:41:55 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 1491308516708971.5950439227112; Tue, 4 Apr 2017 05:21:56 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0FFBFC00108F; Tue, 4 Apr 2017 12:21:55 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D56CF96295; Tue, 4 Apr 2017 12:21:54 +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 83D1F18521C8; Tue, 4 Apr 2017 12:21:54 +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 v34CK6BN007098 for ; Tue, 4 Apr 2017 08:20:06 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8450D8473F; Tue, 4 Apr 2017 12:20:06 +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 5493186169; Tue, 4 Apr 2017 12:20:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 0FFBFC00108F 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 0FFBFC00108F From: Peter Krempa To: libvir-list@redhat.com Date: Tue, 4 Apr 2017 14:20:55 +0200 Message-Id: <97e73245198bbe503e5bc3ef9eda7c4041c7759e.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 1/5] storage: util: Pass pool type to virStorageBackendFindGlusterPoolSources 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 04 Apr 2017 12:21:55 +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 differences add a more deterministic way to switch between the types instead. --- src/storage/storage_backend_fs.c | 2 +- src/storage/storage_backend_gluster.c | 2 +- src/storage/storage_util.c | 13 +++++++++---- src/storage/storage_util.h | 2 +- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend= _fs.c index 1fc127a8c..bf1d7de43 100644 --- a/src/storage/storage_backend_fs.c +++ b/src/storage/storage_backend_fs.c @@ -186,7 +186,7 @@ virStorageBackendFileSystemNetFindPoolSources(virConnec= tPtr conn ATTRIBUTE_UNUSE retNFS =3D virStorageBackendFileSystemNetFindNFSPoolSources(&state); retGluster =3D virStorageBackendFindGlusterPoolSources(state.host, - VIR_STORAGE_POOL_= NETFS_GLUSTERFS, + VIR_STORAGE_POOL_= NETFS, &state.list, fals= e); if (retGluster < 0) diff --git a/src/storage/storage_backend_gluster.c b/src/storage/storage_ba= ckend_gluster.c index 52c9ee372..30a41369a 100644 --- a/src/storage/storage_backend_gluster.c +++ b/src/storage/storage_backend_gluster.c @@ -513,7 +513,7 @@ virStorageBackendGlusterFindPoolSources(virConnectPtr c= onn ATTRIBUTE_UNUSED, } if ((rc =3D virStorageBackendFindGlusterPoolSources(source->hosts[0].n= ame, - 0, /* currently igno= red */ + VIR_STORAGE_POOL_GLU= STER, &list, true)) < 0) goto cleanup; diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c index 0ceaab6b9..715361923 100644 --- a/src/storage/storage_util.c +++ b/src/storage/storage_util.c @@ -2839,17 +2839,21 @@ virStorageBackendDeleteLocal(virConnectPtr conn ATT= RIBUTE_UNUSED, /** * virStorageBackendFindGlusterPoolSources: * @host: host to detect volumes on - * @pooltype: src->format is set to this value + * @pooltype: type of the pool * @list: list of storage pool sources to be filled * @report: report error if the 'gluster' cli tool is missing * * Looks up gluster volumes on @host and fills them to @list. * + * @pooltype allows to influence the specific differences between netfs and + * native gluster pools. Users should pass only VIR_STORAGE_POOL_NETFS or + * VIR_STORAGE_POOL_GLUSTER. + * * Returns number of volumes on the host on success, or -1 on error. */ int virStorageBackendFindGlusterPoolSources(const char *host, - int pooltype, + virStoragePoolType pooltype, virStoragePoolSourceListPtr list, bool report) { @@ -2911,14 +2915,15 @@ virStorageBackendFindGlusterPoolSources(const char = *host, goto cleanup; } + if (pooltype =3D=3D VIR_STORAGE_POOL_NETFS) + src->format =3D VIR_STORAGE_POOL_NETFS_GLUSTERFS; + if (VIR_ALLOC_N(src->hosts, 1) < 0) goto cleanup; src->nhost =3D 1; if (VIR_STRDUP(src->hosts[0].name, host) < 0) goto cleanup; - - src->format =3D pooltype; } ret =3D nnodes; diff --git a/src/storage/storage_util.h b/src/storage/storage_util.h index fa3b6522c..1ba259c1e 100644 --- a/src/storage/storage_util.h +++ b/src/storage/storage_util.h @@ -94,7 +94,7 @@ int virStorageBackendRefreshLocal(virConnectPtr conn, virStoragePoolObjPtr pool); int virStorageBackendFindGlusterPoolSources(const char *host, - int pooltype, + virStoragePoolType pooltype, virStoragePoolSourceListPtr li= st, bool report); --=20 2.12.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list