summaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2013-06-05 15:17:55 +0200
committerStefan Hajnoczi <stefanha@redhat.com>2013-06-06 11:27:22 +0200
commitbf736fe34caba0688c9095c31b9d097ea15c1296 (patch)
tree1f924e47bbc31d073fea6b4cd753bc6f09dee8e5 /block.c
parent587da2c39c9ace168f4d01fa446a54ae998a2553 (diff)
blkdebug: Add BLKDBG_FLUSH_TO_OS/DISK events
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block.c')
-rw-r--r--block.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/block.c b/block.c
index 3f616de974..79ad33d0f9 100644
--- a/block.c
+++ b/block.c
@@ -3186,13 +3186,11 @@ int bdrv_load_vmstate(BlockDriverState *bs, uint8_t *buf,
void bdrv_debug_event(BlockDriverState *bs, BlkDebugEvent event)
{
- BlockDriver *drv = bs->drv;
-
- if (!drv || !drv->bdrv_debug_event) {
+ if (!bs || !bs->drv || !bs->drv->bdrv_debug_event) {
return;
}
- drv->bdrv_debug_event(bs, event);
+ bs->drv->bdrv_debug_event(bs, event);
}
int bdrv_debug_breakpoint(BlockDriverState *bs, const char *event,
@@ -4024,6 +4022,7 @@ int coroutine_fn bdrv_co_flush(BlockDriverState *bs)
}
/* Write back cached data to the OS even with cache=unsafe */
+ BLKDBG_EVENT(bs->file, BLKDBG_FLUSH_TO_OS);
if (bs->drv->bdrv_co_flush_to_os) {
ret = bs->drv->bdrv_co_flush_to_os(bs);
if (ret < 0) {
@@ -4036,6 +4035,7 @@ int coroutine_fn bdrv_co_flush(BlockDriverState *bs)
goto flush_parent;
}
+ BLKDBG_EVENT(bs->file, BLKDBG_FLUSH_TO_DISK);
if (bs->drv->bdrv_co_flush_to_disk) {
ret = bs->drv->bdrv_co_flush_to_disk(bs);
} else if (bs->drv->bdrv_aio_flush) {