cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From raj...@apache.org
Subject [1/4] git commit: updated refs/heads/4.9 to c6f0ba7
Date Thu, 23 Feb 2017 00:38:34 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.9 e860249e4 -> c6f0ba76b


CLOUDSTACK-9628: Use correct virtualsize with Swift as secondary storage


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

Branch: refs/heads/4.9
Commit: 79f4177212c7d0ac09887fea2ae9f1e2e2820412
Parents: 7da95172
Author: Syed <syed1.mushtaq@gmail.com>
Authored: Fri Dec 9 15:48:08 2016 -0500
Committer: Syed <syed1.mushtaq@gmail.com>
Committed: Fri Dec 9 15:48:08 2016 -0500

----------------------------------------------------------------------
 .../storage/resource/NfsSecondaryStorageResource.java   | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/79f41772/services/secondary-storage/server/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java
----------------------------------------------------------------------
diff --git a/services/secondary-storage/server/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java
b/services/secondary-storage/server/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java
index 420842f..b38e0b7 100644
--- a/services/secondary-storage/server/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java
+++ b/services/secondary-storage/server/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java
@@ -1585,19 +1585,28 @@ public class NfsSecondaryStorageResource extends ServerResourceBase
implements S
                         String line = null;
                         String uniqName = null;
                         Long size = null;
+                        Long physicalSize = null;
                         String name = null;
                         while ((line = brf.readLine()) != null) {
                             if (line.startsWith("uniquename=")) {
                                 uniqName = line.split("=")[1];
                             } else if (line.startsWith("size=")) {
+                                physicalSize = Long.parseLong(line.split("=")[1]);
+                            } else if (line.startsWith("virtualsize=")){
                                 size = Long.parseLong(line.split("=")[1]);
                             } else if (line.startsWith("filename=")) {
                                 name = line.split("=")[1];
                             }
                         }
+
+                        //fallback
+                        if (size == null) {
+                            size = physicalSize;
+                        }
+
                         tempFile.delete();
                         if (uniqName != null) {
-                            TemplateProp prop = new TemplateProp(uniqName, container + File.separator
+ name, size, size, true, false);
+                            TemplateProp prop = new TemplateProp(uniqName, container + File.separator
+ name, size, physicalSize, true, false);
                             tmpltInfos.put(uniqName, prop);
                         }
                     } catch (IOException ex)
@@ -1615,7 +1624,6 @@ public class NfsSecondaryStorageResource extends ServerResourceBase
implements S
             }
         }
         return tmpltInfos;
-
     }
 
     Map<String, TemplateProp> s3ListTemplate(S3TO s3) {


Mime
View raw message