cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [1/2] git commit: updated refs/heads/4.3 to 76f5f30
Date Thu, 13 Nov 2014 18:53:46 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.3 2aabcc11d -> 76f5f3048


CLOUDSTACK-6371: Set snapshot size in copycommand answer during snapshot backup

(cherry picked from commit 295fa84d4d3bb100055d7124bb0d0d68491328fc)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>


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

Branch: refs/heads/4.3
Commit: 83df80b715c76bf4db38d20eac9bff8b3f27eacb
Parents: 2aabcc1
Author: Kishan Kavala <kishan@cloud.com>
Authored: Thu Apr 10 12:59:04 2014 +0530
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Fri Nov 14 00:12:16 2014 +0530

----------------------------------------------------------------------
 .../com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/83df80b7/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 8d237cc..3d1ca55 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
@@ -689,6 +689,7 @@ public class KVMStorageProcessor implements StorageProcessor {
                     primaryStore.getUuid(), volumePath);
             primaryPool = snapshotDisk.getPool();
 
+            long size = 0;
             /**
              * RBD snapshots can't be copied using qemu-img, so we have to use
              * the Java bindings for librbd here.
@@ -733,6 +734,7 @@ public class KVMStorageProcessor implements StorageProcessor {
                         offset += bytes;
                     }
                     s_logger.debug("Completed backing up RBD snapshot " + snapshotName +
" to  " + snapFile.getAbsolutePath() + ". Bytes written: " + offset);
+                    size = offset;
                     bos.close();
 
                     s_logger.debug("Attempting to remove snapshot RBD " + snapshotName +
" from image " + snapshotDisk.getName());
@@ -763,10 +765,15 @@ public class KVMStorageProcessor implements StorageProcessor {
                     s_logger.debug("Failed to backup snaptshot: " + result);
                     return new CopyCmdAnswer(result);
                 }
+                File snapFile = new File(snapshotDestPath + "/" + snapshotName);
+                if(snapFile.exists()){
+                    size = snapFile.length();
+                }
             }
 
             SnapshotObjectTO newSnapshot = new SnapshotObjectTO();
             newSnapshot.setPath(snapshotRelPath + File.separator + snapshotName);
+            newSnapshot.setPhysicalSize(size);
             return new CopyCmdAnswer(newSnapshot);
         } catch (LibvirtException e) {
             s_logger.debug("Failed to backup snapshot: " + e.toString());


Mime
View raw message