cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [25/50] [abbrv] git commit: updated refs/heads/saml2 to ba68616
Date Sun, 24 Aug 2014 14:04:45 GMT
remove trailing comma in options sent to qemu-img


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

Branch: refs/heads/saml2
Commit: 656fc69f39f8d940880ae2e704c87efa5c0e34fa
Parents: b37ee25
Author: Kishan Kavala <kishan.kavala@citrix.com>
Authored: Mon Aug 18 10:07:09 2014 +0530
Committer: root <root@kk-dev47.lab.citrite.net>
Committed: Fri Aug 22 15:39:04 2014 +0530

----------------------------------------------------------------------
 .../src/org/apache/cloudstack/utils/qemu/QemuImg.java    | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/656fc69f/plugins/hypervisors/kvm/src/org/apache/cloudstack/utils/qemu/QemuImg.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/org/apache/cloudstack/utils/qemu/QemuImg.java b/plugins/hypervisors/kvm/src/org/apache/cloudstack/utils/qemu/QemuImg.java
index 389ac21..e8dbf92 100644
--- a/plugins/hypervisors/kvm/src/org/apache/cloudstack/utils/qemu/QemuImg.java
+++ b/plugins/hypervisors/kvm/src/org/apache/cloudstack/utils/qemu/QemuImg.java
@@ -17,6 +17,7 @@
 package org.apache.cloudstack.utils.qemu;
 
 import java.util.HashMap;
+import java.util.Iterator;
 import java.util.Map;
 import com.cloud.storage.Storage;
 
@@ -122,8 +123,14 @@ public class QemuImg {
         if (options != null && !options.isEmpty()) {
             s.add("-o");
             final StringBuilder optionsStr = new StringBuilder();
-            for (Map.Entry<String, String> option : options.entrySet()) {
-                optionsStr.append(option.getKey()).append('=').append(option.getValue()).append(',');
+            Iterator<Map.Entry<String, String>> optionsIter = options.entrySet().iterator();
+            while(optionsIter.hasNext()){
+                Map.Entry option = optionsIter.next();
+                optionsStr.append(option.getKey()).append('=').append(option.getValue());
+                if(optionsIter.hasNext()){
+                    //Add "," only if there are more options
+                    optionsStr.append(',');
+                }
             }
             s.add(optionsStr.toString());
         }


Mime
View raw message