From: Kevin Wolf <kwolf@redhat.com>
To: Luiz Capitulino <lcapitulino@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH 2/2] QMP: Introduce DISK_ERROR event
Date: Tue, 02 Feb 2010 10:30:27 +0100 [thread overview]
Message-ID: <4B67F0B3.3020303@redhat.com> (raw)
In-Reply-To: <1265047668-15039-3-git-send-email-lcapitulino@redhat.com>
Am 01.02.2010 19:07, schrieb Luiz Capitulino:
> It's emitted when a disk write or read fails, some device information
> is provided. We can also provide error details in the future.
>
> Example:
>
> { "event": "DISK_ERROR",
> "data": { "device": "ide0-hd1",
> "operation": "write",
> "action": "stop" }
> "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
>
> 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 +
> vl.c | 34 +++++++++++++++++++++++++++++++++-
> 4 files changed, 44 insertions(+), 1 deletions(-)
>
> diff --git a/QMP/qmp-events.txt b/QMP/qmp-events.txt
> index dc48ccc..e968ef5 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 DISK_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..82edd79 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_DISK_ERROR:
> + event_name = "DISK_ERROR";
> + break;
> default:
> abort();
> break;
> diff --git a/monitor.h b/monitor.h
> index b0f9270..beaddaf 100644
> --- a/monitor.h
> +++ b/monitor.h
> @@ -23,6 +23,7 @@ typedef enum MonitorEvent {
> QEVENT_VNC_CONNECTED,
> QEVENT_VNC_INITIALIZED,
> QEVENT_VNC_DISCONNECTED,
> + QEVENT_DISK_ERROR,
> QEVENT_MAX,
> } MonitorEvent;
>
> diff --git a/vl.c b/vl.c
> index 57c439d..1f69f56 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -1856,10 +1856,42 @@ static BlockInterfaceErrorAction drive_get_err_action(
> return is_read ? BLOCK_ERR_REPORT : BLOCK_ERR_STOP_ENOSPC;
> }
>
> +static void driver_err_event(
> + BlockInterfaceErrorAction action, int is_read, const char *device)
> +{
> + QObject *data;
> + const char *action_str;
> +
> + switch (action) {
> + case BLOCK_ERR_REPORT:
> + action_str = "report";
> + break;
> + case BLOCK_ERR_IGNORE:
> + action_str = "ignore";
> + break;
> + case BLOCK_ERR_STOP_ANY:
> + case BLOCK_ERR_STOP_ENOSPC:
> + action_str = "stop";
This is wrong. If it's BLOCK_ERR_STOP_ENOSPC, the action taken depends
on the error code. It might as well be a "report" instead of "stop" if
it was an EIO, for example.
But the problem is probably going to go away when you stop abusing a
getter function and add some calls that are explicitly made for your
requirements.
Kevin
next prev parent reply other threads:[~2010-02-02 9:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-01 18:07 [Qemu-devel] [RFC 0/2]: QMP DISK_ERROR event Luiz Capitulino
2010-02-01 18:07 ` [Qemu-devel] [PATCH 1/2] block: Introduce drive_get_err_action() Luiz Capitulino
2010-02-01 18:07 ` [Qemu-devel] [PATCH 2/2] QMP: Introduce DISK_ERROR event Luiz Capitulino
2010-02-02 9:30 ` Kevin Wolf [this message]
2010-02-02 9:25 ` [Qemu-devel] Re: [RFC 0/2]: QMP " Kevin Wolf
2010-02-02 12:17 ` Luiz Capitulino
2010-02-02 12:19 ` Kevin Wolf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4B67F0B3.3020303@redhat.com \
--to=kwolf@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.