Commit
60e2f6020d ("tools/xenstore: move the call of setup_structure()
to dom0 introduction") deferred the setup of the tdb database, but that
doesn't work very well with the -D flag which avoids initialising dom0.
We end up just segfaulting with a NULL tdb pointer on any attempted
access.
Fixes: 60e2f6020d ("tools/xenstore: move the call of setup_structure() to dom0 introduction")
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
errno = saved_errno;
}
-void setup_structure(bool live_update)
+static void setup_database(void)
{
char *tdbname;
0640, &tdb_logger, NULL);
if (!tdb_ctx)
barf_perror("Could not create tdb file %s", tdbname);
+}
+void setup_structure(bool live_update)
+{
if (live_update)
manual_node("/", NULL);
else {
init_pipe(reopen_log_pipe);
+ /* Setup the database */
+ setup_database();
+
/* Listen to hypervisor. */
if (!no_domain_init && !live_update) {
domain_init(-1);