qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: "Dr. David Alan Gilbert (git)" <dgilbert@redhat.com>
Cc: qemu-devel@nongnu.org, quintela@redhat.com, amit.shah@redhat.com
Subject: Re: [Qemu-devel] [PATCH] migration: Fix seg with missing port
Date: Mon, 12 Sep 2016 20:11:51 +0100	[thread overview]
Message-ID: <20160912191151.GR16124@redhat.com> (raw)
In-Reply-To: <1473707034-31147-1-git-send-email-dgilbert@redhat.com>

On Mon, Sep 12, 2016 at 08:03:54PM +0100, Dr. David Alan Gilbert (git) wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
> 
> 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 <dgilbert@redhat.com>
> ---
>  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 :|

  reply	other threads:[~2016-09-12 19:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-12 19:03 [Qemu-devel] [PATCH] migration: Fix seg with missing port Dr. David Alan Gilbert (git)
2016-09-12 19:11 ` Daniel P. Berrange [this message]
2016-09-12 19:23   ` Eric Blake
2016-09-15 14:28 ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160912191151.GR16124@redhat.com \
    --to=berrange@redhat.com \
    --cc=amit.shah@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).