Displaying 6 results from an estimated 6 matches for "watch_list".
Did you mean:
match_list
2012 Sep 19
5
[PATCH] libxenstore: filter watch events in libxenstore when we unwatch
...iov_len = strlen(token) + 1;
- return xs_bool(xs_talkv(h, XBT_NULL, XS_UNWATCH, iov,
+ res = xs_bool(xs_talkv(h, XBT_NULL, XS_UNWATCH, iov,
ARRAY_SIZE(iov), NULL));
+
+ /* Filter the watch list to remove potential message */
+ mutex_lock(&h->watch_mutex);
+
+ if (list_empty(&h->watch_list)) {
+ mutex_unlock(&h->watch_mutex);
+ return res;
+ }
+
+ list_for_each_entry_safe(msg, tmsg, &h->watch_list, list) {
+ assert(msg->hdr.type == XS_WATCH_EVENT);
+
+ strings = msg->body;
+ num_strings = xs_count_strings(strings, msg->hdr.len);
+
+ for (i = 0; i < num...
2012 Sep 25
2
[PATCH V2] libxenstore: filter watch events in libxenstore when we unwatch
...s_handle *h, const char *path, const char *token)
ARRAY_SIZE(iov), NULL));
}
+
+/* Clear the pipe token if there are no more pending watchs.
+ * We suppose the watch_mutex is already taken.
+ */
+static void xs_clear_watch_pipe(struct xs_handle *h)
+{
+ char c;
+
+ if (list_empty(&h->watch_list) && (h->watch_pipe[0] != -1))
+ while (read(h->watch_pipe[0], &c, 1) != 1)
+ continue;
+}
+
/* Find out what node change was on (will block if nothing pending).
* Returns array of two pointers: path and token, or NULL.
* Call free() after use.
@@ -761,7 +774,7 @@ static ch...
2012 Dec 14
1
[PATCH V4] libxenstore: filter watch events in libxenstore when we unwatch
...lients can select() on this pipe to wait for a watch to fire. */
int watch_pipe[2];
+ /* Filtering watch event in unwatch function? */
+ bool unwatch_filter;
/*
* A list of replies. Currently only one will ever be outstanding
@@ -125,6 +127,8 @@ struct xs_handle {
struct list_head watch_list;
/* Clients can select() on this pipe to wait for a watch to fire. */
int watch_pipe[2];
+ /* Filtering watch event in unwatch function? */
+ bool unwatch_filter;
};
#define mutex_lock(m) ((void)0)
@@ -247,6 +251,8 @@ static struct xs_handle *get_handle(const char *connect_to)
/* Watch p...
2012 Dec 14
1
[PATCH V5] libxenstore: filter watch events in libxenstore when we unwatch
...lients can select() on this pipe to wait for a watch to fire. */
int watch_pipe[2];
+ /* Filtering watch event in unwatch function? */
+ bool unwatch_filter;
/*
* A list of replies. Currently only one will ever be outstanding
@@ -125,6 +127,8 @@ struct xs_handle {
struct list_head watch_list;
/* Clients can select() on this pipe to wait for a watch to fire. */
int watch_pipe[2];
+ /* Filtering watch event in unwatch function? */
+ bool unwatch_filter;
};
#define mutex_lock(m) ((void)0)
@@ -247,6 +251,8 @@ static struct xs_handle *get_handle(const char *connect_to)
/* Watch p...
2012 Dec 13
4
[PATCH V3] libxenstore: filter watch events in libxenstore when we unwatch
...Clients can select() on this pipe to wait for a watch to fire. */
int watch_pipe[2];
+ /* Filtering watch event in unwatch function? */
+ bool unwatch_safe;
/*
* A list of replies. Currently only one will ever be outstanding
@@ -125,6 +127,8 @@ struct xs_handle {
struct list_head watch_list;
/* Clients can select() on this pipe to wait for a watch to fire. */
int watch_pipe[2];
+ /* Filtering watch event in unwatch function? */
+ bool unwatch_safe;
};
#define mutex_lock(m) ((void)0)
@@ -247,6 +251,8 @@ static struct xs_handle *get_handle(const char *connect_to)
/* Watch pip...
2006 Aug 02
2
[PATCH][RFC] permit domU userspace to watch xenstore
...) + 1;
+ body_len = path_len + tok_len;
+
+ hdr.type = XS_WATCH_EVENT;
+ hdr.len = body_len;
+
+ queue_reply(adap->dev_data, (char *)&hdr, sizeof(hdr));
+ queue_reply(adap->dev_data, (char *)path, path_len);
+ queue_reply(adap->dev_data, (char *)token, tok_len);
+}
+
+static LIST_HEAD(watch_list);
static ssize_t xenbus_dev_write(struct file *filp,
const char __user *ubuf,
@@ -116,6 +167,9 @@ static ssize_t xenbus_dev_write(struct f
struct xenbus_dev_transaction *trans = NULL;
uint32_t msg_type;
void *reply;
+ char *path, *token;
+ struct watch_adapter *watch, *tmp_watch;
+ in...