From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53891) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjk6x-0003Mj-8Y for qemu-devel@nongnu.org; Tue, 13 Sep 2016 05:34:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bjk6s-0008IR-UM for qemu-devel@nongnu.org; Tue, 13 Sep 2016 05:34:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43928) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjk6s-0008IF-OR for qemu-devel@nongnu.org; Tue, 13 Sep 2016 05:34:34 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5CCCF43A3D for ; Tue, 13 Sep 2016 09:34:34 +0000 (UTC) Date: Tue, 13 Sep 2016 10:34:30 +0100 From: "Daniel P. Berrange" Message-ID: <20160913093430.GH30949@redhat.com> Reply-To: "Daniel P. Berrange" References: <1473757721-10601-1-git-send-email-dgilbert@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1473757721-10601-1-git-send-email-dgilbert@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2] migration: Fix seg with missing port List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Dr. David Alan Gilbert (git)" Cc: qemu-devel@nongnu.org, quintela@redhat.com, amit.shah@redhat.com, eblake@redhat.com On Tue, Sep 13, 2016 at 10:08:41AM +0100, Dr. David Alan Gilbert (git) wrote: > From: "Dr. David Alan Gilbert" > > The command : > migrate tcp:localhost: > > currently segs; fix it so it now says: > > error parsing address 'localhost:' > > and the same for -incoming. > > Signed-off-by: Dr. David Alan Gilbert > > -- > v2 > More Error * boilerplate > --- > migration/socket.c | 16 ++++++++++++---- > 1 file changed, 12 insertions(+), 4 deletions(-) > > diff --git a/migration/socket.c b/migration/socket.c > index 00de1fe..a21c0c5 100644 > --- a/migration/socket.c > +++ b/migration/socket.c > @@ -112,8 +112,12 @@ void tcp_start_outgoing_migration(MigrationState *s, > const char *host_port, > Error **errp) > { > - SocketAddress *saddr = tcp_build_address(host_port, errp); > - socket_start_outgoing_migration(s, saddr, errp); > + Error *err = NULL; > + SocketAddress *saddr = tcp_build_address(host_port, &err); > + if (!err) { > + socket_start_outgoing_migration(s, saddr, &err); > + } > + error_propagate(errp, err); > } > > void unix_start_outgoing_migration(MigrationState *s, > @@ -174,8 +178,12 @@ static void socket_start_incoming_migration(SocketAddress *saddr, > > void tcp_start_incoming_migration(const char *host_port, Error **errp) > { > - SocketAddress *saddr = tcp_build_address(host_port, errp); > - socket_start_incoming_migration(saddr, errp); > + Error *err = NULL; > + SocketAddress *saddr = tcp_build_address(host_port, &err); > + if (!err) { > + socket_start_incoming_migration(saddr, &err); > + } > + error_propagate(errp, err); > } > > void unix_start_incoming_migration(const char *path, Error **errp) Reviewed-by: Daniel P. Berrange Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|