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 the startup behaviour when the tdb file exists. We w

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Fix the startup behaviour when the tdb file exists. We were attempting to
From: Xen patchbot -3.0-testing <patchbot-3.0-testing@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 09 Dec 2005 10:06:20 +0000
Delivery-date: Fri, 09 Dec 2005 10:09:44 +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 1e3d319520155d1d5b5fbf409334a6bcad06bde2
# Parent  aa74cb7b3d1777e4bc95b1c81d01c6d41f765657
Fix the startup behaviour when the tdb file exists.  We were attempting to
remove and recreate the /local directory, but the manual_node call only works
if the tdb is empty -- we must use create_node, otherwise the store is
corrupted.

It's not clear to me that the other manual_node calls are safe, but I have only
made this smaller change for the sake of stability.  These other calls should
be reviewed.

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

xen-unstable cset: ac3ceb2d37d17a4c64b6fcccf5d0c1ab5507c557
committer: Robert Read <robert@xxxxxxxxxxxxx>

diff -r aa74cb7b3d17 -r 1e3d31952015 tools/xenstore/xenstored_core.c
--- a/tools/xenstore/xenstored_core.c   Wed Dec  7 07:41:41 2005
+++ b/tools/xenstore/xenstored_core.c   Wed Dec  7 07:44:38 2005
@@ -823,7 +823,7 @@
        node->num_perms = parent->num_perms;
        node->perms = talloc_memdup(node, parent->perms,
                                    node->num_perms * sizeof(node->perms[0]));
-       if (conn->id)
+       if (conn && conn->id)
                node->perms[0].id = conn->id;
 
        /* No children, no data */
@@ -1441,8 +1441,10 @@
                   balloon driver will pick up stale entries.  In the case of
                   the balloon driver, this can be fatal.
                */
+               char *tlocal = talloc_strdup(talloc_autofree_context(),
+                                            "/local");
                internal_rm("/local");
-               manual_node("/", "local");
+               create_node(NULL, tlocal, NULL, 0);
        }
        else {
                tdb_ctx = tdb_open(tdbname, 7919, TDB_FLAGS, O_RDWR|O_CREAT,

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

<Prev in Thread] Current Thread [Next in Thread>