cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mc...@apache.org
Subject git commit: updated refs/heads/4.3-forward to 94257c0
Date Wed, 26 Feb 2014 22:58:59 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.3-forward aaa7b2fcc -> 94257c0fc (forced update)


CLOUDSTACK-6175:s3.singleupload.max.size option not applicable for
backup snapshot on KVM.


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

Branch: refs/heads/4.3-forward
Commit: 94257c0fc85c7178e6ca3146662de08feee2c290
Parents: 4c83f80
Author: Min Chen <min.chen@citrix.com>
Authored: Wed Feb 26 11:51:24 2014 -0800
Committer: Min Chen <min.chen@citrix.com>
Committed: Wed Feb 26 14:57:32 2014 -0800

----------------------------------------------------------------------
 .../hypervisor/kvm/storage/KVMStorageProcessor.java  | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/94257c0f/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java
index cd57643..8d237cc 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java
@@ -18,6 +18,7 @@
  */
 package com.cloud.hypervisor.kvm.storage;
 
+import static com.cloud.utils.S3Utils.mputFile;
 import static com.cloud.utils.S3Utils.putFile;
 
 import java.io.BufferedOutputStream;
@@ -566,13 +567,20 @@ public class KVMStorageProcessor implements StorageProcessor {
     public Answer createTemplateFromSnapshot(CopyCommand cmd) {
         return null;  //To change body of implemented methods use File | Settings | File
Templates.
     }
-    protected String copyToS3(File srcFile, S3TO destStore, String destPath) {
+
+    protected String copyToS3(File srcFile, S3TO destStore, String destPath) throws InterruptedException
{
         final String bucket = destStore.getBucketName();
 
+        long srcSize = srcFile.length();
         String key = destPath + S3Utils.SEPARATOR + srcFile.getName();
-        putFile(destStore, srcFile, bucket, key);
+        if (!destStore.getSingleUpload(srcSize)) {
+            mputFile(destStore, srcFile, bucket, key);
+        } else {
+            putFile(destStore, srcFile, bucket, key);
+        }
         return key;
     }
+
     protected Answer copyToObjectStore(CopyCommand cmd) {
         DataTO srcData = cmd.getSrcTO();
         DataTO destData = cmd.getDestTO();
@@ -603,6 +611,9 @@ public class KVMStorageProcessor implements StorageProcessor {
             SnapshotObjectTO newSnapshot = new SnapshotObjectTO();
             newSnapshot.setPath(destPath);
             return new CopyCmdAnswer(newSnapshot);
+        } catch (Exception e) {
+            s_logger.error("failed to upload" + srcPath, e);
+            return new CopyCmdAnswer("failed to upload" + srcPath + e.toString());
         } finally {
             try {
                 if (srcFile != null) {


Mime
View raw message