Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NcQ1D-0002zu-VL for qemu-devel@nongnu.org; Tue, 02 Feb 2010 16:10:44 -0500 Received: from [199.232.76.173] (port=50363 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NcQ1D-0002z2-9M for qemu-devel@nongnu.org; Tue, 02 Feb 2010 16:10:43 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NcQ1C-00015S-0T for qemu-devel@nongnu.org; Tue, 02 Feb 2010 16:10:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49230) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NcQ1B-00015M-I2 for qemu-devel@nongnu.org; Tue, 02 Feb 2010 16:10:41 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o12LAe9x024709 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 2 Feb 2010 16:10:40 -0500 From: Luiz Capitulino Date: Tue, 2 Feb 2010 19:10:13 -0200 Message-Id: <1265145013-23231-6-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> Subject: [Qemu-devel] [PATCH 5/5] virtio-blk: Generate BLOCK_IO_ERROR QMP event List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com Just call bdrv_mon_event() in the right place. Signed-off-by: Luiz Capitulino --- hw/virtio-blk.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c index 037a79c..75adbec 100644 --- a/hw/virtio-blk.c +++ b/hw/virtio-blk.c @@ -105,16 +105,20 @@ static int virtio_blk_handle_rw_error(VirtIOBlockReq *req, int error, drive_get_on_error(req->dev->bs, is_read); VirtIOBlock *s = req->dev; - if (action == BLOCK_ERR_IGNORE) + if (action == BLOCK_ERR_IGNORE) { + bdrv_mon_event(req->dev->bs, BDRV_ACTION_IGNORE, is_read); return 0; + } if ((error == ENOSPC && action == BLOCK_ERR_STOP_ENOSPC) || action == BLOCK_ERR_STOP_ANY) { req->next = s->rq; s->rq = req; vm_stop(0); + bdrv_mon_event(req->dev->bs, BDRV_ACTION_STOP, is_read); } else { virtio_blk_req_complete(req, VIRTIO_BLK_S_IOERR); + bdrv_mon_event(req->dev->bs, BDRV_ACTION_REPORT, is_read); } return 1; -- 1.6.6