summary refs log tree commit diff stats
path: root/include/qemu/queue.h
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2018-03-27 17:11:33 +0100
committerPeter Maydell <peter.maydell@linaro.org>2018-03-27 17:11:33 +0100
commit6cf38cbf2961c57bd85022cf9adf7ef85dae0f02 (patch)
tree834a4d30e1dc544b425d52dd429f2191b99539c9 /include/qemu/queue.h
parentdfe732fb68ef9195517f4f380a477d58a054edc1 (diff)
parentf5a53faad4bfbf1b86012a13055d2a1a774a42b6 (diff)
downloadfocaccia-qemu-6cf38cbf2961c57bd85022cf9adf7ef85dae0f02.tar.gz
focaccia-qemu-6cf38cbf2961c57bd85022cf9adf7ef85dae0f02.zip
Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging
# gpg: Signature made Tue 27 Mar 2018 15:41:11 BST
# gpg:                using RSA key 9CA4ABB381AB73C8
# 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:
  MAINTAINERS: add include/block/aio-wait.h
  coroutine: add test-aio coroutine queue chaining test case
  coroutine: avoid co_queue_wakeup recursion
  queue: add QSIMPLEQ_PREPEND()

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include/qemu/queue.h')
-rw-r--r--include/qemu/queue.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/qemu/queue.h b/include/qemu/queue.h
index aa270d2b38..59fd1203a1 100644
--- a/include/qemu/queue.h
+++ b/include/qemu/queue.h
@@ -324,6 +324,14 @@ struct {                                                                \
     }                                                                   \
 } while (/*CONSTCOND*/0)
 
+#define QSIMPLEQ_PREPEND(head1, head2) do {                             \
+    if (!QSIMPLEQ_EMPTY((head2))) {                                     \
+        *(head2)->sqh_last = (head1)->sqh_first;                        \
+        (head1)->sqh_first = (head2)->sqh_first;                          \
+        QSIMPLEQ_INIT((head2));                                         \
+    }                                                                   \
+} while (/*CONSTCOND*/0)
+
 #define QSIMPLEQ_LAST(head, type, field)                                \
     (QSIMPLEQ_EMPTY((head)) ?                                           \
         NULL :                                                          \