[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] migration: Fix seg with missing port
From: |
Daniel P. Berrange |
Subject: |
Re: [Qemu-devel] [PATCH] migration: Fix seg with missing port |
Date: |
Mon, 12 Sep 2016 20:11:51 +0100 |
User-agent: |
Mutt/1.7.0 (2016-08-17) |
On Mon, Sep 12, 2016 at 08:03:54PM +0100, Dr. David Alan Gilbert (git) wrote:
> From: "Dr. David Alan Gilbert" <address@hidden>
>
> 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 <address@hidden>
> ---
> 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 :|