[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] xm: Don't die when trying to conect the console to short-lived domains

# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1244108773 -3600
# Node ID 265de5701b82997f8367ecf0e1ef7f092ea5e160
# Parent  2c1d94eb996f6b5d39ebf7183076b03d42cdd676
xm: Don't die when trying to conect the console to short-lived domains

As observed by Mick Joran, if short-lived domain exits cleanly
then os.waitpid() will throw the following exception. This appears
to be because the child process that is used to start the domain
has detached from its parent.

OSError: [Errno 10] No child processes

Cc: Mick Jordan <Mick.Jordan@xxxxxxx>
Signed-off-by: Simon Horman <horms@xxxxxxxxxxxx>
 tools/python/xen/xm/create.py |    7 +++++++
 1 files changed, 7 insertions(+)

diff -r 2c1d94eb996f -r 265de5701b82 tools/python/xen/xm/create.py
--- a/tools/python/xen/xm/create.py     Thu Jun 04 10:45:24 2009 +0100
+++ b/tools/python/xen/xm/create.py     Thu Jun 04 10:46:13 2009 +0100
@@ -1400,6 +1400,13 @@ def do_console(domain_name):
         for i in range(10):
             # Catch failure of the create process 
+            try:
+                (p, rv) = os.waitpid(cpid, os.WNOHANG)
+            except OSError:
+                # Domain has started cleanly and then exiting,
+                # the child process used to do this has detached
+                print("Domain has already finished");
+                break
             (p, rv) = os.waitpid(cpid, os.WNOHANG)
             if os.WIFEXITED(rv):
                 if os.WEXITSTATUS(rv) != 0:

Xen-changelog mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.