Patchwork [1/5] QMP: BLOCK_IO_ERROR event handling

login
register
mail settings
Submitter Luiz Capitulino
Date Feb. 2, 2010, 9:10 p.m.
Message ID <1265145013-23231-2-git-send-email-lcapitulino@redhat.com>
Download mbox | patch
Permalink /patch/44310/
State New
Headers show

Comments

Luiz Capitulino - Feb. 2, 2010, 9:10 p.m.
This commit adds the basic definitions for the BLOCK_IO_ERROR
event, but actual event emission will be introduced by the
next commits.

NOTE: Adding a small reference in QMP/qmp-events.txt, but this
file is wrong and will be replaced by proper documentation shortly.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
 QMP/qmp-events.txt |    7 +++++++
 monitor.c          |    3 +++
 monitor.h          |    1 +
 3 files changed, 11 insertions(+), 0 deletions(-)
Kevin Wolf - Feb. 3, 2010, 9:18 a.m.
Am 02.02.2010 22:10, schrieb Luiz Capitulino:
> This commit adds the basic definitions for the BLOCK_IO_ERROR
> event, but actual event emission will be introduced by the
> next commits.
> 
> NOTE: Adding a small reference in QMP/qmp-events.txt, but this
> file is wrong and will be replaced by proper documentation shortly.
> 
> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
> ---
>  QMP/qmp-events.txt |    7 +++++++
>  monitor.c          |    3 +++
>  monitor.h          |    1 +
>  3 files changed, 11 insertions(+), 0 deletions(-)
> 
> diff --git a/QMP/qmp-events.txt b/QMP/qmp-events.txt
> index dc48ccc..7886192 100644
> --- a/QMP/qmp-events.txt
> +++ b/QMP/qmp-events.txt
> @@ -43,3 +43,10 @@ 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), 'action' (action to be taken),
> +      'operation' ("read" or "write")

I think we should document what allowed values for action are and what
their meaning is. And isn't it actually "action that has been taken"?

Kevin
Luiz Capitulino - Feb. 3, 2010, 11:27 a.m.
On Wed, 03 Feb 2010 10:18:37 +0100
Kevin Wolf <kwolf@redhat.com> wrote:

> Am 02.02.2010 22:10, schrieb Luiz Capitulino:
> > This commit adds the basic definitions for the BLOCK_IO_ERROR
> > event, but actual event emission will be introduced by the
> > next commits.
> > 
> > NOTE: Adding a small reference in QMP/qmp-events.txt, but this
> > file is wrong and will be replaced by proper documentation shortly.
> > 
> > Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
> > ---
> >  QMP/qmp-events.txt |    7 +++++++
> >  monitor.c          |    3 +++
> >  monitor.h          |    1 +
> >  3 files changed, 11 insertions(+), 0 deletions(-)
> > 
> > diff --git a/QMP/qmp-events.txt b/QMP/qmp-events.txt
> > index dc48ccc..7886192 100644
> > --- a/QMP/qmp-events.txt
> > +++ b/QMP/qmp-events.txt
> > @@ -43,3 +43,10 @@ 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), 'action' (action to be taken),
> > +      'operation' ("read" or "write")
> 
> I think we should document what allowed values for action are and what
> their meaning is. And isn't it actually "action that has been taken"?

 Right, sometimes I don't know how to document this stuff
because this file is going to be replaced soon...

Patch

diff --git a/QMP/qmp-events.txt b/QMP/qmp-events.txt
index dc48ccc..7886192 100644
--- a/QMP/qmp-events.txt
+++ b/QMP/qmp-events.txt
@@ -43,3 +43,10 @@  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), 'action' (action to be taken),
+      'operation' ("read" or "write")
diff --git a/monitor.c b/monitor.c
index fb7c572..6e688ac 100644
--- a/monitor.c
+++ b/monitor.c
@@ -378,6 +378,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 b0f9270..e35f1e4 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;