From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55806) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjWe7-0007Dp-Dd for qemu-devel@nongnu.org; Mon, 12 Sep 2016 15:12:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bjWe3-0004vA-LZ for qemu-devel@nongnu.org; Mon, 12 Sep 2016 15:11:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54170) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjWe3-0004v4-FI for qemu-devel@nongnu.org; Mon, 12 Sep 2016 15:11:55 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (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 19FEF69185 for ; Mon, 12 Sep 2016 19:11:55 +0000 (UTC) Date: Mon, 12 Sep 2016 20:11:51 +0100 From: "Daniel P. Berrange" Message-ID: <20160912191151.GR16124@redhat.com> Reply-To: "Daniel P. Berrange" References: <1473707034-31147-1-git-send-email-dgilbert@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1473707034-31147-1-git-send-email-dgilbert@redhat.com> Subject: Re: [Qemu-devel] [PATCH] 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 On Mon, Sep 12, 2016 at 08:03:54PM +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. > > (We know that errp is non-null; callers use a local_err). I'd still be more comfortable with us using a local Error object here, as it illustrates best practice and protects against future accidents. > Signed-off-by: Dr. David Alan Gilbert > --- > migration/socket.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/migration/socket.c b/migration/socket.c > index 00de1fe..6e82924 100644 > --- a/migration/socket.c > +++ b/migration/socket.c > @@ -113,7 +113,9 @@ void tcp_start_outgoing_migration(MigrationState *s, > Error **errp) > { > SocketAddress *saddr = tcp_build_address(host_port, errp); > - socket_start_outgoing_migration(s, saddr, errp); > + if (!*errp) { > + socket_start_outgoing_migration(s, saddr, errp); > + } > } > > void unix_start_outgoing_migration(MigrationState *s, > @@ -175,7 +177,9 @@ 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); > + if (!*errp) { > + socket_start_incoming_migration(saddr, errp); > + } > } Yep, makes sense 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 :|