From mboxrd@z Thu Jan 1 00:00:00 1970 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 From: "Daniel P. Berrange" Date: Fri, 11 Dec 2009 21:01:14 +0000 Message-Id: <1260565274-28116-1-git-send-email-berrange@redhat.com> Subject: [Qemu-devel] [PATCH] Avoid permanently disabled QEMU monitor when UNIX migration fails List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@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; -- 1.6.5.2