From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=40741 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P8aVa-00083R-4p for qemu-devel@nongnu.org; Wed, 20 Oct 2010 11:23:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P8aVY-0001Rc-I7 for qemu-devel@nongnu.org; Wed, 20 Oct 2010 11:23:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34379) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P8aVY-0001QW-Bk for qemu-devel@nongnu.org; Wed, 20 Oct 2010 11:23:16 -0400 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 o9KFNCfX022655 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 20 Oct 2010 11:23:13 -0400 From: Kevin Wolf Date: Wed, 20 Oct 2010 17:23:52 +0200 Message-Id: <1287588232-8482-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH] virtio-blk: Respect werror option for flushes 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 The werror option now affects not only write requests, but also flush requests. Previously, it was not possible to stop a VM on a failed flush. Signed-off-by: Kevin Wolf --- hw/virtio-blk.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c index a1df26d..dbe2070 100644 --- a/hw/virtio-blk.c +++ b/hw/virtio-blk.c @@ -106,7 +106,13 @@ static void virtio_blk_flush_complete(void *opaque, int ret) { VirtIOBlockReq *req = opaque; - virtio_blk_req_complete(req, ret ? VIRTIO_BLK_S_IOERR : VIRTIO_BLK_S_OK); + if (ret) { + if (virtio_blk_handle_rw_error(req, -ret, 0)) { + return; + } + } + + virtio_blk_req_complete(req, VIRTIO_BLK_S_OK); } static VirtIOBlockReq *virtio_blk_alloc_request(VirtIOBlock *s) -- 1.7.2.3