From aa57eae7b15d9ff27baf12287db220ea8d3b82f0 Mon Sep 17 00:00:00 2001 From: Osier Yang Date: Wed, 27 Jun 2012 22:02:23 +0800 Subject: [PATCH] storage: Error out if the target is already mounted for netfs pool 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 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend_fs.c index 1af12e6746..26bbc32e45 100644 --- a/src/storage/storage_backend_fs.c +++ b/src/storage/storage_backend_fs.c @@ -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) {