From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=43354 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P9HuI-0002NQ-CU for qemu-devel@nongnu.org; Fri, 22 Oct 2010 09:43:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P9HuG-0003HP-U4 for qemu-devel@nongnu.org; Fri, 22 Oct 2010 09:43:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:18957) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P9HuG-0003H7-M4 for qemu-devel@nongnu.org; Fri, 22 Oct 2010 09:43:40 -0400 From: Kevin Wolf Date: Fri, 22 Oct 2010 15:43:56 +0200 Message-Id: <1287755036-27688-12-git-send-email-kwolf@redhat.com> In-Reply-To: <1287755036-27688-1-git-send-email-kwolf@redhat.com> References: <1287755036-27688-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH 11/11] virtio-blk: Respect werror option for flushes List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: kwolf@redhat.com, qemu-devel@nongnu.org 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