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

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



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1244109527 -3600
# Node ID 11cadcaff051188117eeb103eeaf4fd9dcb14ea9
# Parent  f18a7185e7872ffe7fb6e38d391d3b5af6eb325f
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>
xen-unstable changeset:   19725:265de5701b82
xen-unstable date:        Thu Jun 04 10:46:13 2009 +0100

xm: Remove redundant os.waitpid() call from do_console()
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
xen-unstable changeset:   19728:50cf07f42fdd
xen-unstable date:        Thu Jun 04 10:57:39 2009 +0100
---
 tools/python/xen/xm/create.py |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletion(-)

diff -r f18a7185e787 -r 11cadcaff051 tools/python/xen/xm/create.py
--- a/tools/python/xen/xm/create.py     Thu Jun 04 10:54:40 2009 +0100
+++ b/tools/python/xen/xm/create.py     Thu Jun 04 10:58:47 2009 +0100
@@ -1395,7 +1395,13 @@ def do_console(domain_name):
         for i in range(10):
             # Catch failure of the create process 
             time.sleep(1)
-            (p, rv) = os.waitpid(cpid, os.WNOHANG)
+            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
             if os.WIFEXITED(rv):
                 if os.WEXITSTATUS(rv) != 0:
                     sys.exit(os.WEXITSTATUS(rv))

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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