aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2010-10-20 13:17:30 +0200
committerKevin Wolf <kwolf@redhat.com>2010-10-22 14:49:35 +0200
commit8c269b542c5bbbcd74c1664959b223d941a2893b (patch)
tree4199e1875c5ec45d9d925f4ee61c41a5216c5903 /hw
parente2bcadadc35673223c1445152445d0c9b6887b9e (diff)
downloadqemu-8c269b542c5bbbcd74c1664959b223d941a2893b.zip
qemu-8c269b542c5bbbcd74c1664959b223d941a2893b.tar.gz
qemu-8c269b542c5bbbcd74c1664959b223d941a2893b.tar.bz2
virtio-blk: Respect werror option for flushes
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 <kwolf@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/virtio-blk.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c
index a1df26d..dbe20707 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)