cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mlsoren...@apache.org
Subject git commit: refs/heads/master - CLOUDSTACK-1761 - Available local storage disk capacity incorrectly reported in KVM to manager. This adds collection of available storage to KVM, not just used.
Date Fri, 22 Mar 2013 15:33:37 GMT
Updated Branches:
  refs/heads/master c305e3c5a -> ff6177d11


CLOUDSTACK-1761 - Available local storage disk capacity incorrectly reported in
     KVM to manager. This adds collection of available storage to KVM, not
     just used.

Bugfix-for: 4.0.2, 4.1, master
Submitted-by: Ted Smith <darnoth@gmail.com>
Signed-off-by: Marcus Sorensen <marcus@betterservers.com> 1363966235 -0600


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

Branch: refs/heads/master
Commit: ff6177d119bb49e90fa325ca51f4eec217bae915
Parents: c305e3c
Author: Marcus Sorensen <marcus@betterservers.com>
Authored: Fri Mar 22 09:30:35 2013 -0600
Committer: Marcus Sorensen <marcus@betterservers.com>
Committed: Fri Mar 22 09:30:35 2013 -0600

----------------------------------------------------------------------
 .../kvm/resource/LibvirtComputingResource.java     |    2 +-
 .../hypervisor/kvm/storage/KVMStoragePool.java     |    2 ++
 .../kvm/storage/LibvirtStorageAdaptor.java         |    2 ++
 .../hypervisor/kvm/storage/LibvirtStoragePool.java |   10 ++++++++++
 4 files changed, 15 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ff6177d1/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
index 604bd00..f786f88 100755
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
@@ -3559,7 +3559,7 @@ ServerResource {
                     localStoragePool.getUuid(), cmd.getPrivateIpAddress(),
                     _localStoragePath, _localStoragePath,
                     StoragePoolType.Filesystem, localStoragePool.getCapacity(),
-                    localStoragePool.getUsed());
+                    localStoragePool.getAvailable());
 
             sscmd = new StartupStorageCommand();
             sscmd.setPoolInfo(pi);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ff6177d1/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStoragePool.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStoragePool.java
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStoragePool.java
index 5437e7c..d32a6fd 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStoragePool.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStoragePool.java
@@ -39,6 +39,8 @@ public interface KVMStoragePool {
 
     public long getUsed();
 
+    public long getAvailable();
+
     public boolean refresh();
 
     public boolean isExternalSnapshot();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ff6177d1/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
index d5e6ad6..ca5da5c 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
@@ -351,6 +351,7 @@ public class LibvirtStorageAdaptor implements StorageAdaptor {
             pool.refresh();
             pool.setCapacity(storage.getInfo().capacity);
             pool.setUsed(storage.getInfo().allocation);
+            pool.setAvailable(storage.getInfo().available);
 
             return pool;
         } catch (LibvirtException e) {
@@ -483,6 +484,7 @@ public class LibvirtStorageAdaptor implements StorageAdaptor {
 
             pool.setCapacity(sp.getInfo().capacity);
             pool.setUsed(sp.getInfo().allocation);
+            pool.setAvailable(sp.getInfo().available);
   
             return pool;
         } catch (LibvirtException e) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ff6177d1/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStoragePool.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStoragePool.java
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStoragePool.java
index 32f8ce9..1396097 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStoragePool.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStoragePool.java
@@ -28,6 +28,7 @@ public class LibvirtStoragePool implements KVMStoragePool {
     protected String uri;
     protected long capacity;
     protected long used;
+    protected long available;
     protected String name;
     protected String localPath;
     protected PhysicalDiskFormat defaultFormat;
@@ -48,6 +49,7 @@ public class LibvirtStoragePool implements KVMStoragePool {
         this._storageAdaptor = adaptor;
         this.capacity = 0;
         this.used = 0;
+        this.available = 0;
         this._pool = pool;
 
     }
@@ -65,11 +67,19 @@ public class LibvirtStoragePool implements KVMStoragePool {
         this.used = used;
     }
 
+    public void setAvailable(long available) {
+        this.available = available;
+    }
+
     @Override
     public long getUsed() {
         return this.used;
     }
 
+    public long getAvailable() {
+        return this.available;
+    }
+
     public StoragePoolType getStoragePoolType() {
         return this.type;
     }


Mime
View raw message