From patchwork Mon May 23 07:27:27 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas Meneghel Rodrigues X-Patchwork-Id: 807842 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p4N7RToZ013640 for ; Mon, 23 May 2011 07:27:29 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753266Ab1EWH1Y (ORCPT ); Mon, 23 May 2011 03:27:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:7468 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752398Ab1EWH1X (ORCPT ); Mon, 23 May 2011 03:27:23 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p4N7RNM4013606 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 23 May 2011 03:27:23 -0400 Received: from freedom.redhat.com (vpn-8-6.rdu.redhat.com [10.11.8.6]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p4N7RLeK026163; Mon, 23 May 2011 03:27:21 -0400 From: Lucas Meneghel Rodrigues To: autotest@test.kernel.org Cc: kvm@vger.kernel.org, Lucas Meneghel Rodrigues Subject: [PATCH 1/2] client.virt.virt_vm: Make it possible to specify cluster size for image Date: Mon, 23 May 2011 04:27:27 -0300 Message-Id: <1306135648-3905-1-git-send-email-lmr@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Mon, 23 May 2011 07:27:29 +0000 (UTC) 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 --- 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