From: Paolo Bonzini Date: Wed, 6 Jun 2012 06:10:41 +0000 (+0200) Subject: blkdebug: pass getlength to underlying file X-Git-Tag: v1.2.0-rc0~189^2~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e130225587cb0d48b2c0b7c04b6bf9c95fe75ac9;p=thirdparty%2Fqemu.git blkdebug: pass getlength to underlying file This is required when using blkdebug with raw format. Unlike qcow2/QED, raw asks blkdebug for the length of the file, it doesn't get it from a header. Signed-off-by: Paolo Bonzini Signed-off-by: Kevin Wolf --- diff --git a/block/blkdebug.c b/block/blkdebug.c index 1f79ef2a007..b084a232cfa 100644 --- a/block/blkdebug.c +++ b/block/blkdebug.c @@ -429,6 +429,11 @@ static void blkdebug_debug_event(BlockDriverState *bs, BlkDebugEvent event) } } +static int64_t blkdebug_getlength(BlockDriverState *bs) +{ + return bdrv_getlength(bs->file); +} + static BlockDriver bdrv_blkdebug = { .format_name = "blkdebug", .protocol_name = "blkdebug", @@ -437,6 +442,7 @@ static BlockDriver bdrv_blkdebug = { .bdrv_file_open = blkdebug_open, .bdrv_close = blkdebug_close, + .bdrv_getlength = blkdebug_getlength, .bdrv_aio_readv = blkdebug_aio_readv, .bdrv_aio_writev = blkdebug_aio_writev,