summaryrefslogtreecommitdiff
path: root/block.h
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2010-03-15 17:27:00 +0100
committerKevin Wolf <kwolf@redhat.com>2010-04-23 16:08:46 +0200
commit8b9b0cc2fd1b866c0ce6c7f7385d840aad8b4c2c (patch)
tree9c3d6512caa4ffd0366ca6fe6231042b3e89e943 /block.h
parent25920d6ad61b078a69b6ba401d4d6cd46ce83804 (diff)
blkdebug: Add events and rules
Block drivers can trigger a blkdebug event whenever they reach a place where it could be useful to inject an error for testing/debugging purposes. Rules are read from a blkdebug config file and describe which action is taken when an event is triggered. For now this is only injecting an error (with a few options) or changing the state (which is an integer). Rules can be declared to be active only in a specific state; this way later rules can distiguish on which path we came to trigger their event. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block.h')
-rw-r--r--block.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/block.h b/block.h
index edf57041e1..2fd8361e73 100644
--- a/block.h
+++ b/block.h
@@ -207,4 +207,13 @@ int bdrv_get_dirty(BlockDriverState *bs, int64_t sector);
void bdrv_reset_dirty(BlockDriverState *bs, int64_t cur_sector,
int nr_sectors);
int64_t bdrv_get_dirty_count(BlockDriverState *bs);
+
+
+typedef enum {
+ BLKDBG_EVENT_MAX,
+} BlkDebugEvent;
+
+#define BLKDBG_EVENT(bs, evt) bdrv_debug_event(bs, evt)
+void bdrv_debug_event(BlockDriverState *bs, BlkDebugEvent event);
+
#endif