From patchwork Fri Dec 11 21:01:14 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= X-Patchwork-Id: 40927 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 BFBC3B6F19 for ; Sat, 12 Dec 2009 08:02:00 +1100 (EST) Received: from localhost ([127.0.0.1]:48276 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NJCcf-0003ph-1b for incoming@patchwork.ozlabs.org; Fri, 11 Dec 2009 16:01:57 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NJCcA-0003oR-Tw for qemu-devel@nongnu.org; Fri, 11 Dec 2009 16:01:26 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NJCc5-0003kp-R4 for qemu-devel@nongnu.org; Fri, 11 Dec 2009 16:01:26 -0500 Received: from [199.232.76.173] (port=55212 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NJCc5-0003kS-3p for qemu-devel@nongnu.org; Fri, 11 Dec 2009 16:01:21 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37247) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NJCc4-0004qr-Jp for qemu-devel@nongnu.org; Fri, 11 Dec 2009 16:01:20 -0500 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nBBL1JU6024158 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 11 Dec 2009 16:01:19 -0500 Received: from localhost.localdomain (vpn1-6-34.ams2.redhat.com [10.36.6.34]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nBBL1ILT023603; Fri, 11 Dec 2009 16:01:18 -0500 From: "Daniel P. Berrange" To: qemu-devel@nongnu.org Date: Fri, 11 Dec 2009 21:01:14 +0000 Message-Id: <1260565274-28116-1-git-send-email-berrange@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Subject: [Qemu-devel] [PATCH] Avoid permanently disabled QEMU monitor when UNIX migration fails 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 If a UNIX migration command is attempt to a UNIX socket which does not exist, then the monitor is suspended, but never resumed. This prevents any further use of the monitor * migration-unix.c: Only call migrate_fd_monitor_suspend() once connected to the UNIX socket. Signed-off-by: Daniel P. Berrange --- migration-unix.c | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-) diff --git a/migration-unix.c b/migration-unix.c index 783228b..a141dbb 100644 --- a/migration-unix.c +++ b/migration-unix.c @@ -112,10 +112,6 @@ MigrationState *unix_start_outgoing_migration(Monitor *mon, socket_set_nonblock(s->fd); - if (!detach) { - migrate_fd_monitor_suspend(s, mon); - } - do { ret = connect(s->fd, (struct sockaddr *)&addr, sizeof(addr)); if (ret == -1) @@ -128,7 +124,13 @@ MigrationState *unix_start_outgoing_migration(Monitor *mon, if (ret < 0 && ret != -EINPROGRESS && ret != -EWOULDBLOCK) { dprintf("connect failed\n"); goto err_after_open; - } else if (ret >= 0) + } + + if (!detach) { + migrate_fd_monitor_suspend(s, mon); + } + + if (ret >= 0) migrate_fd_connect(s); return &s->mig_state;