From patchwork Fri Jun 3 19:03:54 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 98638 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 106EDB6FAD for ; Sat, 4 Jun 2011 05:28:52 +1000 (EST) Received: from localhost ([::1]:50560 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QSa36-0002qj-A2 for incoming@patchwork.ozlabs.org; Fri, 03 Jun 2011 15:28:48 -0400 Received: from eggs.gnu.org ([140.186.70.92]:59255) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QSZfJ-0005cH-Pz for qemu-devel@nongnu.org; Fri, 03 Jun 2011 15:04:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QSZfI-0002UE-Gi for qemu-devel@nongnu.org; Fri, 03 Jun 2011 15:04:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:4690) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QSZfI-0002Tz-8Y for qemu-devel@nongnu.org; Fri, 03 Jun 2011 15:04:12 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p53J4BWN027301 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 3 Jun 2011 15:04:11 -0400 Received: from localhost (ovpn-113-26.phx2.redhat.com [10.3.113.26]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p53J4AGb031886; Fri, 3 Jun 2011 15:04:10 -0400 From: Luiz Capitulino To: qemu-devel@nongnu.org Date: Fri, 3 Jun 2011 16:03:54 -0300 Message-Id: <1307127842-12102-3-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1307127842-12102-1-git-send-email-lcapitulino@redhat.com> References: <1307127842-12102-1-git-send-email-lcapitulino@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, amit.shah@redhat.com, aliguori@us.ibm.com, armbru@redhat.com Subject: [Qemu-devel] [RFC 02/10] block: Rename bdrv_mon_event() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Rename it to bdrv_error_mon_event() in order to better communicate its purpose. Signed-off-by: Luiz Capitulino --- block.c | 4 ++-- block.h | 4 ++-- hw/ide/core.c | 6 +++--- hw/scsi-disk.c | 6 +++--- hw/virtio-blk.c | 6 +++--- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/block.c b/block.c index a3d0556..959eedd 100644 --- a/block.c +++ b/block.c @@ -1656,8 +1656,8 @@ int bdrv_is_allocated(BlockDriverState *bs, int64_t sector_num, int nb_sectors, return bs->drv->bdrv_is_allocated(bs, sector_num, nb_sectors, pnum); } -void bdrv_mon_event(const BlockDriverState *bdrv, - BlockMonEventAction action, int is_read) +void bdrv_error_mon_event(const BlockDriverState *bdrv, + BlockMonEventAction action, int is_read) { QObject *data; const char *action_str; diff --git a/block.h b/block.h index 131812c..c71bf32 100644 --- a/block.h +++ b/block.h @@ -50,8 +50,8 @@ typedef enum { BDRV_ACTION_REPORT, BDRV_ACTION_IGNORE, BDRV_ACTION_STOP } BlockMonEventAction; -void bdrv_mon_event(const BlockDriverState *bdrv, - BlockMonEventAction action, int is_read); +void bdrv_error_mon_event(const BlockDriverState *bdrv, + BlockMonEventAction action, int is_read); void bdrv_info_print(Monitor *mon, const QObject *data); void bdrv_info(Monitor *mon, QObject **ret_data); void bdrv_stats_print(Monitor *mon, const QObject *data); diff --git a/hw/ide/core.c b/hw/ide/core.c index 45410e8..96c153e 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -440,7 +440,7 @@ static int ide_handle_rw_error(IDEState *s, int error, int op) BlockErrorAction action = bdrv_get_on_error(s->bs, is_read); if (action == BLOCK_ERR_IGNORE) { - bdrv_mon_event(s->bs, BDRV_ACTION_IGNORE, is_read); + bdrv_error_mon_event(s->bs, BDRV_ACTION_IGNORE, is_read); return 0; } @@ -448,7 +448,7 @@ static int ide_handle_rw_error(IDEState *s, int error, int op) || action == BLOCK_ERR_STOP_ANY) { s->bus->dma->ops->set_unit(s->bus->dma, s->unit); s->bus->dma->ops->add_status(s->bus->dma, op); - bdrv_mon_event(s->bs, BDRV_ACTION_STOP, is_read); + bdrv_error_mon_event(s->bs, BDRV_ACTION_STOP, is_read); vm_stop(VMSTOP_DISKFULL); } else { if (op & BM_STATUS_DMA_RETRY) { @@ -457,7 +457,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); + bdrv_error_mon_event(s->bs, BDRV_ACTION_REPORT, is_read); } return 1; diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c index d3f982e..d641309 100644 --- a/hw/scsi-disk.c +++ b/hw/scsi-disk.c @@ -204,7 +204,7 @@ static int scsi_handle_rw_error(SCSIDiskReq *r, int error, int type) BlockErrorAction action = bdrv_get_on_error(s->bs, is_read); if (action == BLOCK_ERR_IGNORE) { - bdrv_mon_event(s->bs, BDRV_ACTION_IGNORE, is_read); + bdrv_error_mon_event(s->bs, BDRV_ACTION_IGNORE, is_read); return 0; } @@ -214,7 +214,7 @@ static int scsi_handle_rw_error(SCSIDiskReq *r, int error, int type) type &= SCSI_REQ_STATUS_RETRY_TYPE_MASK; r->status |= SCSI_REQ_STATUS_RETRY | type; - bdrv_mon_event(s->bs, BDRV_ACTION_STOP, is_read); + bdrv_error_mon_event(s->bs, BDRV_ACTION_STOP, is_read); vm_stop(VMSTOP_DISKFULL); } else { if (type == SCSI_REQ_STATUS_RETRY_READ) { @@ -234,7 +234,7 @@ static int scsi_handle_rw_error(SCSIDiskReq *r, int error, int type) SENSE_CODE(IO_ERROR)); break; } - bdrv_mon_event(s->bs, BDRV_ACTION_REPORT, is_read); + bdrv_error_mon_event(s->bs, BDRV_ACTION_REPORT, is_read); } return 1; } diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c index 91e0394..99db00a 100644 --- a/hw/virtio-blk.c +++ b/hw/virtio-blk.c @@ -69,7 +69,7 @@ static int virtio_blk_handle_rw_error(VirtIOBlockReq *req, int error, VirtIOBlock *s = req->dev; if (action == BLOCK_ERR_IGNORE) { - bdrv_mon_event(s->bs, BDRV_ACTION_IGNORE, is_read); + bdrv_error_mon_event(s->bs, BDRV_ACTION_IGNORE, is_read); return 0; } @@ -77,11 +77,11 @@ static int virtio_blk_handle_rw_error(VirtIOBlockReq *req, int error, || action == BLOCK_ERR_STOP_ANY) { req->next = s->rq; s->rq = req; - bdrv_mon_event(s->bs, BDRV_ACTION_STOP, is_read); + bdrv_error_mon_event(s->bs, BDRV_ACTION_STOP, is_read); vm_stop(VMSTOP_DISKFULL); } else { virtio_blk_req_complete(req, VIRTIO_BLK_S_IOERR); - bdrv_mon_event(s->bs, BDRV_ACTION_REPORT, is_read); + bdrv_error_mon_event(s->bs, BDRV_ACTION_REPORT, is_read); } return 1;