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-changelog

[Xen-changelog] Fix bug where watch messages doesn't go out. Also change

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Fix bug where watch messages doesn't go out. Also change xs_test
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 26 Jul 2005 20:26:13 -0400
Delivery-date: Wed, 27 Jul 2005 00:27:10 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Fix bug where watch messages doesn't go out. Also change xs_test, Xen patchbot -unstable <=