mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
tools/xenstored: make stubdom_init() live update aware
Pass the live_update bool to stubdom_init() in order to be able to handle it properly under Mini-OS. As stubdom_init() will (re-)create the 9pfs device needed for reading the saved state, call stubdom_init() before lu_read_state(). Signed-off-by: Juergen Gross <jgross@suse.com> Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
This commit is contained in:
1 parent
75c7d6a6c6
commit
e3c2af4ccd
5 files changed
+22
-13
No files matched your search
@@ -2774,14 +2774,14 @@ int main(int argc, char *argv[])
|
||||
if (tracefile)
|
||||
tracefile = absolute_filename(NULL, tracefile);
|
||||
|
||||
stubdom_init(live_update);
|
||||
|
||||
#ifndef NO_LIVE_UPDATE
|
||||
/* Read state in case of live update. */
|
||||
if (live_update)
|
||||
lu_read_state();
|
||||
#endif
|
||||
|
||||
stubdom_init();
|
||||
|
||||
check_store();
|
||||
|
||||
/* Get ready to listen to the tools. */
|
||||
|
||||
@@ -412,7 +412,7 @@ xenevtchn_handle *evtchn_fdopen(int fd);
|
||||
int evtchn_rebind(int port);
|
||||
|
||||
#ifdef __MINIOS__
|
||||
void mount_9pfs(void);
|
||||
void mount_9pfs(bool live_update);
|
||||
#endif
|
||||
|
||||
const char *xenstore_rundir(void);
|
||||
|
||||
@@ -1337,7 +1337,7 @@ void dom0_init(void)
|
||||
xenevtchn_notify(xce_handle, dom0->port);
|
||||
}
|
||||
|
||||
void stubdom_init(void)
|
||||
void stubdom_init(bool live_update)
|
||||
{
|
||||
#ifdef __MINIOS__
|
||||
struct domain *stubdom;
|
||||
@@ -1345,13 +1345,16 @@ void stubdom_init(void)
|
||||
if (stub_domid < 0)
|
||||
return;
|
||||
|
||||
stubdom = introduce_domain(NULL, stub_domid, xenbus_evtchn, false);
|
||||
if (!stubdom)
|
||||
barf_perror("Failed to initialize stubdom");
|
||||
if (!live_update) {
|
||||
stubdom = introduce_domain(NULL, stub_domid, xenbus_evtchn,
|
||||
false);
|
||||
if (!stubdom)
|
||||
barf_perror("Failed to initialize stubdom");
|
||||
|
||||
xenevtchn_notify(xce_handle, stubdom->port);
|
||||
xenevtchn_notify(xce_handle, stubdom->port);
|
||||
}
|
||||
|
||||
mount_9pfs();
|
||||
mount_9pfs(live_update);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ int do_set_feature(const void *ctx, struct connection *conn,
|
||||
void domain_early_init(void);
|
||||
void domain_init(int evtfd);
|
||||
void dom0_init(void);
|
||||
void stubdom_init(void);
|
||||
void stubdom_init(bool live_update);
|
||||
void domain_deinit(void);
|
||||
void ignore_connection(struct connection *conn, unsigned int err);
|
||||
|
||||
|
||||
@@ -131,15 +131,21 @@ static void mount_thread(void *p)
|
||||
free(err);
|
||||
}
|
||||
|
||||
p9_device = init_9pfront(0, XENSTORE_LIB_DIR);
|
||||
p9_device = init_9pfront2(0, XENSTORE_LIB_DIR, INIT9P_FLAG_KEXEC);
|
||||
|
||||
/* Start logging if selected. */
|
||||
reopen_log();
|
||||
}
|
||||
|
||||
void mount_9pfs(void)
|
||||
void mount_9pfs(bool live_update)
|
||||
{
|
||||
create_thread("mount-9pfs", mount_thread, NULL);
|
||||
if (!live_update)
|
||||
create_thread("mount-9pfs", mount_thread, NULL);
|
||||
else {
|
||||
p9_device = init_9pfront2(0, XENSTORE_LIB_DIR,
|
||||
INIT9P_FLAG_REINIT);
|
||||
reopen_log();
|
||||
}
|
||||
}
|
||||
|
||||
const char *xenstore_rundir(void)
|
||||
|
||||