From: Kevin Wolf <kwolf@redhat.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, afaerber@suse.de, stefanha@redhat.com
Subject: [Qemu-devel] [PATCH 1/3] blkdebug: Add BLKDBG_FLUSH_TO_OS/DISK events
Date: Wed, 29 May 2013 13:34:04 +0200 [thread overview]
Message-ID: <1369827246-2802-2-git-send-email-kwolf@redhat.com> (raw)
In-Reply-To: <1369827246-2802-1-git-send-email-kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
block.c | 8 ++++----
block/blkdebug.c | 3 +++
include/block/block.h | 3 +++
3 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/block.c b/block.c
index 3f87489..52a2101 100644
--- a/block.c
+++ b/block.c
@@ -3307,13 +3307,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,
@@ -4326,6 +4324,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) {
@@ -4338,6 +4337,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) {
diff --git a/block/blkdebug.c b/block/blkdebug.c
index 71f99e4..ccb627a 100644
--- a/block/blkdebug.c
+++ b/block/blkdebug.c
@@ -182,6 +182,9 @@ static const char *event_names[BLKDBG_EVENT_MAX] = {
[BLKDBG_CLUSTER_ALLOC] = "cluster_alloc",
[BLKDBG_CLUSTER_ALLOC_BYTES] = "cluster_alloc_bytes",
[BLKDBG_CLUSTER_FREE] = "cluster_free",
+
+ [BLKDBG_FLUSH_TO_OS] = "flush_to_os",
+ [BLKDBG_FLUSH_TO_DISK] = "flush_to_disk",
};
static int get_event_by_name(const char *name, BlkDebugEvent *event)
diff --git a/include/block/block.h b/include/block/block.h
index 1251c5c..ce350c7 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -449,6 +449,9 @@ typedef enum {
BLKDBG_CLUSTER_ALLOC_BYTES,
BLKDBG_CLUSTER_FREE,
+ BLKDBG_FLUSH_TO_OS,
+ BLKDBG_FLUSH_TO_DISK,
+
BLKDBG_EVENT_MAX,
} BlkDebugEvent;
--
1.8.1.4
next prev parent reply other threads:[~2013-05-29 11:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-29 11:34 [Qemu-devel] [PATCH 0/3] ide: Set BSY bit during FLUSH Kevin Wolf
2013-05-29 11:34 ` Kevin Wolf [this message]
2013-05-29 11:34 ` [Qemu-devel] [PATCH 2/3] " Kevin Wolf
2013-05-29 11:50 ` Andreas Färber
2013-05-29 12:46 ` Kevin Wolf
2013-05-29 11:34 ` [Qemu-devel] [PATCH 3/3] ide-test: Add FLUSH CACHE test case Kevin Wolf
2013-05-30 7:24 ` Stefan Hajnoczi
2013-05-30 7:25 ` [Qemu-devel] [PATCH 0/3] ide: Set BSY bit during FLUSH Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1369827246-2802-2-git-send-email-kwolf@redhat.com \
--to=kwolf@redhat.com \
--cc=afaerber@suse.de \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.