# HG changeset patch
# User cl349@xxxxxxxxxxxxxxxxxxxx
# Node ID 052208a34902323ea4ce289d482b7629ca115a59
# Parent 2ae19537f61578d7d81fe66826ea4b632878555f
Fix bug where watch messages doesn't go out. Also change xs_test
to more closely represent xenbus behaviour so we can see the bug.
Signed-off-by: Rusty Russel <rusty@xxxxxxxxxxxxxxx>
Signed-off-by: Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>
diff -r 2ae19537f615 -r 052208a34902 tools/xenstore/xenstored_core.c
--- a/tools/xenstore/xenstored_core.c Tue Jul 26 15:21:32 2005
+++ b/tools/xenstore/xenstored_core.c Tue Jul 26 15:23:50 2005
@@ -253,7 +253,7 @@
out->used = 0;
/* Second write might block if non-zero. */
- if (out->hdr.msg.len)
+ if (out->hdr.msg.len && !conn->domain)
return true;
}
diff -r 2ae19537f615 -r 052208a34902 tools/xenstore/xs_test.c
--- a/tools/xenstore/xs_test.c Tue Jul 26 15:21:32 2005
+++ b/tools/xenstore/xs_test.c Tue Jul 26 15:23:50 2005
@@ -85,6 +85,14 @@
return buf + h->read;
}
+static int output_avail(struct ringbuf_head *out)
+{
+ unsigned int avail;
+
+ get_output_chunk(out, out->buf, &avail);
+ return avail != 0;
+}
+
static void update_output_chunk(struct ringbuf_head *h, uint32_t len)
{
h->write += len;
@@ -104,10 +112,12 @@
void *data, unsigned int len)
{
unsigned int avail;
+ int was_full;
if (!check_buffer(in))
barf("Corrupt buffer");
+ was_full = !output_avail(in);
while (len) {
const void *src = get_input_chunk(in, in->buf, &avail);
if (avail > len)
@@ -119,7 +129,8 @@
}
/* Tell other end we read something. */
- kill(daemon_pid, SIGUSR2);
+ if (was_full)
+ kill(daemon_pid, SIGUSR2);
return true;
}
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|