aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xenstore/xenstored_core.h
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_core.h
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_core.h')
-rw-r--r--tools/xenstore/xenstored_core.h33
1 files changed, 17 insertions, 16 deletions
diff --git a/tools/xenstore/xenstored_core.h b/tools/xenstore/xenstored_core.h
index e017bddf42..c50936f1bc 100644
--- a/tools/xenstore/xenstored_core.h
+++ b/tools/xenstore/xenstored_core.h
@@ -31,14 +31,19 @@
struct buffered_data
{
+ struct list_head list;
+
/* Are we still doing the header? */
bool inhdr;
+
/* How far are we? */
unsigned int used;
+
union {
struct xsd_sockmsg msg;
char raw[sizeof(struct xsd_sockmsg)];
} hdr;
+
/* The actual data. */
char *buffer;
};
@@ -47,14 +52,6 @@ struct connection;
typedef int connwritefn_t(struct connection *, const void *, unsigned int);
typedef int connreadfn_t(struct connection *, void *, unsigned int);
-enum state
-{
- /* Doing action, not listening */
- BUSY,
- /* Completed */
- OK,
-};
-
struct connection
{
struct list_head list;
@@ -62,12 +59,9 @@ struct connection
/* The file descriptor we came in on. */
int fd;
- /* Who am I? 0 for socket connections. */
+ /* Who am I? 0 for socket connections. */
domid_t id;
- /* Blocked on transaction? Busy? */
- enum state state;
-
/* Is this a read-only connection? */
bool can_write;
@@ -75,10 +69,7 @@ struct connection
struct buffered_data *in;
/* Buffered output data */
- struct buffered_data *out;
-
- /* If we had a watch fire outgoing when we needed to reply... */
- struct buffered_data *waiting_reply;
+ struct list_head out_list;
/* My transaction, if any. */
struct transaction *transaction;
@@ -172,3 +163,13 @@ void trace(const char *fmt, ...);
extern int event_fd;
#endif /* _XENSTORED_CORE_H */
+
+/*
+ * Local variables:
+ * c-file-style: "linux"
+ * indent-tabs-mode: t
+ * c-indent-level: 8
+ * c-basic-offset: 8
+ * tab-width: 8
+ * End:
+ */