Skip to content

Commit

Permalink
block: remove bdrv_truncate callback in blkdebug
Browse files Browse the repository at this point in the history
Now that bdrv_truncate is passed to bs->file by default, remove the
callback from block/blkdebug.c and set is_filter to true. is_filter also gives
access to other callbacks that are forwarded automatically to bs->file for
filters.

Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Manos Pitsidianakis <el13635@mail.ntua.gr>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
  • Loading branch information
epilys authored and kevmw committed Sep 4, 2017
1 parent f024aee commit d8e12cd
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions block/blkdebug.c
Expand Up @@ -808,12 +808,6 @@ static int64_t blkdebug_getlength(BlockDriverState *bs)
return bdrv_getlength(bs->file->bs);
}

static int blkdebug_truncate(BlockDriverState *bs, int64_t offset,
PreallocMode prealloc, Error **errp)
{
return bdrv_truncate(bs->file, offset, prealloc, errp);
}

static void blkdebug_refresh_filename(BlockDriverState *bs, QDict *options)
{
BDRVBlkdebugState *s = bs->opaque;
Expand Down Expand Up @@ -896,6 +890,7 @@ static BlockDriver bdrv_blkdebug = {
.format_name = "blkdebug",
.protocol_name = "blkdebug",
.instance_size = sizeof(BDRVBlkdebugState),
.is_filter = true,

.bdrv_parse_filename = blkdebug_parse_filename,
.bdrv_file_open = blkdebug_open,
Expand All @@ -904,7 +899,6 @@ static BlockDriver bdrv_blkdebug = {
.bdrv_child_perm = bdrv_filter_default_perms,

.bdrv_getlength = blkdebug_getlength,
.bdrv_truncate = blkdebug_truncate,
.bdrv_refresh_filename = blkdebug_refresh_filename,
.bdrv_refresh_limits = blkdebug_refresh_limits,

Expand Down

0 comments on commit d8e12cd

Please sign in to comment.