Patchwork [7/9] QLIST: Introduce QLIST_COPY_HEAD

login
register
mail settings
Submitter Juan Quintela
Date March 16, 2010, 6:51 p.m.
Message ID <233a28493393ba2abfd43592281523ec06d43cfd.1268765204.git.quintela@redhat.com>
Download mbox | patch
Permalink /patch/47894/
State New
Headers show

Comments

Juan Quintela - March 16, 2010, 6:51 p.m.
This operation copies one head into other.

Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 qemu-queue.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

Patch

diff --git a/qemu-queue.h b/qemu-queue.h
index 1d07745..bf5cfdc 100644
--- a/qemu-queue.h
+++ b/qemu-queue.h
@@ -100,6 +100,10 @@  struct {                                                                \
         (head)->lh_first = NULL;                                        \
 } while (/*CONSTCOND*/0)

+#define QLIST_COPY_HEAD(head, origin) do {                              \
+        (head)->lh_first = (origin)->lh_first;                          \
+} while (/*CONSTCOND*/0)
+
 #define QLIST_INSERT_AFTER(listelm, elm, field) do {                    \
         if (((elm)->field.le_next = (listelm)->field.le_next) != NULL)  \
                 (listelm)->field.le_next->field.le_prev =               \