From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37843) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d30IY-00037P-H9 for qemu-devel@nongnu.org; Tue, 25 Apr 2017 09:14:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d30IV-0005HS-DT for qemu-devel@nongnu.org; Tue, 25 Apr 2017 09:14:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50094) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d30IV-0005HC-6k for qemu-devel@nongnu.org; Tue, 25 Apr 2017 09:14:27 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3CFCA66CAC for ; Tue, 25 Apr 2017 13:14:26 +0000 (UTC) Date: Tue, 25 Apr 2017 14:14:21 +0100 From: "Daniel P. Berrange" Message-ID: <20170425131421.GF21129@redhat.com> Reply-To: "Daniel P. Berrange" References: <20170425101758.3944-1-quintela@redhat.com> <20170425101758.3944-3-quintela@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20170425101758.3944-3-quintela@redhat.com> Subject: Re: [Qemu-devel] [PATCH 2/2] migration: to_dst_file at that point is NULL List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: qemu-devel@nongnu.org, lvivier@redhat.com, dgilbert@redhat.com, peterx@redhat.com On Tue, Apr 25, 2017 at 12:17:58PM +0200, Juan Quintela wrote: > We have just arrived as: > > migration.c: qemu_migrate() > .... > s = migrate_init() <- puts it to NULL > .... > {tcp,unix}_start_outgoing_migration -> > socket_outgoing_migration > migration_channel_connect() > sets to_dst_file > > if tls is enabled, we do another round through > migrate_channel_tls_connect(), but we only set it up if there is no > error. So we don't need the assignation. I am removing it to remove > in the follwing patches the knowledge about MigrationState in that two > files. Yes, the logic is quite subtle, but your analysis looks correct. > > Signed-off-by: Juan Quintela Reviewed-by: Daniel P. Berrange > --- > migration/socket.c | 1 - > migration/tls.c | 1 - > 2 files changed, 2 deletions(-) > > diff --git a/migration/socket.c b/migration/socket.c > index 13966f1..dc88812 100644 > --- a/migration/socket.c > +++ b/migration/socket.c > @@ -79,7 +79,6 @@ static void socket_outgoing_migration(QIOTask *task, > > if (qio_task_propagate_error(task, &err)) { > trace_migration_socket_outgoing_error(error_get_pretty(err)); > - data->s->to_dst_file = NULL; > migrate_fd_error(data->s, err); > error_free(err); > } else { > diff --git a/migration/tls.c b/migration/tls.c > index 45bec44..a33ecb7 100644 > --- a/migration/tls.c > +++ b/migration/tls.c > @@ -116,7 +116,6 @@ static void migration_tls_outgoing_handshake(QIOTask *task, > > if (qio_task_propagate_error(task, &err)) { > trace_migration_tls_outgoing_handshake_error(error_get_pretty(err)); > - s->to_dst_file = NULL; > migrate_fd_error(s, err); > error_free(err); > } else { Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|