From nobody Wed Feb 11 13:08:37 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.24 as permitted sender) client-ip=209.132.183.24; envelope-from=libvir-list-bounces@redhat.com; helo=mx3-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.24 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx3-phx2.redhat.com (mx3-phx2.redhat.com [209.132.183.24]) by mx.zohomail.com with SMTPS id 1486477247968687.800778322364; Tue, 7 Feb 2017 06:20:47 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx3-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v17EGlvN019665; Tue, 7 Feb 2017 09:16:47 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v17EGkSd016000 for ; Tue, 7 Feb 2017 09:16:46 -0500 Received: from beluga.usersys.redhat.com (dhcp129-94.brq.redhat.com [10.34.129.94]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v17EGixR010056; Tue, 7 Feb 2017 09:16:45 -0500 From: Erik Skultety To: libvir-list@redhat.com Date: Tue, 7 Feb 2017 15:16:36 +0100 Message-Id: <0eec28cc03668acbf443616bdbb8f99f83360b24.1486476642.git.eskultet@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-loop: libvir-list@redhat.com Cc: Erik Skultety Subject: [libvirt] [PATCH 1/3] storage: Fix reporting an error on an already mounted filesystem 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-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" When FS pool's source is already mounted on the target location instead of just simply marking the pool as active, thus starting it we fail with an error stating that the source is indeed already mounted on the target. Signed-off-by: Erik Skultety --- src/storage/storage_backend_fs.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend= _fs.c index 54bcc57..fe4705b 100644 --- a/src/storage/storage_backend_fs.c +++ b/src/storage/storage_backend_fs.c @@ -358,14 +358,13 @@ virStorageBackendFileSystemMount(virStoragePoolObjPtr= pool) if (virStorageBackendFileSystemIsValid(pool) < 0) return -1; =20 + if ((rc =3D virStorageBackendFileSystemIsMounted(pool)) < 0) + return -1; + /* Short-circuit if already mounted */ - if ((rc =3D virStorageBackendFileSystemIsMounted(pool)) !=3D 0) { - if (rc =3D=3D 1) { - virReportError(VIR_ERR_OPERATION_INVALID, - _("Target '%s' is already mounted"), - pool->def->target.path); - } - return -1; + if (rc =3D=3D 1) { + VIR_INFO("Target '%s' is already mounted", pool->def->target.path); + return 0; } =20 if (!(src =3D virStorageBackendFileSystemGetPoolSource(pool))) --=20 2.10.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list