From patchwork Tue Feb 22 10:18:30 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Shah X-Patchwork-Id: 83949 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id AC492B6F12 for ; Tue, 22 Feb 2011 21:22:15 +1100 (EST) Received: from localhost ([127.0.0.1]:40096 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PrpNk-0001Tp-P9 for incoming@patchwork.ozlabs.org; Tue, 22 Feb 2011 05:22:12 -0500 Received: from [140.186.70.92] (port=39144 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PrpKf-0000Fj-Kz for qemu-devel@nongnu.org; Tue, 22 Feb 2011 05:19:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PrpKe-0005f3-HK for qemu-devel@nongnu.org; Tue, 22 Feb 2011 05:19:01 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45564) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PrpKe-0005ex-50 for qemu-devel@nongnu.org; Tue, 22 Feb 2011 05:19:00 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p1MAIv6K001144 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 22 Feb 2011 05:18:57 -0500 Received: from localhost (ovpn-113-98.phx2.redhat.com [10.3.113.98]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p1MAIrdm030369; Tue, 22 Feb 2011 05:18:56 -0500 From: Amit Shah To: qemu list Date: Tue, 22 Feb 2011 15:48:30 +0530 Message-Id: <689bf4c031ed209bb306dacdd575b0a9bdb89cc5.1298369272.git.amit.shah@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: Amit Shah , Gerd Hoffmann Subject: [Qemu-devel] [PATCH 1/7] iohandlers: Mark current implementation as 'old' X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- 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); }