From nobody Sun Feb 8 14:12:44 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.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1543942075611184.2942580642324; Tue, 4 Dec 2018 08:47:55 -0800 (PST) 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 E9EFB307D867; Tue, 4 Dec 2018 16:47:50 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7DE1318B8E; Tue, 4 Dec 2018 16:47:50 +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 1A4444EA42; Tue, 4 Dec 2018 16:47:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wB4GlLmb022373 for ; Tue, 4 Dec 2018 11:47:21 -0500 Received: by smtp.corp.redhat.com (Postfix) id 749D117AC0; Tue, 4 Dec 2018 16:47:21 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-18.phx2.redhat.com [10.3.116.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 30CB36128A for ; Tue, 4 Dec 2018 16:47:21 +0000 (UTC) From: John Ferlan To: libvir-list@redhat.com Date: Tue, 4 Dec 2018 11:47:12 -0500 Message-Id: <20181204164717.5013-4-jferlan@redhat.com> In-Reply-To: <20181204164717.5013-1-jferlan@redhat.com> References: <20181204164717.5013-1-jferlan@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/8] storage: Move virStorageBackendFileSystemGetPoolSource 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.48]); Tue, 04 Dec 2018 16:47:54 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Move into storage_util for reuse by test harness Signed-off-by: John Ferlan --- src/storage/storage_backend_fs.c | 33 -------------------------------- src/storage/storage_util.c | 33 ++++++++++++++++++++++++++++++++ src/storage/storage_util.h | 3 +++ 3 files changed, 36 insertions(+), 33 deletions(-) diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend= _fs.c index b341ba84fa..c5e75627b5 100644 --- a/src/storage/storage_backend_fs.c +++ b/src/storage/storage_backend_fs.c @@ -245,39 +245,6 @@ virStorageBackendFileSystemIsValid(virStoragePoolObjPt= r pool) } =20 =20 -/** - * virStorageBackendFileSystemGetPoolSource - * @pool: storage pool object pointer - * - * Allocate/return a string representing the FS storage pool source. - * It is up to the caller to VIR_FREE the allocated string - */ -static char * -virStorageBackendFileSystemGetPoolSource(virStoragePoolObjPtr pool) -{ - virStoragePoolDefPtr def =3D virStoragePoolObjGetDef(pool); - char *src =3D NULL; - - if (def->type =3D=3D VIR_STORAGE_POOL_NETFS) { - if (def->source.format =3D=3D VIR_STORAGE_POOL_NETFS_CIFS) { - if (virAsprintf(&src, "//%s/%s", - def->source.hosts[0].name, - def->source.dir) < 0) - return NULL; - } else { - if (virAsprintf(&src, "%s:%s", - def->source.hosts[0].name, - def->source.dir) < 0) - return NULL; - } - } else { - if (VIR_STRDUP(src, def->source.devices[0].path) < 0) - return NULL; - } - return src; -} - - /** * @pool storage pool to check for status * diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c index 180d7b1fa3..c9f6096687 100644 --- a/src/storage/storage_util.c +++ b/src/storage/storage_util.c @@ -4228,6 +4228,39 @@ virStorageBackendZeroPartitionTable(const char *path, } =20 =20 +/** + * virStorageBackendFileSystemGetPoolSource + * @pool: storage pool object pointer + * + * Allocate/return a string representing the FS storage pool source. + * It is up to the caller to VIR_FREE the allocated string + */ +char * +virStorageBackendFileSystemGetPoolSource(virStoragePoolObjPtr pool) +{ + virStoragePoolDefPtr def =3D virStoragePoolObjGetDef(pool); + char *src =3D NULL; + + if (def->type =3D=3D VIR_STORAGE_POOL_NETFS) { + if (def->source.format =3D=3D VIR_STORAGE_POOL_NETFS_CIFS) { + if (virAsprintf(&src, "//%s/%s", + def->source.hosts[0].name, + def->source.dir) < 0) + return NULL; + } else { + if (virAsprintf(&src, "%s:%s", + def->source.hosts[0].name, + def->source.dir) < 0) + return NULL; + } + } else { + if (VIR_STRDUP(src, def->source.devices[0].path) < 0) + return NULL; + } + return src; +} + + virCommandPtr virStorageBackendFileSystemMountCmd(virStoragePoolDefPtr def, const char *src) diff --git a/src/storage/storage_util.h b/src/storage/storage_util.h index 5b0baf56c4..28b3e0b9c9 100644 --- a/src/storage/storage_util.h +++ b/src/storage/storage_util.h @@ -177,6 +177,9 @@ int virStorageBackendZeroPartitionTable(const char *path, unsigned long long size); =20 +char * +virStorageBackendFileSystemGetPoolSource(virStoragePoolObjPtr pool); + virCommandPtr virStorageBackendFileSystemMountCmd(virStoragePoolDefPtr def, const char *src); --=20 2.17.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list