From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44244) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUAYi-0000D3-D3 for qemu-devel@nongnu.org; Thu, 10 Oct 2013 03:21:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VUAYb-0002Zv-Q2 for qemu-devel@nongnu.org; Thu, 10 Oct 2013 03:21:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:12672) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUAYb-0002Zp-IG for qemu-devel@nongnu.org; Thu, 10 Oct 2013 03:21: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 r9A7L4TF000374 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 10 Oct 2013 03:21:04 -0400 From: Fam Zheng Date: Thu, 10 Oct 2013 15:20:56 +0800 Message-Id: <1381389656-5026-3-git-send-email-famz@redhat.com> In-Reply-To: <1381389656-5026-1-git-send-email-famz@redhat.com> References: <1381389656-5026-1-git-send-email-famz@redhat.com> Subject: [Qemu-devel] [PATCH 2/2] vmdk: refuse enabling zeroed grain with flat images List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, stefanha@redhat.com This is a header flag and we needs sparse for the header. Signed-off-by: Fam Zheng --- block/vmdk.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/block/vmdk.c b/block/vmdk.c index a98ad23..78c0129 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -1656,6 +1656,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, &local_err); -- 1.8.3.1