From patchwork Fri Dec 11 20:49:31 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: 40926 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 7643FB6F19 for ; Sat, 12 Dec 2009 07:53:16 +1100 (EST) Received: from localhost ([127.0.0.1]:40216 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NJCUD-0008Mn-Jw for incoming@patchwork.ozlabs.org; Fri, 11 Dec 2009 15:53:13 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NJCQm-0006z1-Ja for qemu-devel@nongnu.org; Fri, 11 Dec 2009 15:49:40 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NJCQh-0006wX-Hb for qemu-devel@nongnu.org; Fri, 11 Dec 2009 15:49:39 -0500 Received: from [199.232.76.173] (port=40101 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NJCQh-0006wP-Ca for qemu-devel@nongnu.org; Fri, 11 Dec 2009 15:49:35 -0500 Received: from mx1.redhat.com ([209.132.183.28]:61249) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NJCQg-000404-Rn for qemu-devel@nongnu.org; Fri, 11 Dec 2009 15:49:35 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nBBKnYBl029942 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 11 Dec 2009 15:49:34 -0500 Received: from localhost.localdomain (vpn1-6-34.ams2.redhat.com [10.36.6.34]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nBBKnWvA028315; Fri, 11 Dec 2009 15:49:33 -0500 From: "Daniel P. Berrange" To: qemu-devel@nongnu.org Date: Fri, 11 Dec 2009 20:49:31 +0000 Message-Id: <1260564571-28005-1-git-send-email-berrange@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 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. --- 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;