]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
storage: Fix reporting an error on an already mounted filesystem
authorErik Skultety <eskultet@redhat.com>
Mon, 6 Feb 2017 14:03:52 +0000 (15:03 +0100)
committerErik Skultety <eskultet@redhat.com>
Fri, 10 Feb 2017 16:01:12 +0000 (17:01 +0100)
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 <eskultet@redhat.com>
src/storage/storage_backend_fs.c

index 54bcc5777c4bc61e2063cb23493497d8953de0f9..fe4705b95d7563ae27396451d02b6d793e2a85b8 100644 (file)
@@ -358,14 +358,13 @@ virStorageBackendFileSystemMount(virStoragePoolObjPtr pool)
     if (virStorageBackendFileSystemIsValid(pool) < 0)
         return -1;
 
-    /* Short-circuit if already mounted */
-    if ((rc = virStorageBackendFileSystemIsMounted(pool)) != 0) {
-        if (rc == 1) {
-            virReportError(VIR_ERR_OPERATION_INVALID,
-                           _("Target '%s' is already mounted"),
-                           pool->def->target.path);
-        }
+    if ((rc = virStorageBackendFileSystemIsMounted(pool)) < 0)
         return -1;
+
+    /* Short-circuit if already mounted */
+    if (rc == 1) {
+        VIR_INFO("Target '%s' is already mounted", pool->def->target.path);
+        return 0;
     }
 
     if (!(src = virStorageBackendFileSystemGetPoolSource(pool)))