From patchwork Wed Feb 3 14:41:00 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 44377 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id EA19EB7D24 for ; Thu, 4 Feb 2010 01:53:40 +1100 (EST) Received: from localhost ([127.0.0.1]:40042 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NcgW3-0005Ds-Ct for incoming@patchwork.ozlabs.org; Wed, 03 Feb 2010 09:47:39 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NcgPv-0001E4-4G for qemu-devel@nongnu.org; Wed, 03 Feb 2010 09:41:19 -0500 Received: from [199.232.76.173] (port=38057 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NcgPu-0001DT-BI for qemu-devel@nongnu.org; Wed, 03 Feb 2010 09:41:18 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NcgPs-0003lN-Qe for qemu-devel@nongnu.org; Wed, 03 Feb 2010 09:41:18 -0500 Received: from mx1.redhat.com ([209.132.183.28]:22481) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NcgPs-0003lE-44 for qemu-devel@nongnu.org; Wed, 03 Feb 2010 09:41:16 -0500 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o13EfExM025092 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 3 Feb 2010 09:41:14 -0500 Received: from localhost (vpn-11-121.rdu.redhat.com [10.11.11.121]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o13EfCAh015527; Wed, 3 Feb 2010 09:41:13 -0500 From: Luiz Capitulino To: qemu-devel@nongnu.org Date: Wed, 3 Feb 2010 12:41:00 -0200 Message-Id: <1265208064-16039-2-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1265208064-16039-1-git-send-email-lcapitulino@redhat.com> References: <1265208064-16039-1-git-send-email-lcapitulino@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: kwolf@redhat.com Subject: [Qemu-devel] [PATCH 1/5] QMP: BLOCK_IO_ERROR event handling X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- 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 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;