diff options
author | Eric Blake <eblake@redhat.com> | 2020-03-24 12:42:33 -0500 |
---|---|---|
committer | Max Reitz <mreitz@redhat.com> | 2020-03-26 14:44:33 +0100 |
commit | ed049910637be991c88cc25c864115bc5b1e4dab (patch) | |
tree | 1093b65eca9e4ebf89faa095169c2ef5d36399e0 /block/sheepdog.c | |
parent | e7be13ad3ff593608a118bfb69553037bd221563 (diff) | |
download | qemu-ed049910637be991c88cc25c864115bc5b1e4dab.zip qemu-ed049910637be991c88cc25c864115bc5b1e4dab.tar.gz qemu-ed049910637be991c88cc25c864115bc5b1e4dab.tar.bz2 |
sheepdog: Consistently set bdrv_has_zero_init_truncate
block_int.h claims that .bdrv_has_zero_init must return 0 if
.bdrv_has_zero_init_truncate does likewise; but this is violated if
only the former callback is provided if .bdrv_co_truncate also exists.
When adding the latter callback, it was mistakenly added to only one
of the three possible sheepdog instantiations.
Fixes: 1dcaf527
Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <20200324174233.1622067-5-eblake@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'block/sheepdog.c')
-rw-r--r-- | block/sheepdog.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/block/sheepdog.c b/block/sheepdog.c index a8a7e32..59f7ebb 100644 --- a/block/sheepdog.c +++ b/block/sheepdog.c @@ -3271,6 +3271,7 @@ static BlockDriver bdrv_sheepdog_tcp = { .bdrv_co_create = sd_co_create, .bdrv_co_create_opts = sd_co_create_opts, .bdrv_has_zero_init = bdrv_has_zero_init_1, + .bdrv_has_zero_init_truncate = bdrv_has_zero_init_1, .bdrv_getlength = sd_getlength, .bdrv_get_allocated_file_size = sd_get_allocated_file_size, .bdrv_co_truncate = sd_co_truncate, @@ -3309,6 +3310,7 @@ static BlockDriver bdrv_sheepdog_unix = { .bdrv_co_create = sd_co_create, .bdrv_co_create_opts = sd_co_create_opts, .bdrv_has_zero_init = bdrv_has_zero_init_1, + .bdrv_has_zero_init_truncate = bdrv_has_zero_init_1, .bdrv_getlength = sd_getlength, .bdrv_get_allocated_file_size = sd_get_allocated_file_size, .bdrv_co_truncate = sd_co_truncate, |