From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33646) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XlHbB-0006uH-LO for qemu-devel@nongnu.org; Mon, 03 Nov 2014 08:23:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XlHb7-0005BE-KW for qemu-devel@nongnu.org; Mon, 03 Nov 2014 08:23:09 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45896) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XlHb7-0005BA-DM for qemu-devel@nongnu.org; Mon, 03 Nov 2014 08:23:05 -0500 Date: Mon, 3 Nov 2014 13:22:45 +0000 From: "Dr. David Alan Gilbert" Message-ID: <20141103132244.GF3480@work-vm> References: <1412358473-31398-1-git-send-email-dgilbert@redhat.com> <1412358473-31398-17-git-send-email-dgilbert@redhat.com> <20141103034600.GL8949@voom.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20141103034600.GL8949@voom.redhat.com> Subject: Re: [Qemu-devel] [PATCH v4 16/47] Return path: Source handling of return path List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson Cc: aarcange@redhat.com, yamahata@private.email.ne.jp, lilei@linux.vnet.ibm.com, quintela@redhat.com, cristian.klein@cs.umu.se, qemu-devel@nongnu.org, amit.shah@redhat.com, yanghy@cn.fujitsu.com * David Gibson (david@gibson.dropbear.id.au) wrote: > On Fri, Oct 03, 2014 at 06:47:22PM +0100, Dr. David Alan Gilbert (git) wrote: > > From: "Dr. David Alan Gilbert" > > > > Open a return path, and handle messages that are received upon it. > > > > Signed-off-by: Dr. David Alan Gilbert > > [snip] > > @@ -414,6 +448,11 @@ static void migrate_fd_cancel(MigrationState *s) > > int old_state ; > > trace_migrate_fd_cancel(); > > > > + if (s->return_path) { > > + /* shutdown the rp socket, so causing the rp thread to shutdown */ > > + qemu_file_shutdown(s->return_path); > > Terminating the rp thread via shutting down its file seems roundabout, > and kind of dependent on the socket file implementation. The rp thread might be in the middle of a blocking read()/recv() so I'm doing a shutdown() to cause those to exit; once I have to do that anyway it didn't seem necessary to add anything etra. > [snip] > > +__attribute__ (( unused )) /* Until later in patch series */ > > +static int open_outgoing_return_path(MigrationState *ms) > > +{ > > + > > + ms->return_path = qemu_file_get_return_path(ms->file); > > So, another reason this get_return_path abstraction doesn't seem right > to me, is that it's not obvious that for non-socket file types, the > source and destination side "get return path" operations would > necessarily be the same. However, since the implementation of the get_return_path is a method on the particular implementation, and it can be different for a qemu_file opened for read or write, then that non-socket file type could implement it how it likes including something like shutdown). Dave > -- > David Gibson | I'll have my music baroque, and my code > david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ > | _way_ _around_! > http://www.ozlabs.org/~dgibson -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK