From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=59044 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OOGjm-0000vz-Qh for qemu-devel@nongnu.org; Mon, 14 Jun 2010 16:58:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OOGjZ-0007yz-Lx for qemu-devel@nongnu.org; Mon, 14 Jun 2010 16:58:18 -0400 Received: from mail-iw0-f173.google.com ([209.85.214.173]:56474) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OOGjZ-0007ly-J7 for qemu-devel@nongnu.org; Mon, 14 Jun 2010 16:58:17 -0400 Received: by mail-iw0-f173.google.com with SMTP id 10so4582648iwn.4 for ; Mon, 14 Jun 2010 13:58:17 -0700 (PDT) Message-ID: <4C1697EB.7010801@codemonkey.ws> Date: Mon, 14 Jun 2010 15:58:19 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] migration-tcp: call migrate_fd_error() instead of close() and free(). References: <1276120210-17949-1-git-send-email-tamura.yoshiaki@lab.ntt.co.jp> In-Reply-To: <1276120210-17949-1-git-send-email-tamura.yoshiaki@lab.ntt.co.jp> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Yoshiaki Tamura Cc: lcapitulino@redhat.com, qemu-devel@nongnu.org, crobinso@redhat.com On 06/09/2010 04:50 PM, Yoshiaki Tamura wrote: > 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 > Signed-off-by: Yoshiaki Tamura > Applied. Thanks. Regards, Anthony Liguori > -- > 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); > >