From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38326) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1Gp3-0004C0-97 for qemu-devel@nongnu.org; Tue, 14 Aug 2012 09:06:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T1Goy-0000j9-28 for qemu-devel@nongnu.org; Tue, 14 Aug 2012 09:06:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:26307) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1Gox-0000iJ-Qb for qemu-devel@nongnu.org; Tue, 14 Aug 2012 09:06:07 -0400 Date: Tue, 14 Aug 2012 10:06:16 -0300 From: Luiz Capitulino Message-ID: <20120814100616.01c78729@doriath.home> In-Reply-To: <87has5zoww.fsf@blackfin.pond.sub.org> References: <1344354826-10375-1-git-send-email-lcapitulino@redhat.com> <1344354826-10375-16-git-send-email-lcapitulino@redhat.com> <87vcgraz3e.fsf@blackfin.pond.sub.org> <87k3x1wwja.fsf@elfo.mitica> <87has5zoww.fsf@blackfin.pond.sub.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 15/35] migration: don't rely on any QERR_SOCKET_* List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: kwolf@redhat.com, aliguori@us.ibm.com, quintela@redhat.com, mdroth@linux.vnet.ibm.com, qemu-devel@nongnu.org, pbonzini@redhat.com, eblake@redhat.com On Tue, 14 Aug 2012 13:35:59 +0200 Markus Armbruster wrote: > Juan Quintela writes: > > > Markus Armbruster wrote: > >> Luiz Capitulino writes: > >> > >>> Use the in_progress argument for QERR_SOCKET_CONNECT_IN_PROGRESS. The > >>> other errors are handled the same by checking if the error is set and > >>> then calling migrate_fd_error() if it's. > >>> > >>> It's also necessary to change inet_connect_opts() not to set > >>> QERR_SOCKET_CONNECT_IN_PROGRESS. This error is only used by > >>> tcp_start_outgoing_migration() and not changing it along with the > >>> usage of in_progress would break migration. > >>> > >>> Furthermore this commit fixes a bug. Today, there's a spurious error > >>> report when migration succeeds: > >>> > >>> (qemu) migrate tcp:0:4444 > >>> migrate: Connection can not be completed immediately > >>> (qemu) > >>> > >>> After this commit no spurious error is reported anymore. > >>> > >>> Signed-off-by: Luiz Capitulino > >> > >> I'd prefer > >> > >> s->fd = inet_connect(host_port, false, &in_progress, errp); > >> if (error_is_set(errp)) { > >> migrate_fd_error(s); > >> return -1; > >> } > >> if (in_progress) { > >> DPRINTF("connect in progress\n"); > >> qemu_set_fd_handler2(s->fd, NULL, NULL, tcp_wait_for_connect, s); > >> } else { > >> migrate_fd_connect(s); > >> } > >> return 0; > >> > >> because it separates abnormal and normal code paths more clearly. > >> > >> Matter of taste. > > > > > > The 1st migrate_fd_error() is not needed (it was already wrong). > > > > migrate_fd_* functions are supposed to be called only after > > migrate_fd_connect() has been called. > > It's been committed. Could you post a patch for it? Juan, are you going to do this or do you want me to do it?