qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 1/7] iohandlers: Mark current implementation as 'old


From: Amit Shah
Subject: [Qemu-devel] [PATCH 1/7] iohandlers: Mark current implementation as 'old'
Date: Tue, 22 Feb 2011 15:48:30 +0530

Mark the current iohandler list as 'old'.  In the next commit we'll
introduce a new iohandler api that will replace the list name.

The 'old' list will eventually be completely replaced by the new
implementation.

Signed-off-by: Amit Shah <address@hidden>
---
 vl.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/vl.c b/vl.c
index b436952..e248ec4 100644
--- a/vl.c
+++ b/vl.c
@@ -1037,8 +1037,8 @@ typedef struct IOHandlerRecord {
     QLIST_ENTRY(IOHandlerRecord) next;
 } IOHandlerRecord;
 
-static QLIST_HEAD(, IOHandlerRecord) io_handlers =
-    QLIST_HEAD_INITIALIZER(io_handlers);
+static QLIST_HEAD(, IOHandlerRecord) io_handlers_old =
+    QLIST_HEAD_INITIALIZER(io_handlers_old);
 
 
 /* XXX: fd_read_poll should be suppressed, but an API change is
@@ -1052,19 +1052,19 @@ int qemu_set_fd_handler2(int fd,
     IOHandlerRecord *ioh;
 
     if (!fd_read && !fd_write) {
-        QLIST_FOREACH(ioh, &io_handlers, next) {
+        QLIST_FOREACH(ioh, &io_handlers_old, next) {
             if (ioh->fd == fd) {
                 ioh->deleted = 1;
                 break;
             }
         }
     } else {
-        QLIST_FOREACH(ioh, &io_handlers, next) {
+        QLIST_FOREACH(ioh, &io_handlers_old, next) {
             if (ioh->fd == fd)
                 goto found;
         }
         ioh = qemu_mallocz(sizeof(IOHandlerRecord));
-        QLIST_INSERT_HEAD(&io_handlers, ioh, next);
+        QLIST_INSERT_HEAD(&io_handlers_old, ioh, next);
     found:
         ioh->fd = fd;
         ioh->fd_read_poll = fd_read_poll;
@@ -1347,7 +1347,7 @@ void main_loop_wait(int nonblocking)
     FD_ZERO(&rfds);
     FD_ZERO(&wfds);
     FD_ZERO(&xfds);
-    QLIST_FOREACH(ioh, &io_handlers, next) {
+    QLIST_FOREACH(ioh, &io_handlers_old, next) {
         if (ioh->deleted)
             continue;
         if (ioh->fd_read &&
@@ -1375,7 +1375,7 @@ void main_loop_wait(int nonblocking)
     if (ret > 0) {
         IOHandlerRecord *pioh;
 
-        QLIST_FOREACH_SAFE(ioh, &io_handlers, next, pioh) {
+        QLIST_FOREACH_SAFE(ioh, &io_handlers_old, next, pioh) {
             if (!ioh->deleted && ioh->fd_read && FD_ISSET(ioh->fd, &rfds)) {
                 ioh->fd_read(ioh->opaque);
             }
-- 
1.7.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]