Support the flag if the underlying BDS supports it Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- block/blkdebug.c | 3 ++- block/blkverify.c | 2 +- block/mirror.c | 2 +- block/raw-format.c | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/block/blkdebug.c b/block/blkdebug.c index 234c8fb9..2ac3e12 100644 --- a/block/blkdebug.c +++ b/block/blkdebug.c @@ -414,7 +414,8 @@ static int blkdebug_open(BlockDriverState *bs, QDict *options, int flags, bs->supported_write_flags = BDRV_REQ_FUA & bs->file->bs->supported_write_flags; - bs->supported_zero_flags = (BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP) & + bs->supported_zero_flags = + (BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP | BDRV_REQ_ALLOCATE) & bs->file->bs->supported_zero_flags; ret = -EINVAL; diff --git a/block/blkverify.c b/block/blkverify.c index 9ba65d0..b249636 100644 --- a/block/blkverify.c +++ b/block/blkverify.c @@ -145,7 +145,7 @@ static int blkverify_open(BlockDriverState *bs, QDict *options, int flags, s->test_file->bs->supported_write_flags; bs->supported_zero_flags = - (BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP) & + (BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP | BDRV_REQ_ALLOCATE) & bs->file->bs->supported_zero_flags & s->test_file->bs->supported_zero_flags; diff --git a/block/mirror.c b/block/mirror.c index 7e539f1..5510776 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -1059,7 +1059,7 @@ static void bdrv_mirror_top_refresh_filename(BlockDriverState *bs, QDict *opts) bs->supported_write_flags = BDRV_REQ_FUA & bs->backing->bs->supported_write_flags; bs->supported_zero_flags = - (BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP) & + (BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP | BDRV_REQ_ALLOCATE) & bs->backing->bs->supported_zero_flags; } diff --git a/block/raw-format.c b/block/raw-format.c index 22c7e98..434af74 100644 --- a/block/raw-format.c +++ b/block/raw-format.c @@ -417,7 +417,8 @@ static int raw_open(BlockDriverState *bs, QDict *options, int flags, bs->sg = bs->file->bs->sg; bs->supported_write_flags = BDRV_REQ_FUA & bs->file->bs->supported_write_flags; - bs->supported_zero_flags = (BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP) & + bs->supported_zero_flags = + (BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP | BDRV_REQ_ALLOCATE) & bs->file->bs->supported_zero_flags; if (bs->probed && !bdrv_is_read_only(bs)) { -- 2.7.4