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/
Home Products Support Community News


[Xen-changelog] Remove /local when xenstored starts. This stops stale da

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Remove /local when xenstored starts. This stops stale data affecting the
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 01 Dec 2005 11:20:13 +0000
Delivery-date: Thu, 01 Dec 2005 11:21:13 +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 emellor@xxxxxxxxxxxxxxxxxxxxxx
# Node ID 2e3051c017574001c70283f1144e6aa1e6cef847
# Parent  fbbb8a2a60138d4e3c1168e44fe021b84d194864
Remove /local when xenstored starts.  This stops stale data affecting the 
system immediately after reboot.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>

diff -r fbbb8a2a6013 -r 2e3051c01757 tools/xenstore/xenstored_core.c
--- a/tools/xenstore/xenstored_core.c   Thu Dec  1 03:26:47 2005
+++ b/tools/xenstore/xenstored_core.c   Thu Dec  1 03:32:39 2005
@@ -1009,6 +1009,15 @@
+static void internal_rm(const char *name)
+       char *tname = talloc_strdup(talloc_autofree_context(), name);
+       struct node *node = read_node(NULL, tname);
+       if (node)
+               _rm(NULL, node, tname);
 static void do_rm(struct connection *conn, const char *name)
        struct node *node;
@@ -1417,7 +1426,24 @@
        tdbname = talloc_strdup(talloc_autofree_context(), xs_daemon_tdb());
        tdb_ctx = tdb_open(tdbname, 0, TDB_FLAGS, O_RDWR, 0);
-       if (!tdb_ctx) {
+       if (tdb_ctx) {
+               /* XXX When we make xenstored able to restart, this will have
+                  to become cleverer, checking for existing domains and not
+                  removing the corresponding entries, but for now xenstored
+                  cannot be restarted without losing all the registered
+                  watches, which breaks all the backend drivers anyway.  We
+                  can therefore get away with just clearing /local and
+                  expecting Xend to put the appropriate entries back in.
+                  When this change is made it is important to note that
+                  dom0's entries must be cleaned up on reboot _before_ this
+                  daemon starts, otherwise the backend drivers and dom0's
+                  balloon driver will pick up stale entries.  In the case of
+                  the balloon driver, this can be fatal.
+               */
+               internal_rm("/local");
+       }
+       else {
                tdb_ctx = tdb_open(tdbname, 7919, TDB_FLAGS, O_RDWR|O_CREAT,
                if (!tdb_ctx)

Xen-changelog mailing list

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Remove /local when xenstored starts. This stops stale data affecting the, Xen patchbot -unstable <=