[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] libxl: libxl_qmp.c should use libxl's own list macros, since they



# HG changeset patch
# User Keir Fraser <keir@xxxxxxx>
# Date 1327164420 0
# Node ID 7f71f0b4b8e66d2c4c95ae7419cd8fb858d6b3df
# Parent  ef8374dfe9bfe400d6ebd087b68884382bcc80be
libxl: libxl_qmp.c should use libxl's own list macros, since they
exist. Also, older Linux versions do not have SIMPLEQ macros in
sys/queue.h.

Signed-off-by: Keir Fraser <keir@xxxxxxx>
---


diff -r ef8374dfe9bf -r 7f71f0b4b8e6 tools/libxl/libxl_qmp.c
--- a/tools/libxl/libxl_qmp.c   Fri Jan 20 18:17:59 2012 +0000
+++ b/tools/libxl/libxl_qmp.c   Sat Jan 21 16:47:00 2012 +0000
@@ -21,10 +21,10 @@
 #include "libxl_osdeps.h" /* must come before any other headers */
 
 #include <sys/un.h>
-#include <sys/queue.h>
 
 #include <yajl/yajl_gen.h>
 
+#include "_libxl_list.h"
 #include "libxl_internal.h"
 
 /* #define DEBUG_RECEIVED */
@@ -56,7 +56,7 @@
     qmp_callback_t callback;
     void *opaque;
     qmp_request_context *context;
-    SIMPLEQ_ENTRY(callback_id_pair) next;
+    LIBXL_STAILQ_ENTRY(struct callback_id_pair) next;
 } callback_id_pair;
 
 struct libxl__qmp_handler {
@@ -74,7 +74,7 @@
     uint32_t domid;
 
     int last_id_used;
-    SIMPLEQ_HEAD(callback_list, callback_id_pair) callback_list;
+    LIBXL_STAILQ_HEAD(callback_list, callback_id_pair) callback_list;
 };
 
 static int qmp_send(libxl__qmp_handler *qmp,
@@ -202,7 +202,7 @@
     if (id_object) {
         id = libxl__json_object_get_integer(id_object);
 
-        SIMPLEQ_FOREACH(pp, &qmp->callback_list, next) {
+        LIBXL_STAILQ_FOREACH(pp, &qmp->callback_list, next) {
             if (pp->id == id) {
                 return pp;
             }
@@ -230,7 +230,7 @@
             /* tell that the id have been processed */
             qmp->wait_for_id = 0;
         }
-        SIMPLEQ_REMOVE(&qmp->callback_list, pp, callback_id_pair, next);
+        LIBXL_STAILQ_REMOVE(&qmp->callback_list, pp, callback_id_pair, next);
         free(pp);
     }
 
@@ -268,7 +268,8 @@
                 /* tell that the id have been processed */
                 qmp->wait_for_id = 0;
             }
-            SIMPLEQ_REMOVE(&qmp->callback_list, pp, callback_id_pair, next);
+            LIBXL_STAILQ_REMOVE(
+                &qmp->callback_list, pp, callback_id_pair, next);
             free(pp);
         }
         return 0;
@@ -302,7 +303,7 @@
     qmp->domid = domid;
     qmp->timeout = 5;
 
-    SIMPLEQ_INIT(&qmp->callback_list);
+    LIBXL_STAILQ_INIT(&qmp->callback_list);
 
     return qmp;
 }
@@ -353,7 +354,7 @@
     callback_id_pair *tmp = NULL;
 
     close(qmp->qmp_fd);
-    SIMPLEQ_FOREACH(pp, &qmp->callback_list, next) {
+    LIBXL_STAILQ_FOREACH(pp, &qmp->callback_list, next) {
         if (tmp)
             free(tmp);
         tmp = pp;
@@ -493,7 +494,7 @@
     elm->callback = callback;
     elm->opaque = opaque;
     elm->context = context;
-    SIMPLEQ_INSERT_TAIL(&qmp->callback_list, elm, next);
+    LIBXL_STAILQ_INSERT_TAIL(&qmp->callback_list, elm, next);
 
     ret = libxl__strndup(gc, (const char*)buf, len);
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.