From patchwork Mon Feb 18 21:48:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony Liguori X-Patchwork-Id: 221508 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 126622C0095 for ; Tue, 19 Feb 2013 08:49:55 +1100 (EST) Received: from localhost ([::1]:55758 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7Yav-0004Ns-9y for incoming@patchwork.ozlabs.org; Mon, 18 Feb 2013 16:49:53 -0500 Received: from eggs.gnu.org ([208.118.235.92]:60105) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7Ya3-0003GP-5L for qemu-devel@nongnu.org; Mon, 18 Feb 2013 16:49:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U7Ya1-0004Kh-L0 for qemu-devel@nongnu.org; Mon, 18 Feb 2013 16:48:59 -0500 Received: from e28smtp08.in.ibm.com ([122.248.162.8]:35310) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7Ya1-0004K3-2q for qemu-devel@nongnu.org; Mon, 18 Feb 2013 16:48:57 -0500 Received: from /spool/local by e28smtp08.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 19 Feb 2013 03:15:35 +0530 Received: from d28dlp01.in.ibm.com (9.184.220.126) by e28smtp08.in.ibm.com (192.168.1.138) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 19 Feb 2013 03:15:33 +0530 Received: from d28relay03.in.ibm.com (d28relay03.in.ibm.com [9.184.220.60]) by d28dlp01.in.ibm.com (Postfix) with ESMTP id C462BE004C for ; Tue, 19 Feb 2013 03:19:48 +0530 (IST) Received: from d28av04.in.ibm.com (d28av04.in.ibm.com [9.184.220.66]) by d28relay03.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r1ILmmVv38273162 for ; Tue, 19 Feb 2013 03:18:48 +0530 Received: from d28av04.in.ibm.com (loopback [127.0.0.1]) by d28av04.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r1ILmpoe026953 for ; Tue, 19 Feb 2013 08:48:51 +1100 Received: from titi.austin.rr.com (sig-9-76-14-15.mts.ibm.com [9.76.14.15]) by d28av04.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id r1ILmKBf025719; Tue, 19 Feb 2013 08:48:50 +1100 From: Anthony Liguori To: qemu-devel@nongnu.org Date: Mon, 18 Feb 2013 15:48:07 -0600 Message-Id: <1361224096-21075-11-git-send-email-aliguori@us.ibm.com> X-Mailer: git-send-email 1.8.0 In-Reply-To: <1361224096-21075-1-git-send-email-aliguori@us.ibm.com> References: <1361224096-21075-1-git-send-email-aliguori@us.ibm.com> X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13021821-2000-0000-0000-00000AFF1C52 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 122.248.162.8 Cc: Amit Shah , Paolo Bonzini Subject: [Qemu-devel] [PATCH 10/19] char: add gio watch fn for tcp backends X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Amit Shah Signed-off-by: Amit Shah --- qemu-char.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/qemu-char.c b/qemu-char.c index e59e580..160bcea 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -2462,6 +2462,12 @@ static ssize_t tcp_chr_recv(CharDriverState *chr, char *buf, size_t len) } #endif +static GSource *tcp_chr_add_watch(CharDriverState *chr, GIOCondition cond) +{ + TCPCharDriver *s = chr->opaque; + return g_io_create_watch(s->chan, cond); +} + static gboolean tcp_chr_read(GIOChannel *chan, GIOCondition cond, void *opaque) { CharDriverState *chr = opaque; @@ -2676,6 +2682,7 @@ static CharDriverState *qemu_chr_open_socket_fd(int fd, bool do_nodelay, chr->chr_close = tcp_chr_close; chr->get_msgfd = tcp_get_msgfd; chr->chr_add_client = tcp_chr_add_client; + chr->chr_add_watch = tcp_chr_add_watch; if (is_listen) { s->listen_fd = fd;