aboutsummaryrefslogtreecommitdiff
path: root/block.h
diff options
context:
space:
mode:
authorLuiz Capitulino <lcapitulino@redhat.com>2010-02-03 12:41:01 -0200
committerAnthony Liguori <aliguori@us.ibm.com>2010-02-10 11:57:03 -0600
commit2582bfedd2049cefd3337dad69b047669133dacd (patch)
treed8a6d114af8c3b9b81fbe8d4f784367c50b33269 /block.h
parentaa1db6edaf5ba99b6a0fa6e6a45e7568ba5fa4c9 (diff)
downloadqemu-2582bfedd2049cefd3337dad69b047669133dacd.zip
qemu-2582bfedd2049cefd3337dad69b047669133dacd.tar.gz
qemu-2582bfedd2049cefd3337dad69b047669133dacd.tar.bz2
block: BLOCK_IO_ERROR QMP event
This commit introduces the bdrv_mon_event() function, which should be called by block subsystems (eg. IDE) when a I/O error occurs, so that an QMP event is emitted. The following information is currently provided in the event: - device name - operation (ie. "read" or "write") - action taken (eg. "stop") Event example: { "event": "BLOCK_IO_ERROR", "data": { "device": "ide0-hd1", "operation": "write", "action": "stop" }, "timestamp": { "seconds": 1265044230, "microseconds": 450486 } } Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'block.h')
-rw-r--r--block.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/block.h b/block.h
index 536265e..edf5704 100644
--- a/block.h
+++ b/block.h
@@ -44,6 +44,12 @@ typedef struct QEMUSnapshotInfo {
#define BDRV_SECTOR_SIZE (1 << BDRV_SECTOR_BITS)
#define BDRV_SECTOR_MASK ~(BDRV_SECTOR_SIZE - 1);
+typedef enum {
+ BDRV_ACTION_REPORT, BDRV_ACTION_IGNORE, BDRV_ACTION_STOP
+} BlockMonEventAction;
+
+void bdrv_mon_event(const BlockDriverState *bdrv,
+ BlockMonEventAction action, int is_read);
void bdrv_info_print(Monitor *mon, const QObject *data);
void bdrv_info(Monitor *mon, QObject **ret_data);
void bdrv_stats_print(Monitor *mon, const QObject *data);