From 5d66417b3c0b3c40cbcc309b0db0c14fc63f03f0 Mon Sep 17 00:00:00 2001 From: Luiz Capitulino Date: Thu, 11 Feb 2010 19:48:23 -0200 Subject: [PATCH 1/7] QMP: BLOCK_IO_ERROR event handling RH-Author: Luiz Capitulino Message-id: <1265917707-30536-2-git-send-email-lcapitulino@redhat.com> Patchwork-id: 7067 O-Subject: [PATCH RHEL6 qemu-kvm 1/5] QMP: BLOCK_IO_ERROR event handling Bugzilla: 547501 RH-Acked-by: Kevin Wolf RH-Acked-by: Juan Quintela RH-Acked-by: Markus Armbruster 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 Signed-off-by: Anthony Liguori (cherry picked from commit aa1db6edaf5ba99b6a0fa6e6a45e7568ba5fa4c9) --- QMP/qmp-events.txt | 21 +++++++++++++++++++++ monitor.c | 3 +++ monitor.h | 1 + 3 files changed, 25 insertions(+), 0 deletions(-) Signed-off-by: Glauber Costa --- QMP/qmp-events.txt | 21 +++++++++++++++++++++ monitor.c | 3 +++ monitor.h | 1 + 3 files changed, 25 insertions(+), 0 deletions(-) diff --git a/QMP/qmp-events.txt b/QMP/qmp-events.txt index dc48ccc..d585a8d 100644 --- a/QMP/qmp-events.txt +++ b/QMP/qmp-events.txt @@ -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 } } diff --git a/monitor.c b/monitor.c index 40acacf..15e5d3f 100644 --- a/monitor.c +++ b/monitor.c @@ -370,6 +370,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; diff --git a/monitor.h b/monitor.h index 2da30e8..2dc6d60 100644 --- 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; -- 1.6.6