From: Ian Campbell Subject: [PATCH 2 of 4] xl: do not return to caller from monitoring daemon Date: Mon, 06 Sep 2010 11:03:14 +0100 Message-ID: <5f96f36feebdb87eaadb.1283767394@localhost.localdomain> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: Brendan Cully List-Id: xen-devel@lists.xenproject.org # HG changeset patch # User Ian Campbell # Date 1283766891 -3600 # Node ID 5f96f36feebdb87eaadbbcab0399f32eda86f735 # Parent cbba0599e0a1728e524ba640bdcea7d4af05ddd5 xl: do not return to caller from monitoring daemon The parent process will have returned to the caller and done whatever is necessary. The daemon should not return otherwise it will repeat this work. In the case of the migration receiver this causes it to try and take part in the migration protocol long after the sender+parent process have completed it, leading to confusing error messages (although strangely not much actual damange). Signed-off-by: Ian Campbell diff -r cbba0599e0a1 -r 5f96f36feebd tools/libxl/xl_cmdimpl.c --- a/tools/libxl/xl_cmdimpl.c Mon Sep 06 10:54:51 2010 +0100 +++ b/tools/libxl/xl_cmdimpl.c Mon Sep 06 10:54:51 2010 +0100 @@ -1645,6 +1645,14 @@ waitpid_out: if (child_console_pid > 0 && waitpid(child_console_pid, &status, 0) < 0 && errno == EINTR) goto waitpid_out; + + /* + * If we have daemonized then do not return to the caller -- this has + * already happened in the parent. + */ + if ( !need_daemon ) + exit(ret); + return ret; }