From patchwork Fri Oct 11 15:05:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 282870 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C277D2C0342 for ; Sat, 12 Oct 2013 04:37:06 +1100 (EST) Received: from localhost ([::1]:54966 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUeYc-0001rj-1R for incoming@patchwork.ozlabs.org; Fri, 11 Oct 2013 11:23:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43448) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUeJE-0000CY-Tt for qemu-devel@nongnu.org; Fri, 11 Oct 2013 11:07:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VUeJ7-0005r0-Es for qemu-devel@nongnu.org; Fri, 11 Oct 2013 11:07:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:21809) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUeJ7-0005qt-6G for qemu-devel@nongnu.org; Fri, 11 Oct 2013 11:07:13 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r9BF7BN9017667 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 11 Oct 2013 11:07:12 -0400 Received: from dhcp-200-207.str.redhat.com (dhcp-192-197.str.redhat.com [10.33.192.197]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r9BF5s2w006329; Fri, 11 Oct 2013 11:07:10 -0400 From: Kevin Wolf To: anthony@codemonkey.ws Date: Fri, 11 Oct 2013 17:05:31 +0200 Message-Id: <1381503951-27985-42-git-send-email-kwolf@redhat.com> In-Reply-To: <1381503951-27985-1-git-send-email-kwolf@redhat.com> References: <1381503951-27985-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, qemu-devel@nongnu.org Subject: [Qemu-devel] [PULL 41/61] vmdk: refuse enabling zeroed grain with flat images X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Fam Zheng This is a header flag and we needs sparse for the header. Signed-off-by: Fam Zheng Signed-off-by: Kevin Wolf --- block/vmdk.c | 4 ++++ tests/qemu-iotests/059 | 4 ++++ tests/qemu-iotests/059.out | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/block/vmdk.c b/block/vmdk.c index a1aaea7..709aa3d 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -1664,6 +1664,10 @@ static int vmdk_create(const char *filename, QEMUOptionParameter *options, error_setg(errp, "Flat image can't have backing file"); return -ENOTSUP; } + if (flat && zeroed_grain) { + error_setg(errp, "Flat image can't enable zeroed grain"); + return -ENOTSUP; + } if (backing_file) { BlockDriverState *bs = bdrv_new(""); ret = bdrv_open(bs, backing_file, NULL, 0, NULL, errp); diff --git a/tests/qemu-iotests/059 b/tests/qemu-iotests/059 index 18cdad1..b81c575 100755 --- a/tests/qemu-iotests/059 +++ b/tests/qemu-iotests/059 @@ -71,6 +71,10 @@ echo "=== Testing monolithicFlat creation and opening ===" IMGOPTS="subformat=monolithicFlat" _make_test_img 2G $QEMU_IMG info $TEST_IMG | _filter_testdir +echo +echo "=== Testing monolithicFlat with zeroed_grain ===" +IMGOPTS="subformat=monolithicFlat,zeroed_grain=on" _make_test_img 2G + # success, all done echo "*** done" rm -f $seq.full diff --git a/tests/qemu-iotests/059.out b/tests/qemu-iotests/059.out index 265cd76..9b12efb 100644 --- a/tests/qemu-iotests/059.out +++ b/tests/qemu-iotests/059.out @@ -22,4 +22,8 @@ image: TEST_DIR/t.vmdk file format: vmdk virtual size: 2.0G (2147483648 bytes) disk size: 4.0K + +=== Testing monolithicFlat with zeroed_grain === +qemu-img: TEST_DIR/t.IMGFMT: Flat image can't enable zeroed grain +Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2147483648 *** done