From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55430) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TT9gM-0003YT-C3 for qemu-devel@nongnu.org; Tue, 30 Oct 2012 07:08:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TT9gG-0001NF-Ir for qemu-devel@nongnu.org; Tue, 30 Oct 2012 07:08:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35890) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TT9gG-0001N8-AL for qemu-devel@nongnu.org; Tue, 30 Oct 2012 07:08:24 -0400 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 q9UB8NXQ008306 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 30 Oct 2012 07:08:23 -0400 From: Juan Quintela In-Reply-To: <87r4og8c9g.fsf@blackfin.pond.sub.org> (Markus Armbruster's message of "Tue, 30 Oct 2012 11:50:19 +0100") References: <1351519903-26607-1-git-send-email-quintela@redhat.com> <1351519903-26607-8-git-send-email-quintela@redhat.com> <87objlp97t.fsf@blackfin.pond.sub.org> <87r4ohkwvj.fsf@elfo.mitica> <87y5ioh0no.fsf@blackfin.pond.sub.org> <87d300l65f.fsf@elfo.mitica> <87r4og8c9g.fsf@blackfin.pond.sub.org> Date: Tue, 30 Oct 2012 12:08:19 +0100 Message-ID: <878vaokyjg.fsf@elfo.mitica> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 07/18] migration: make writes blocking Reply-To: quintela@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: owasserm@redhat.com, mtosatti@redhat.com, qemu-devel@nongnu.org, pbonzini@redhat.com, avi@redhat.com Markus Armbruster wrote: > Juan Quintela writes: >>>>> >>>>> Doesn't this break inet_nonblocking_connect() and >>>>> unix_nonblocking_connect()? >>>>> >>>>> In your cover letter, you wrote: >>>>> >>>>> Note: Writes has become blocking, and I have to change the "remove" >>>>> the feature now in qemu-sockets.c. Checked that migration was the >>>>> only user of that feature. If new users appear, they just need to add >>>>> the socket_set_nonblock() by hand. >>>>> >>>>> Yes, migration-{tcp,unix} are their only users, but if they want a >>>>> blocking socket now, why not use inet_connect() and unix_connect()? >>>>> >>>>> New users can't "just add socket_set_nonblock()". They'd have to add it >>>>> right where you deleted it: between qemu_socket() and connect(). Else >>>>> the connect() is blocking. >>>> >>>> Grrr. >>>> >>>> So, is there any way to make a connection that is non-blocking, but then >>>> writes are blocking? >>> >>> Which operations on the migration socket do you need to block, and which >>> ones do you need not to block? >> >> connect: not blocking (done on the iothread) >> writes: blocking, done in the migration thread. >> >> I think thet socket_set_block() that paolo says is the right solution. > > Sounds good. > > By the way, I probably would've missed this had you not pointed to it in > the cover letter. Smart move on your part. I knew somebody would have noticed, so it was supposed to be a "priori" apologize .... thanks, Juan.