aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorFam Zheng <famz@redhat.com>2013-10-11 15:43:23 +0800
committerKevin Wolf <kwolf@redhat.com>2013-10-11 16:50:01 +0200
commit52c8d629cac27ad16dd51507b4733d46fa4efc55 (patch)
treeb20f772c96efb4899bbac8c56374822c8803d843 /block
parent4823970bcb882cd5b7e9c9a21fa6573190035050 (diff)
vmdk: refuse enabling zeroed grain with flat images
This is a header flag and we needs sparse for the header. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block')
-rw-r--r--block/vmdk.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/block/vmdk.c b/block/vmdk.c
index a1aaea77e9..709aa3deb0 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);