From d8e12cd3227f0cb3b5558563f094088cfefb8f21 Mon Sep 17 00:00:00 2001 From: Manos Pitsidianakis Date: Thu, 13 Jul 2017 18:30:27 +0300 Subject: block: remove bdrv_truncate callback in blkdebug 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 Reviewed-by: Stefan Hajnoczi Signed-off-by: Manos Pitsidianakis Signed-off-by: Kevin Wolf --- block/blkdebug.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'block/blkdebug.c') diff --git a/block/blkdebug.c b/block/blkdebug.c index 8e385acf54..f10e3e5638 100644 --- a/block/blkdebug.c +++ b/block/blkdebug.c @@ -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; @@ -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, @@ -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, -- cgit v1.2.3