WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 5/11] Fix bug where watch messages didn't go out to d

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 5/11] Fix bug where watch messages didn't go out to domains, causing them to get stuck.
From: Rusty Russell <rusty@xxxxxxxxxxxxxxx>
Date: Thu, 04 Aug 2005 22:31:32 +1000
Delivery-date: Thu, 04 Aug 2005 12:31:25 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Rusty Russell <rusty@xxxxxxxxxxxxxxx>
# Node ID ba5d5bd28edf8bce89bdf9fc64047ee4f1dceded
# Parent  d4ab9ac93104a13a09ebfaa2384281c4e3392e3f
Fix bug where watch messages didn't go out to domains, causing them to get 
stuck.
Also, change xs_test to more closely reflect xenbus behaviour to exhibit bug.
Signed-off-by: Rusty Russell <rusty@xxxxxxxxxxxxxxx>

diff -r d4ab9ac93104 -r ba5d5bd28edf tools/xenstore/xenstored_core.c
--- a/tools/xenstore/xenstored_core.c   Thu Aug  4 10:34:26 2005
+++ b/tools/xenstore/xenstored_core.c   Thu Aug  4 10:43:03 2005
@@ -270,7 +270,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 d4ab9ac93104 -r ba5d5bd28edf tools/xenstore/xs_test.c
--- a/tools/xenstore/xs_test.c  Thu Aug  4 10:34:26 2005
+++ b/tools/xenstore/xs_test.c  Thu Aug  4 10:43:03 2005
@@ -80,6 +80,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;
@@ -99,10 +107,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)
@@ -114,7 +124,8 @@
        }
 
        /* Tell other end we read something. */
-       kill(daemon_pid, SIGUSR2);
+       if (was_full)
+               kill(daemon_pid, SIGUSR2);
        return true;
 }
 


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH 5/11] Fix bug where watch messages didn't go out to domains, causing them to get stuck., Rusty Russell <=