cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mlsoren...@apache.org
Subject git commit: updated refs/heads/master to 33006ff
Date Thu, 25 Apr 2013 04:56:20 GMT
Updated Branches:
  refs/heads/master 299cccf77 -> 33006ff19


Summary: Don't add secondary storage to KVM heartbeat

BUG-ID: CLOUDSTACK-2173
Bugfix-for: 4.2
Signed-off-by: Marcus Sorensen <marcus@betterservers.com> 1366865750 -0600


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/33006ff1
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/33006ff1
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/33006ff1

Branch: refs/heads/master
Commit: 33006ff1978dda435f717ff5e9125c9a522af4d4
Parents: 299cccf
Author: Marcus Sorensen <marcus@betterservers.com>
Authored: Wed Apr 24 22:55:50 2013 -0600
Committer: Marcus Sorensen <marcus@betterservers.com>
Committed: Wed Apr 24 22:55:50 2013 -0600

----------------------------------------------------------------------
 .../hypervisor/kvm/resource/KVMHAMonitor.java      |    7 ++++---
 .../kvm/storage/KVMStoragePoolManager.java         |   12 ++++++++++--
 2 files changed, 14 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/33006ff1/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/KVMHAMonitor.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/KVMHAMonitor.java
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/KVMHAMonitor.java
index d1470d6..0e4d9ee 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/KVMHAMonitor.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/KVMHAMonitor.java
@@ -55,9 +55,10 @@ public class KVMHAMonitor extends KVMHABase implements Runnable {
     public void removeStoragePool(String uuid) {
         synchronized (_storagePool) {
             NfsStoragePool pool = this._storagePool.get(uuid);
-            Script.runSimpleBashScript("umount " + pool._mountDestPath);
-            s_logger.debug("attempted to umount '" + pool._mountDestPath + "'");
-            this._storagePool.remove(uuid);
+            if (pool != null) {
+                Script.runSimpleBashScript("umount " + pool._mountDestPath);
+                this._storagePool.remove(uuid);
+            }
         }
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/33006ff1/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStoragePoolManager.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStoragePoolManager.java
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStoragePoolManager.java
index f5719ba..31d491c 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStoragePoolManager.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStoragePoolManager.java
@@ -94,18 +94,26 @@ public class KVMStoragePoolManager {
             protocol = StoragePoolType.NetworkFilesystem;
         }
 
-        return createStoragePool(uuid, sourceHost, 0, sourcePath, "", protocol);
+        // secondary storage registers itself through here
+        return createStoragePool(uuid, sourceHost, 0, sourcePath, "", protocol, false);
     }
 
     public KVMStoragePool createStoragePool( String name, String host, int port,
                                              String path, String userInfo,
                                              StoragePoolType type) {
+        // primary storage registers itself through here
+        return createStoragePool(name, host, port, path, userInfo, type, true);
+    }
+
+    private KVMStoragePool createStoragePool( String name, String host, int port,
+                                             String path, String userInfo,
+                                             StoragePoolType type, boolean primaryStorage)
{
         StorageAdaptor adaptor = getStorageAdaptor(type);
         KVMStoragePool pool = adaptor.createStoragePool(name,
                                 host, port, path, userInfo, type);
 
         // LibvirtStorageAdaptor-specific statement
-        if (type == StoragePoolType.NetworkFilesystem) {
+        if (type == StoragePoolType.NetworkFilesystem && primaryStorage) {
             KVMHABase.NfsStoragePool nfspool = new KVMHABase.NfsStoragePool(
                     pool.getUuid(), host, path, pool.getLocalPath(),
                     PoolType.PrimaryStorage);


Mime
View raw message