From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O9OHy-0005vL-MP for qemu-devel@nongnu.org; Tue, 04 May 2010 16:00:18 -0400 Received: from [140.186.70.92] (port=49054 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O9OHs-0005nF-LI for qemu-devel@nongnu.org; Tue, 04 May 2010 16:00:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O9OHr-0000s6-7K for qemu-devel@nongnu.org; Tue, 04 May 2010 16:00:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:21400) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O9OHr-0000s0-0B for qemu-devel@nongnu.org; Tue, 04 May 2010 16:00:11 -0400 Date: Wed, 5 May 2010 01:28:20 +0530 From: Amit Shah Message-ID: <20100504195820.GB1109@amit-x200.redhat.com> References: <1272997439-9675-1-git-send-email-amit.shah@redhat.com> <1272997439-9675-2-git-send-email-amit.shah@redhat.com> <1272997439-9675-3-git-send-email-amit.shah@redhat.com> <1272997439-9675-4-git-send-email-amit.shah@redhat.com> <1272997439-9675-5-git-send-email-amit.shah@redhat.com> <1272997439-9675-6-git-send-email-amit.shah@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: [Qemu-devel] Re: [PATCH v6 5/6] char: unix/tcp: Add a non-blocking write handler List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: Paul Brook , qemu list , Gerd Hoffmann On (Tue) May 04 2010 [21:54:09], Juan Quintela wrote: > > static void tcp_chr_connect(void *opaque) > > { > > CharDriverState *chr = opaque; > > TCPCharDriver *s = chr->opaque; > > + IOHandler *write_cb; > > + int flags; > > + bool nonblock; > > + > > + flags = fcntl(s->fd, F_GETFL); > > + if (flags == -1) { > > + flags = 0; > > + } > > + nonblock = flags & O_NONBLOCK; > > + > > + write_cb = NULL; > > + chr->nonblock = false; > > + if (nonblock && chr->chr_write_unblocked) { > > + write_cb = chr->chr_write_unblocked; > > + chr->nonblock = true; > > + } > > > > + chr->write_blocked = false; > > s->connected = 1; > > qemu_set_fd_handler2(s->fd, tcp_chr_read_poll, > > write_cb is a write-only variable, no? Leftover from previous design. I'll clean this up in the next series (already applied to my local branch). Thanks, Amit