diff mbox

[37/41] QLIST: Introduce QLIST_COPY_HEAD

Message ID a5587cc9b208463d3877e211b1a7864e24f3c31a.1259754427.git.quintela@redhat.com
State New
Headers show

Commit Message

Juan Quintela Dec. 2, 2009, 12:04 p.m. UTC
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(-)
diff mbox

Patch

diff --git a/qemu-queue.h b/qemu-queue.h
index 8877efd..a59f948 100644
--- a/qemu-queue.h
+++ b/qemu-queue.h
@@ -92,6 +92,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 =               \