From: Feng Yang <[email protected]>

After this patch, we can set preallocation, encrypted and
cluster_size together.

Signed-off-by: Feng Yang <[email protected]>
---
 client/tests/virt/virttest/kvm_storage.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/client/tests/virt/virttest/kvm_storage.py 
b/client/tests/virt/virttest/kvm_storage.py
index 22e424b..e120bb1 100644
--- a/client/tests/virt/virttest/kvm_storage.py
+++ b/client/tests/virt/virttest/kvm_storage.py
@@ -71,14 +71,17 @@ class QemuImg(storage.QemuImg):
             preallocated = params.get("preallocated", "off")
             encrypted = params.get("encrypted", "off")
 
+            qemu_img_cmd += " -o "
             if preallocated != "off":
-                qemu_img_cmd += " -o preallocation=%s" % preallocated
+                qemu_img_cmd += "preallocation=%s," % preallocated
 
             if encrypted != "off":
-                qemu_img_cmd += " -o encrypted=%s" % encrypted
+                qemu_img_cmd += "encrypted=%s," % encrypted
 
             if image_cluster_size is not None:
-                qemu_img_cmd += " -o cluster_size=%s" % image_cluster_size
+                qemu_img_cmd += "cluster_size=%s," % image_cluster_size
+            qemu_img_cmd = qemu_img_cmd.rstrip(" -o")
+            qemu_img_cmd = qemu_img_cmd.rstrip(",")
 
             if self.base_tag:
                 qemu_img_cmd += " -b %s" % self.base_image_filename
-- 
1.7.11.4

_______________________________________________
Autotest-kernel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/autotest-kernel

Reply via email to