cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ka...@apache.org
Subject git commit: updated refs/heads/master to f706f67
Date Tue, 25 Jun 2013 03:48:45 GMT
Updated Branches:
  refs/heads/master af91a8ac8 -> f706f6757


Add class check before cast

DataTO might be one of SnapshotObjectTO, TemplateObjectTO
or VolumeObjectTO


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

Branch: refs/heads/master
Commit: f706f6757cdfcfb3fb9a288ea88e9796bc1e82d0
Parents: af91a8a
Author: Hiroaki KAWAI <kawai@stratosphere.co.jp>
Authored: Tue Jun 25 12:41:11 2013 +0900
Committer: Hiroaki KAWAI <kawai@stratosphere.co.jp>
Committed: Tue Jun 25 12:48:01 2013 +0900

----------------------------------------------------------------------
 .../kvm/resource/LibvirtComputingResource.java  | 22 ++++++++++----------
 1 file changed, 11 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f706f675/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 46003e9..60cde8c 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
@@ -3446,17 +3446,17 @@ ServerResource {
 
             }
 
-            VolumeObjectTO volumeObjectTO = (VolumeObjectTO)data;
-
-            if ((volumeObjectTO.getBytesReadRate() != null) && (volumeObjectTO.getBytesReadRate()
 > 0))
-                disk.setBytesReadRate(volumeObjectTO.getBytesReadRate());
-            if ((volumeObjectTO.getBytesWriteRate() != null) && (volumeObjectTO.getBytesWriteRate()
> 0))
-                disk.setBytesWriteRate(volumeObjectTO.getBytesWriteRate());
-            if ((volumeObjectTO.getIopsReadRate() != null) && (volumeObjectTO.getIopsReadRate()
> 0))
-                disk.setIopsReadRate(volumeObjectTO.getIopsReadRate());
-            if ((volumeObjectTO.getIopsWriteRate() != null) && (volumeObjectTO.getIopsWriteRate()
> 0))
-                disk.setIopsWriteRate(volumeObjectTO.getIopsWriteRate());
-
+            if (data instanceof VolumeObjectTO) {
+                VolumeObjectTO volumeObjectTO = (VolumeObjectTO)data;
+                if ((volumeObjectTO.getBytesReadRate() != null) && (volumeObjectTO.getBytesReadRate()
 > 0))
+                    disk.setBytesReadRate(volumeObjectTO.getBytesReadRate());
+                if ((volumeObjectTO.getBytesWriteRate() != null) && (volumeObjectTO.getBytesWriteRate()
> 0))
+                    disk.setBytesWriteRate(volumeObjectTO.getBytesWriteRate());
+                if ((volumeObjectTO.getIopsReadRate() != null) && (volumeObjectTO.getIopsReadRate()
> 0))
+                    disk.setIopsReadRate(volumeObjectTO.getIopsReadRate());
+                if ((volumeObjectTO.getIopsWriteRate() != null) && (volumeObjectTO.getIopsWriteRate()
> 0))
+                    disk.setIopsWriteRate(volumeObjectTO.getIopsWriteRate());
+            }
             vm.getDevices().addDevice(disk);
         }
 


Mime
View raw message