From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55585) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VEaqI-00041V-R6 for qemu-devel@nongnu.org; Wed, 28 Aug 2013 04:11:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VEaq9-0003jQ-B4 for qemu-devel@nongnu.org; Wed, 28 Aug 2013 04:11:06 -0400 Date: Wed, 28 Aug 2013 13:40:50 +0530 From: Amit Shah Message-ID: <20130828081050.GB17263@grmbl.mre> References: <1377673787.20403.16.camel@nilsson.home.kraxel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1377673787.20403.16.camel@nilsson.home.kraxel.org> Subject: Re: [Qemu-devel] [PATCH 2/9] char: introduce tcp_chr_detach() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: Paolo Bonzini , qemu-stable@nongnu.org, qemu list , Anthony Liguori , Hans de Goede On (Wed) 28 Aug 2013 [09:09:47], Gerd Hoffmann wrote: > Hi, > > > +static void tcp_chr_detach(CharDriverState *chr) > > +{ > > + TCPCharDriver *s = chr->opaque; > > + > > + if (s->tag) { > > + io_remove_watch_poll(s->tag); > > + s->tag = 0; > > + } > > +} > > Lots of simliar functions in the other patches. > > Doesn't it make sense to move the tag field from TCPCharDriver to > CharDriverState instead, so we don't need a new callback in the first > place? Yep, I thought about it, but it might get tricky to handle it: tcp needs two, one for listening sockets and one for connected ones. We don't need to worry about the listening socket for this patchset, should we then just keep that in the tcp struct, and use the tag as the generic one in CharDriverState for all of the backends? Amit