Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP2:Update
xen.7652
xs-21-empty-tdb-database.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File xs-21-empty-tdb-database.patch of Package xen.7652
commit 388d3011d1bbc926df61aabd101208d6134d3eb5 Author: Juergen Gross <jgross@suse.com> Date: Tue Jan 10 17:13:38 2017 +0100 tools/xenstore: start with empty data base Today xenstored tries to open a tdb data base file on disk when it is started. As this is problematic in most cases the scripts used to start xenstored ensure xenstored won't find such a file in order to start with an empty xenstore. A tdb data base file can't be used to restore all Xenstore state as e.g. Xenstore watches are not kept in the tdb data base. The file is meant to be used for debugging purposes after a xenstored crash only. Instead of opening a Xenstore data base file found on disk always start with an empty data base. This will avoid problems in case someone is testing multiple xenstored versions without rebooting (which is not supported but helps debugging in some cases). Signed-off-by: Juergen Gross <jgross@suse.com> Acked-by: Wei Liu <wei.liu2@citrix.com> Index: xen-4.7.2-testing/tools/xenstore/xenstored_core.c =================================================================== --- xen-4.7.2-testing.orig/tools/xenstore/xenstored_core.c +++ xen-4.7.2-testing/tools/xenstore/xenstored_core.c @@ -1176,17 +1176,6 @@ static int _rm(struct connection *conn, } -static void internal_rm(const char *name) -{ - char *tname = talloc_strdup(NULL, name); - struct node *node = read_node(NULL, tname, tname); - if (node) - _rm(NULL, tname, node, tname); - talloc_free(node); - talloc_free(tname); -} - - static int do_rm(struct connection *conn, struct buffered_data *in) { struct node *node; @@ -1602,49 +1591,18 @@ static void setup_structure(void) barf_perror("Could not create tdbname"); if (!(tdb_flags & TDB_INTERNAL)) - tdb_ctx = tdb_open_ex(tdbname, 0, tdb_flags, O_RDWR, 0, - &tdb_logger, NULL); - - 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. - */ - char *tlocal = talloc_strdup(NULL, "/local"); - - check_store(); + unlink(tdbname); - if (remove_local) { - internal_rm("/local"); - create_node(NULL, NULL, tlocal, NULL, 0); + tdb_ctx = tdb_open_ex(tdbname, 7919, tdb_flags, O_RDWR|O_CREAT|O_EXCL, + 0640, &tdb_logger, NULL); + if (!tdb_ctx) + barf_perror("Could not create tdb file %s", tdbname); + + manual_node("/", "tool"); + manual_node("/tool", "xenstored"); + manual_node("/tool/xenstored", NULL); - check_store(); - } - - talloc_free(tlocal); - } - else { - tdb_ctx = tdb_open_ex(tdbname, 7919, tdb_flags, O_RDWR|O_CREAT, - 0640, &tdb_logger, NULL); - if (!tdb_ctx) - barf_perror("Could not create tdb file %s", tdbname); - - manual_node("/", "tool"); - manual_node("/tool", "xenstored"); - manual_node("/tool/xenstored", NULL); - - check_store(); - } + check_store(); }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor