Skip to content

Commit

Permalink
QMP: BLOCK_IO_ERROR event handling
Browse files Browse the repository at this point in the history
This commit adds the basic definitions for the BLOCK_IO_ERROR
event, but actual event emission will be introduced by the
next commits.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
  • Loading branch information
Luiz Capitulino authored and Anthony Liguori committed Feb 10, 2010
1 parent f4f0d39 commit aa1db6e
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
21 changes: 21 additions & 0 deletions QMP/qmp-events.txt
Expand Up @@ -43,3 +43,24 @@ Data: 'server' and 'client' keys with the same keys as 'query-vnc'.

Description: Issued when the VNC session is made active.
Data: 'server' and 'client' keys with the same keys as 'query-vnc'.

7 BLOCK_IO_ERROR
----------------

Description: Issued when a disk I/O error occurs
Data:

- 'device': device name (json-string)
- 'operation': I/O operation (json-string, "read" or "write")
- 'action': action that has been taken, it's one of the following:
"ignore": error has been ignored
"report": error has been reported to the device
"stop": error caused VM to be stopped

Example:

{ "event": "BLOCK_IO_ERROR",
"data": { "device": "ide0-hd1",
"operation": "write",
"action": "stop" },
"timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
3 changes: 3 additions & 0 deletions monitor.c
Expand Up @@ -388,6 +388,9 @@ void monitor_protocol_event(MonitorEvent event, QObject *data)
case QEVENT_VNC_DISCONNECTED:
event_name = "VNC_DISCONNECTED";
break;
case QEVENT_BLOCK_IO_ERROR:
event_name = "BLOCK_IO_ERROR";
break;
default:
abort();
break;
Expand Down
1 change: 1 addition & 0 deletions monitor.h
Expand Up @@ -23,6 +23,7 @@ typedef enum MonitorEvent {
QEVENT_VNC_CONNECTED,
QEVENT_VNC_INITIALIZED,
QEVENT_VNC_DISCONNECTED,
QEVENT_BLOCK_IO_ERROR,
QEVENT_MAX,
} MonitorEvent;

Expand Down

0 comments on commit aa1db6e

Please sign in to comment.