]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
storage: Error out if the target is already mounted for netfs pool
authorOsier Yang <jyang@redhat.com>
Wed, 27 Jun 2012 14:02:23 +0000 (22:02 +0800)
committerCole Robinson <crobinso@redhat.com>
Sun, 12 Aug 2012 23:22:30 +0000 (19:22 -0400)
mnt_fsname can not be the same, as we check the duplicate pool
sources earlier before, means it can't be the same pool, moreover,
a pool can't be started if it's already active anyway. So no reason
to act as success.
(cherry picked from commit 8116529409357c82824fb280165ea0ee6f2d6277)

src/storage/storage_backend_fs.c

index 1af12e67469bb4911067ed541a04bcf2d43251e3..26bbc32e45ef2d03966b7647076e84fecc03419d 100644 (file)
@@ -407,10 +407,10 @@ virStorageBackendFileSystemMount(virStoragePoolObjPtr pool) {
 
     /* Short-circuit if already mounted */
     if ((ret = virStorageBackendFileSystemIsMounted(pool)) != 0) {
-        if (ret < 0)
-            return -1;
-        else
-            return 0;
+        virStorageReportError(VIR_ERR_OPERATION_INVALID,
+                              _("Target '%s' is already mounted"),
+                              pool->def->target.path);
+        return -1;
     }
 
     if (pool->def->type == VIR_STORAGE_POOL_NETFS) {