aboutsummaryrefslogtreecommitdiff
path: root/block/file-posix.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/file-posix.c')
-rw-r--r--block/file-posix.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/block/file-posix.c b/block/file-posix.c
index dd8d7cb..ca49c1a 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -549,7 +549,6 @@ static int raw_open_common(BlockDriverState *bs, QDict *options,
s->has_discard = true;
s->has_write_zeroes = true;
- bs->supported_zero_flags = BDRV_REQ_MAY_UNMAP;
if ((bs->open_flags & BDRV_O_NOCACHE) != 0) {
s->needs_alignment = true;
}
@@ -599,6 +598,7 @@ static int raw_open_common(BlockDriverState *bs, QDict *options,
}
#endif
+ bs->supported_zero_flags = s->discard_zeroes ? BDRV_REQ_MAY_UNMAP : 0;
ret = 0;
fail:
if (filename && (bdrv_flags & BDRV_O_TEMPORARY)) {
@@ -2223,7 +2223,6 @@ static int raw_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
BDRVRawState *s = bs->opaque;
bdi->unallocated_blocks_are_zero = s->discard_zeroes;
- bdi->can_write_zeroes_with_unmap = s->discard_zeroes;
return 0;
}