Patchwork [Bug,589315,NEW] qemu: Improve error reporting when migration can't connect

login
register
mail settings
Submitter Yoshiaki Tamura
Date June 3, 2010, 9:41 p.m.
Message ID <AANLkTilenPe9zZAtEeyyNLMxYLWzjV6Ovj3uGj-1GMsA@mail.gmail.com>
Download mbox | patch
Permalink /patch/54526/
State New
Headers show

Comments

Yoshiaki Tamura - June 3, 2010, 9:41 p.m.
2010/6/4 Cole Robinson <crobinso@redhat.com>:
> Public bug reported:
>
> Tested with upstream qemu as of Jun 3 2010
>
> If the source qemu instance can't connect to the migration destination (say
> there is no listening QEMU instance, or port is blocked by a firewall), all we
> get is info migrate -> Migration status: failed. This is all we have to report
> back to libvirt users if their firewall is misconfigured, which is crappy.
>
> Ideally, if we can't connect, migration would fail immediately with a relevant
> message and strerror(). More info from 'info migrate' would be nice too, no
> idea how this will play with QMP though.
>
> As a slightly related issue, try entering
>
> migrate tcp:127.0.0.0:6000
>
> We get a 'migration failed' error, and then the monitor hangs!
>
> ** Affects: qemu
>     Importance: Undecided
>         Status: New
>
> --
> qemu: Improve error reporting when migration can't connect
> https://bugs.launchpad.net/bugs/589315
> You received this bug notification because you are a member of qemu-
> devel-ml, which is subscribed to QEMU.
>
> Status in QEMU: New
>
> Bug description:
> Tested with upstream qemu as of Jun 3 2010
>
> If the source qemu instance can't connect to the migration destination (say
> there is no listening QEMU instance, or port is blocked by a firewall), all we
> get is info migrate -> Migration status: failed. This is all we have to report
> back to libvirt users if their firewall is misconfigured, which is crappy.
>
> Ideally, if we can't connect, migration would fail immediately with a relevant
> message and strerror(). More info from 'info migrate' would be nice too, no
> idea how this will play with QMP though.
>
> As a slightly related issue, try entering
>
> migrate tcp:127.0.0.0:6000
>
> We get a 'migration failed' error, and then the monitor hangs!
>

Hi,

Does the following patch fix the problem?

Thanks,

Yoshi

[PATCH] migration-tcp: call migrate_fd_error() instead of close() and free().

This patch fixes the following error report.  When changing
migration-tcp.c to call migrate_fd_error() instead of close() and
free() by itself, monitor is resumed, and returns allocated mig_state
is set to current_migration in migration.c allows us to print "info
migrate".

Reported-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Yoshiaki Tamura <tamura.yoshiaki@lab.ntt.co.jp>

--
qemu: Improve error reporting when migration can't connect
https://bugs.launchpad.net/bugs/589315
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.

Status in QEMU: New

Bug description:
Tested with upstream qemu as of Jun 3 2010

If the source qemu instance can't connect to the migration destination (say
there is no listening QEMU instance, or port is blocked by a firewall), all we
get is info migrate -> Migration status: failed. This is all we have to report
back to libvirt users if their firewall is misconfigured, which is crappy.

Ideally, if we can't connect, migration would fail immediately with a relevant
message and strerror(). More info from 'info migrate' would be nice too, no
idea how this will play with QMP though.

As a slightly related issue, try entering

migrate tcp:127.0.0.0:6000

We get a 'migration failed' error, and then the monitor hangs!
--
---
 migration-tcp.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
Cole Robinson - June 9, 2010, 4:43 p.m.
On 06/03/2010 05:41 PM, Yoshiaki Tamura wrote:
> 
> Hi,
> 
> Does the following patch fix the problem?
> 
> Thanks,
> 
> Yoshi
> 
> [PATCH] migration-tcp: call migrate_fd_error() instead of close() and free().
> 
> This patch fixes the following error report.  When changing
> migration-tcp.c to call migrate_fd_error() instead of close() and
> free() by itself, monitor is resumed, and returns allocated mig_state
> is set to current_migration in migration.c allows us to print "info
> migrate".
> 
> Reported-by: Cole Robinson <crobinso@redhat.com>
> Signed-off-by: Yoshiaki Tamura <tamura.yoshiaki@lab.ntt.co.jp>
> 
> --
> qemu: Improve error reporting when migration can't connect
> https://bugs.launchpad.net/bugs/589315
> You received this bug notification because you are a member of qemu-
> devel-ml, which is subscribed to QEMU.
> 
> Status in QEMU: New
> 
> Bug description:
> Tested with upstream qemu as of Jun 3 2010
> 
> If the source qemu instance can't connect to the migration destination (say
> there is no listening QEMU instance, or port is blocked by a firewall), all we
> get is info migrate -> Migration status: failed. This is all we have to report
> back to libvirt users if their firewall is misconfigured, which is crappy.
> 
> Ideally, if we can't connect, migration would fail immediately with a relevant
> message and strerror(). More info from 'info migrate' would be nice too, no
> idea how this will play with QMP though.
> 
> As a slightly related issue, try entering
> 
> migrate tcp:127.0.0.0:6000
> 
> We get a 'migration failed' error, and then the monitor hangs!
> --
> ---
>  migration-tcp.c |    4 +---
>  1 files changed, 1 insertions(+), 3 deletions(-)
> 
> diff --git a/migration-tcp.c b/migration-tcp.c
> index 95ce722..43af2e0 100644
> --- a/migration-tcp.c
> +++ b/migration-tcp.c
> @@ -128,9 +128,7 @@ MigrationState *tcp_start_outgoing_migration(Monitor *mon,
> 
>      if (ret < 0 && ret != -EINPROGRESS && ret != -EWOULDBLOCK) {
>          DPRINTF("connect failed\n");
> -        close(s->fd);
> -        qemu_free(s);
> -        return NULL;
> +        migrate_fd_error(s);
>      } else if (ret >= 0)
>          migrate_fd_connect(s);
> 

Yes, this fixes the monitor hang. Thanks!

- Cole

Patch

diff --git a/migration-tcp.c b/migration-tcp.c
index 95ce722..43af2e0 100644
--- a/migration-tcp.c
+++ b/migration-tcp.c
@@ -128,9 +128,7 @@  MigrationState *tcp_start_outgoing_migration(Monitor *mon,

     if (ret < 0 && ret != -EINPROGRESS && ret != -EWOULDBLOCK) {
         DPRINTF("connect failed\n");
-        close(s->fd);
-        qemu_free(s);
-        return NULL;
+        migrate_fd_error(s);
     } else if (ret >= 0)
         migrate_fd_connect(s);