From patchwork Thu Oct 10 07:20:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fam Zheng X-Patchwork-Id: 282140 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 E6FCE2C016B for ; Thu, 10 Oct 2013 18:21:51 +1100 (EST) Received: from localhost ([::1]:45242 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUAZB-0000OX-4n for incoming@patchwork.ozlabs.org; Thu, 10 Oct 2013 03:21:49 -0400 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 Received: from T430s.nay.redhat.com ([10.66.6.118]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r9A7Kv8T013900; Thu, 10 Oct 2013 03:21:02 -0400 From: Fam Zheng To: qemu-devel@nongnu.org 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> 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, stefanha@redhat.com Subject: [Qemu-devel] [PATCH 2/2] 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 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);