summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2016-08-11 11:48:46 +0100
committerPeter Maydell <peter.maydell@linaro.org>2016-08-11 11:48:46 +0100
commit144a6db0b0eb444e2b0ffd5b8ceb39bebd89a078 (patch)
tree7c5a9bf11041872e2051b821439dbd57b1f532c1
parentd08306dc42ea599ffcf8aad056fa9c23acfbe230 (diff)
parent44713c9e8547f0ff41e3e257f0dd5c17bb497225 (diff)
downloadfocaccia-qemu-144a6db0b0eb444e2b0ffd5b8ceb39bebd89a078.tar.gz
focaccia-qemu-144a6db0b0eb444e2b0ffd5b8ceb39bebd89a078.zip
Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging
# gpg: Signature made Thu 11 Aug 2016 11:35:33 BST
# gpg:                using RSA key 0x9CA4ABB381AB73C8
# gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>"
# gpg:                 aka "Stefan Hajnoczi <stefanha@gmail.com>"
# Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8

* remotes/stefanha/tags/block-pull-request:
  linux-aio: Handle io_submit() failure gracefully

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--block/linux-aio.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/block/linux-aio.c b/block/linux-aio.c
index de3548f2ab..e906abebb3 100644
--- a/block/linux-aio.c
+++ b/block/linux-aio.c
@@ -221,7 +221,13 @@ static void ioq_submit(LinuxAioState *s)
             break;
         }
         if (ret < 0) {
-            abort();
+            /* Fail the first request, retry the rest */
+            aiocb = QSIMPLEQ_FIRST(&s->io_q.pending);
+            QSIMPLEQ_REMOVE_HEAD(&s->io_q.pending, next);
+            s->io_q.in_queue--;
+            aiocb->ret = ret;
+            qemu_laio_process_completion(aiocb);
+            continue;
         }
 
         s->io_q.in_flight += ret;