]> git.proxmox.com Git - qemu.git/commitdiff
blkdebug: pass getlength to underlying file
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 6 Jun 2012 06:10:41 +0000 (08:10 +0200)
committerKevin Wolf <kwolf@redhat.com>
Mon, 9 Jul 2012 13:53:02 +0000 (15:53 +0200)
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 <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/blkdebug.c

index 1f79ef2a00794f8f627c8009051f47793b772315..b084a232cfa484de4b59428d9593d0ca83dcdfd9 100644 (file)
@@ -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,