All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] client.virt.virt_vm: Make it possible to specify cluster size for image
@ 2011-05-23  7:27 Lucas Meneghel Rodrigues
  0 siblings, 0 replies; only message in thread
From: Lucas Meneghel Rodrigues @ 2011-05-23  7:27 UTC (permalink / raw)
  To: autotest; +Cc: kvm

For some tests, we need to specify image cluster size for
a given image. Make it possible to specify it so qemu-img
is called with the right parameters. This way we can state
things like:

        images += ' stg1 stg2'
        image_name_stg1 = storage_4k
        image_cluster_size_stg1 = 4096
        image_format_stg1 = qcow2
        image_name_stg2 = storage_64k
        image_cluster_size_stg2 = 65536
        image_format_stg2 = qcow2

in the configuration file for a test

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
---
 client/virt/virt_vm.py |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/client/virt/virt_vm.py b/client/virt/virt_vm.py
index 983ee02..7236218 100644
--- a/client/virt/virt_vm.py
+++ b/client/virt/virt_vm.py
@@ -218,6 +218,7 @@ def create_image(params, root_dir):
     @note: params should contain:
            image_name -- the name of the image file, without extension
            image_format -- the format of the image (qcow2, raw etc)
+           image_cluster_size (optional) -- the cluster size for the image
            image_size -- the requested size of the image (a string
            qemu-img can understand, such as '10G')
     """
@@ -228,6 +229,10 @@ def create_image(params, root_dir):
     format = params.get("image_format", "qcow2")
     qemu_img_cmd += " -f %s" % format
 
+    image_cluster_size = params.get("image_cluster_size", None)
+    if image_cluster_size is not None:
+        qemu_img_cmd += " -o cluster_size=%s" % image_cluster_size
+
     image_filename = get_image_filename(params, root_dir)
     qemu_img_cmd += " %s" % image_filename
 
-- 
1.7.5.1

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-05-23  7:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-23  7:27 [PATCH 1/2] client.virt.virt_vm: Make it possible to specify cluster size for image Lucas Meneghel Rodrigues

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.