aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xenstore/xenstored_domain.c
diff options
context:
space:
mode:
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2005-10-09 23:53:03 +0100
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2005-10-09 23:53:03 +0100
commit5fec4cf7660cbcd50a016750b5de37394c6a65b1 (patch)
treedaaf58a55dd3d55eb08c45c34f77fa10a6fd24c8 /tools/xenstore/xenstored_domain.c
parent25517fd2f2a26162a466a0933cb56c49373fbae7 (diff)
downloadxen-5fec4cf7660cbcd50a016750b5de37394c6a65b1.tar.gz
xen-5fec4cf7660cbcd50a016750b5de37394c6a65b1.tar.bz2
xen-5fec4cf7660cbcd50a016750b5de37394c6a65b1.zip
Simplify reply logic in xenstored. Maintain a linked list
of pending replies that are sent out in order. Currently we only read new requests when the reply list is empty. In fact there is no good reason for this restriction. Another interesting point is that (on my test machine) hotplug blk setup fails if xenstored_client connects to xenstored via the unix domain socket rather than through the kernel --- this points to some user/kernel races that are 'fixed' by the extra serialisation of the in-kernel mutexes. It definitely needs looking into. Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'tools/xenstore/xenstored_domain.c')
-rw-r--r--tools/xenstore/xenstored_domain.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/xenstore/xenstored_domain.c b/tools/xenstore/xenstored_domain.c
index a7cd4493ad..15c98bfb49 100644
--- a/tools/xenstore/xenstored_domain.c
+++ b/tools/xenstore/xenstored_domain.c
@@ -276,12 +276,14 @@ void handle_event(void)
bool domain_can_read(struct connection *conn)
{
- return conn->state == OK && buffer_has_input(conn->domain->input);
+ return (list_empty(&conn->out_list) &&
+ buffer_has_input(conn->domain->input));
}
bool domain_can_write(struct connection *conn)
{
- return conn->out && buffer_has_output_room(conn->domain->output);
+ return (!list_empty(&conn->out_list) &&
+ buffer_has_output_room(conn->domain->output));
}
static struct domain *new_domain(void *context, domid_t domid,