From 8b9b0cc2fd1b866c0ce6c7f7385d840aad8b4c2c Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Mon, 15 Mar 2010 17:27:00 +0100 Subject: 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 --- block_int.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'block_int.h') diff --git a/block_int.h b/block_int.h index 71b633b788..e7e1e7e514 100644 --- a/block_int.h +++ b/block_int.h @@ -120,6 +120,8 @@ struct BlockDriver { /* Returns number of errors in image, -errno for internal errors */ int (*bdrv_check)(BlockDriverState* bs); + void (*bdrv_debug_event)(BlockDriverState *bs, BlkDebugEvent event); + /* Set if newly created images are not guaranteed to contain only zeros */ int no_zero_init; -- cgit v1.2.3