From patchwork Wed Oct 5 13:45:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 678460 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3spy6P574Kz9s9Y for ; Thu, 6 Oct 2016 00:58:05 +1100 (AEDT) Received: from localhost ([::1]:49315 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1brmhu-0006le-EL for incoming@patchwork.ozlabs.org; Wed, 05 Oct 2016 09:58:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49858) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1brmVw-0004iY-0i for qemu-devel@nongnu.org; Wed, 05 Oct 2016 09:45:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1brmVr-0000f3-UH for qemu-devel@nongnu.org; Wed, 05 Oct 2016 09:45:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51686) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1brmVr-0000eq-H3 for qemu-devel@nongnu.org; Wed, 05 Oct 2016 09:45:35 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (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 0721466CBB for ; Wed, 5 Oct 2016 13:45:35 +0000 (UTC) Received: from emacs.mitica (ovpn-116-91.ams2.redhat.com [10.36.116.91]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u95DjCfU031257; Wed, 5 Oct 2016 09:45:33 -0400 From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 5 Oct 2016 15:45:07 +0200 Message-Id: <1475675109-8105-14-git-send-email-quintela@redhat.com> In-Reply-To: <1475675109-8105-1-git-send-email-quintela@redhat.com> References: <1475675109-8105-1-git-send-email-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 05 Oct 2016 13:45:35 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 13/15] migration: Fix seg with missing port X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: amit.shah@redhat.com, dgilbert@redhat.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 Reviewed-by: Daniel P. Berrange Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela --- 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)