From 77a0acea701ed303efd11ef43c64345a7e32ce77 Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Wed, 8 Sep 2010 16:24:20 +0100 Subject: 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 Signed-off-by: Ian Jackson --- tools/libxl/xl_cmdimpl.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index 9393059e71..c2bfa0d311 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -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; } -- cgit v1.2.3