mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
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@sun.com> Signed-off-by: Simon Horman <horms@verge.ent.au>
This commit is contained in:
1 parent
45cb888069
commit
a161e0d852
1 file changed
+7
@@ -1400,6 +1400,13 @@ def do_console(domain_name):
|
||||
for i in range(10):
|
||||
# Catch failure of the create process
|
||||
time.sleep(1)
|
||||
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:
|
||||
|
||||