From patchwork Tue Feb 2 21:10:11 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 44308 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 EF530B7D40 for ; Wed, 3 Feb 2010 08:21:38 +1100 (EST) Received: from localhost ([127.0.0.1]:39481 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NcQ6k-0004Fo-37 for incoming@patchwork.ozlabs.org; Tue, 02 Feb 2010 16:16:26 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NcQ18-0002vF-Nn for qemu-devel@nongnu.org; Tue, 02 Feb 2010 16:10:38 -0500 Received: from [199.232.76.173] (port=50358 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NcQ18-0002uS-4O for qemu-devel@nongnu.org; Tue, 02 Feb 2010 16:10:38 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NcQ16-00014n-SB for qemu-devel@nongnu.org; Tue, 02 Feb 2010 16:10:37 -0500 Received: from mx1.redhat.com ([209.132.183.28]:61105) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NcQ16-00014Y-9O for qemu-devel@nongnu.org; Tue, 02 Feb 2010 16:10:36 -0500 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o12LAZYI002321 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 2 Feb 2010 16:10:35 -0500 Received: from localhost (vpn-8-46.rdu.redhat.com [10.11.8.46]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o12LAXr9022285; Tue, 2 Feb 2010 16:10:34 -0500 From: Luiz Capitulino To: qemu-devel@nongnu.org Date: Tue, 2 Feb 2010 19:10:11 -0200 Message-Id: <1265145013-23231-4-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1265145013-23231-1-git-send-email-lcapitulino@redhat.com> References: <1265145013-23231-1-git-send-email-lcapitulino@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 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;