Received: from eggs.gnu.org ([2001:4830:134:3::10]:60822) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUFVu-0007j6-F7 for qemu-devel@nongnu.org; Thu, 10 Oct 2013 08:38:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VUFVo-0002KV-FI for qemu-devel@nongnu.org; Thu, 10 Oct 2013 08:38:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:23397) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUFVo-0002KP-6x for qemu-devel@nongnu.org; Thu, 10 Oct 2013 08:38:40 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r9ACccJL004871 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 10 Oct 2013 08:38:39 -0400 From: Fam Zheng Date: Thu, 10 Oct 2013 20:38:32 +0800 Message-Id: <1381408712-21502-3-git-send-email-famz@redhat.com> In-Reply-To: <1381408712-21502-1-git-send-email-famz@redhat.com> References: <1381408712-21502-1-git-send-email-famz@redhat.com> Subject: [Qemu-devel] [PATCH v2 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 4f8ae77..90340eb 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); -- 1.8.3.1