From patchwork Wed Jun 9 21:50:10 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshiaki Tamura X-Patchwork-Id: 55128 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 32B731007D6 for ; Thu, 10 Jun 2010 07:53:21 +1000 (EST) Received: from localhost ([127.0.0.1]:49410 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OMTCU-00084C-Og for incoming@patchwork.ozlabs.org; Wed, 09 Jun 2010 17:52:42 -0400 Received: from [140.186.70.92] (port=46463 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OMTBM-0007Kf-4l for qemu-devel@nongnu.org; Wed, 09 Jun 2010 17:51:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OMTBK-0000k2-2P for qemu-devel@nongnu.org; Wed, 09 Jun 2010 17:51:31 -0400 Received: from sh.osrg.net ([192.16.179.4]:44248) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OMTBJ-0000jZ-HQ for qemu-devel@nongnu.org; Wed, 09 Jun 2010 17:51:30 -0400 Received: from fs.osrg.net (postfix@fs.osrg.net [10.0.0.12]) by sh.osrg.net (8.14.3/8.14.3/OSRG-NET) with ESMTP id o59LpPDS008794; Thu, 10 Jun 2010 06:51:25 +0900 Received: from localhost (hype-wd0.osrg.net [10.72.1.16]) by fs.osrg.net (Postfix) with ESMTP id 571BD3E024A; Thu, 10 Jun 2010 06:51:25 +0900 (JST) From: Yoshiaki Tamura To: qemu-devel@nongnu.org Date: Thu, 10 Jun 2010 06:50:10 +0900 Message-Id: <1276120210-17949-1-git-send-email-tamura.yoshiaki@lab.ntt.co.jp> X-Mailer: git-send-email 1.7.0.31.g1df487 X-Dispatcher: imput version 20070423(IM149) Lines: 57 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (sh.osrg.net [192.16.179.4]); Thu, 10 Jun 2010 06:51:26 +0900 (JST) X-Virus-Scanned: clamav-milter 0.96.1 at sh X-Virus-Status: Clean X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Cc: crobinso@redhat.com, Yoshiaki Tamura , lcapitulino@redhat.com Subject: [Qemu-devel] [PATCH] migration-tcp: call migrate_fd_error() instead of close() and free(). X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- 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);