]> xenbits.xensource.com Git - 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)
committerOsier Yang <jyang@redhat.com>
Thu, 28 Jun 2012 03:53:40 +0000 (11:53 +0800)
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.

src/storage/storage_backend_fs.c

index bde45284835950405e9a97d07a14b3b0c6e71947..87d9192967aa1f8be371ba815eceb47a3ee39232 100644 (file)
@@ -424,10 +424,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) {