diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2013-11-22 13:39:51 +0100 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2013-12-03 15:26:49 +0100 |
commit | cffb1ec600de83f693a23578fc2f344c1af9b96f (patch) | |
tree | dc6c9e603941735a69cab5adecbeb9171a980e23 /block/vmdk.c | |
parent | 95de6d7078b029b73708059a17cef20f332adcb7 (diff) |
block drivers: expose requirement for write same alignment from formats
This will let misaligned but large requests use zero clusters. This
is important because the cluster size is not guest visible.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block/vmdk.c')
-rw-r--r-- | block/vmdk.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/block/vmdk.c b/block/vmdk.c index eb84f46a7b..0734bc200c 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -428,6 +428,10 @@ static int vmdk_add_extent(BlockDriverState *bs, extent->l2_size = l2_size; extent->cluster_sectors = flat ? sectors : cluster_sectors; + if (!flat) { + bs->bl.write_zeroes_alignment = + MAX(bs->bl.write_zeroes_alignment, cluster_sectors); + } if (s->num_extents > 1) { extent->end_sector = (*(extent - 1)).end_sector + extent->sectors; } else { |