diff options
author | Daniel De Graaf <dgdegra@tycho.nsa.gov> | 2010-09-01 14:37:18 +0100 |
---|---|---|
committer | Daniel De Graaf <dgdegra@tycho.nsa.gov> | 2010-09-01 14:37:18 +0100 |
commit | 0de6578197537de37c8e0250f0f7b6537d103052 (patch) | |
tree | 1b030f0cd5fd88f108e6a36f1b80a4b72de9a5aa /tools/libxc/xc_domain_restore.c | |
parent | 09cae24637fb571d6216a7bd45e486a6c3d4d8e3 (diff) | |
download | xen-0de6578197537de37c8e0250f0f7b6537d103052.tar.gz xen-0de6578197537de37c8e0250f0f7b6537d103052.tar.bz2 xen-0de6578197537de37c8e0250f0f7b6537d103052.zip |
tools/xenstore: correctly handle errors from read_message
The return value of read_message needs to be checked in order to avoid
waiting forever for a message if there is an error on the communication
channel with xenstore. Currently, this is only checked if USE_PTHREAD is
defined (by checking for read thread exit), and that path is prone to
deadlock if request_mutex is held while waiting.
Since the failure of read_message leaves the socket in an undefined
state, close the socket and force all threads waiting on a read to return.
This also fixes xs_read_watch in the case where a read thread is not
running (in particular, this will happen if !USE_PTHREAD) by having it
read from the communication channel in the same way as read_reply.
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/libxc/xc_domain_restore.c')
0 files changed, 0 insertions, 0 deletions