]> git.proxmox.com Git - qemu.git/commitdiff
QMP: BLOCK_IO_ERROR event handling
authorLuiz Capitulino <lcapitulino@redhat.com>
Wed, 3 Feb 2010 14:41:00 +0000 (12:41 -0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Wed, 10 Feb 2010 17:57:02 +0000 (11:57 -0600)
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>
QMP/qmp-events.txt
monitor.c
monitor.h

index dc48cccea17444eb8ae1b083d2e2e1f8decd8761..d585a8d1b6d7994715616e8ea5bed5ef6f934a86 100644 (file)
@@ -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 } }
index ff22123693b76e2be61275bc6665c1c818d6232c..19876adbc207eee847cd84bee81b6bd684c472f5 100644 (file)
--- a/monitor.c
+++ b/monitor.c
@@ -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;
index b0f9270a939eb92aaac3afb77897c2b8f1c884d9..e35f1e4c651c54d8d1cddbc276ff0be1cfce8b58 100644 (file)
--- a/monitor.h
+++ b/monitor.h
@@ -23,6 +23,7 @@ typedef enum MonitorEvent {
     QEVENT_VNC_CONNECTED,
     QEVENT_VNC_INITIALIZED,
     QEVENT_VNC_DISCONNECTED,
+    QEVENT_BLOCK_IO_ERROR,
     QEVENT_MAX,
 } MonitorEvent;