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:
Juergen Gross authored and Jan Beulich committed 2025-07-31 09:45:59 +02:00
1 parent 75c7d6a6c6
commit e3c2af4ccd
5 files changed
+22 -13

No files matched your search

+2 -2
View File
@@ -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. */
+1 -1
View File
@@ -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);
+9 -6
View File
@@ -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
}
+1 -1
View File
@@ -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);
+9 -3
View File
@@ -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)
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.