From patchwork Wed Feb 3 14:41:02 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 44379 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 AC8D2B7D24 for ; Thu, 4 Feb 2010 01:54:51 +1100 (EST) Received: from localhost ([127.0.0.1]:41231 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NcgYs-000600-Au for incoming@patchwork.ozlabs.org; Wed, 03 Feb 2010 09:50:34 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NcgQ1-0001JC-GH for qemu-devel@nongnu.org; Wed, 03 Feb 2010 09:41:25 -0500 Received: from [199.232.76.173] (port=38061 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NcgQ0-0001Ih-TD for qemu-devel@nongnu.org; Wed, 03 Feb 2010 09:41:24 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NcgPz-0003mW-Kb for qemu-devel@nongnu.org; Wed, 03 Feb 2010 09:41:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:10045) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NcgPz-0003mK-6a for qemu-devel@nongnu.org; Wed, 03 Feb 2010 09:41:23 -0500 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o13EfMsT028888 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 3 Feb 2010 09:41:22 -0500 Received: from localhost (vpn-11-121.rdu.redhat.com [10.11.11.121]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o13EfH8A001876; Wed, 3 Feb 2010 09:41:21 -0500 From: Luiz Capitulino To: qemu-devel@nongnu.org Date: Wed, 3 Feb 2010 12:41:02 -0200 Message-Id: <1265208064-16039-4-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.17 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: kwolf@redhat.com Subject: [Qemu-devel] [PATCH 3/5] ide: Generate BLOCK_IO_ERROR QMP event 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 Just call bdrv_mon_event() in the right place. Signed-off-by: Luiz Capitulino --- hw/ide/core.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/hw/ide/core.c b/hw/ide/core.c index b6643e8..603e537 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -480,14 +480,17 @@ static int ide_handle_rw_error(IDEState *s, int error, int op) int is_read = (op & BM_STATUS_RETRY_READ); BlockInterfaceErrorAction action = drive_get_on_error(s->bs, is_read); - if (action == BLOCK_ERR_IGNORE) + if (action == BLOCK_ERR_IGNORE) { + bdrv_mon_event(s->bs, BDRV_ACTION_IGNORE, is_read); return 0; + } if ((error == ENOSPC && action == BLOCK_ERR_STOP_ENOSPC) || action == BLOCK_ERR_STOP_ANY) { s->bus->bmdma->unit = s->unit; s->bus->bmdma->status |= op; vm_stop(0); + bdrv_mon_event(s->bs, BDRV_ACTION_STOP, is_read); } else { if (op & BM_STATUS_DMA_RETRY) { dma_buf_commit(s, 0); @@ -495,6 +498,7 @@ static int ide_handle_rw_error(IDEState *s, int error, int op) } else { ide_rw_error(s); } + bdrv_mon_event(s->bs, BDRV_ACTION_REPORT, is_read); } return 1;