diff options
author | Ian Jackson <Ian.Jackson@eu.citrix.com> | 2012-05-29 10:31:37 +0100 |
---|---|---|
committer | Ian Jackson <Ian.Jackson@eu.citrix.com> | 2012-05-29 10:31:37 +0100 |
commit | 8d7aec41547d798761dcb308387f276667f9989a (patch) | |
tree | 34f19025dcc497e0d0fc6786edca8b6d78093f80 /tools/python | |
parent | 017c08fa0da81e62c85ef5a018af2fe665acbbaf (diff) | |
download | xen-8d7aec41547d798761dcb308387f276667f9989a.tar.gz xen-8d7aec41547d798761dcb308387f276667f9989a.tar.bz2 xen-8d7aec41547d798761dcb308387f276667f9989a.zip |
xl: track child processes for the benefit of libxl
Each time xl forks, it needs to record the pid, so that its exit
status can be preserved if it happens that libxl's event loop reaped
it. Consequently we also have a new wrapper for waitpid, which in
that case returns the previously-reaped status.
When we get a console ready callback from libxl, check to see if we
have spawned but not reaped a previous console client, and if so reap
it now. (This is necessary to prevent improper use of the xlchild
struct, but has the happy consequence of checking the exit status of
the first console client in the pygrub case.)
Refactor the two calls to libxl_ctx_alloc into a new function
xl_ctx_alloc which also sets the child reaped handler callback.
All of this has the effect of suppressing a message
unknown child [nnnn] unexpected exited status zero
which would sometimes (depending on a race) appear with `xl create -c'
and pygrub.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Reported-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Roger Pau Monne <roger.pau@citrix.com>
[ ijc -- corrected return codes in xl_reaped_callback to match documented
convention. ]
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'tools/python')
0 files changed, 0 insertions, 0 deletions