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 transaction fires multiple events.

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Fix bug where transaction fires multiple events.
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 26 Jul 2005 20:26:14 -0400
Delivery-date: Wed, 27 Jul 2005 00:27:14 +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 b9903985e9b65969daabec9cada972e3b956da6c
# Parent  052208a34902323ea4ce289d482b7629ca115a59
Fix bug where transaction fires multiple events.
Add general trace() call to help future debugging.
Signed-off-by: Rusty Russel <rusty@xxxxxxxxxxxxxxx>
Signed-off-by: Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>

diff -r 052208a34902 -r b9903985e9b6 tools/xenstore/testsuite/08transaction.sh
--- a/tools/xenstore/testsuite/08transaction.sh Tue Jul 26 15:23:50 2005
+++ b/tools/xenstore/testsuite/08transaction.sh Tue Jul 26 15:24:28 2005
@@ -79,3 +79,15 @@
 2 async commit
 1 waitwatch
 1 ackwatch token' | ./xs_test 2>&1`" = "1:/test/dir/sub:token" ]
+
+# Multiple events from single transaction don't trigger assert
+[ "`echo -e '1 watch /test token
+2 start /test
+2 write /test/1 create contents
+2 write /test/2 create contents
+2 async commit
+1 waitwatch
+1 ackwatch token
+1 waitwatch
+1 ackwatch token' | ./xs_test 2>&1`" = "1:/test/1:token
+1:/test/2:token" ]
diff -r 052208a34902 -r b9903985e9b6 tools/xenstore/xenstored_core.c
--- a/tools/xenstore/xenstored_core.c   Tue Jul 26 15:23:50 2005
+++ b/tools/xenstore/xenstored_core.c   Tue Jul 26 15:24:28 2005
@@ -111,6 +111,8 @@
        str = talloc_vasprintf(NULL, fmt, arglist);
        va_end(arglist);
 
+       trace("xenstored corruption: connection id %i: err %s: %s",
+               conn ? (int)conn->id : -1, strerror(saved_errno), str);
        eprintf("xenstored corruption: connection id %i: err %s: %s",
                conn ? (int)conn->id : -1, strerror(saved_errno), str);
 #ifdef TESTING
@@ -228,6 +230,21 @@
        write(tracefd, sockmsg_string(data->hdr.msg.type),
              strlen(sockmsg_string(data->hdr.msg.type)));
        write(tracefd, ")\n", 2);
+}
+
+void trace(const char *fmt, ...)
+{
+       va_list arglist;
+       char *str;
+
+       if (tracefd < 0)
+               return;
+
+       va_start(arglist, fmt);
+       str = talloc_vasprintf(NULL, fmt, arglist);
+       va_end(arglist);
+       write(tracefd, str, strlen(str));
+       talloc_free(str);
 }
 
 static bool write_message(struct connection *conn)
diff -r 052208a34902 -r b9903985e9b6 tools/xenstore/xenstored_core.h
--- a/tools/xenstore/xenstored_core.h   Tue Jul 26 15:23:50 2005
+++ b/tools/xenstore/xenstored_core.h   Tue Jul 26 15:24:28 2005
@@ -170,5 +170,6 @@
 void trace_create(const void *data, const char *type);
 void trace_destroy(const void *data, const char *type);
 void trace_watch_timeout(const struct connection *conn, const char *node, 
const char *token);
+void trace(const char *fmt, ...);
 
 #endif /* _XENSTORED_CORE_H */
diff -r 052208a34902 -r b9903985e9b6 tools/xenstore/xenstored_watch.c
--- a/tools/xenstore/xenstored_watch.c  Tue Jul 26 15:23:50 2005
+++ b/tools/xenstore/xenstored_watch.c  Tue Jul 26 15:24:28 2005
@@ -134,8 +134,6 @@
        if (conn->transaction)
                return false;
 
-       assert(conn->state == OK);
-
        /* Create an event for each watch.  Don't send to self. */
        list_for_each_entry(i, &connections, list) {
                if (i == conn)

_______________________________________________
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 transaction fires multiple events., Xen patchbot -unstable <=