From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59707) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1Gtz-0006ek-Jq for qemu-devel@nongnu.org; Tue, 14 Aug 2012 09:11:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T1Gtx-0002Dj-Uc for qemu-devel@nongnu.org; Tue, 14 Aug 2012 09:11:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:3943) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1Gtx-0002Db-Lk for qemu-devel@nongnu.org; Tue, 14 Aug 2012 09:11:17 -0400 From: Juan Quintela In-Reply-To: <87has5zoww.fsf@blackfin.pond.sub.org> (Markus Armbruster's message of "Tue, 14 Aug 2012 13:35:59 +0200") 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> Date: Tue, 14 Aug 2012 15:09:45 +0200 Message-ID: <87ehn9wrfq.fsf@elfo.mitica> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 15/35] migration: don't rely on any QERR_SOCKET_* Reply-To: quintela@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: kwolf@redhat.com, aliguori@us.ibm.com, mdroth@linux.vnet.ibm.com, qemu-devel@nongnu.org, pbonzini@redhat.com, Luiz Capitulino , eblake@redhat.com 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? I am doing it. Thanks.