xenstored: don't use xenevtchn_fdopen() in stubdom

When running in a stubdom environment xenevtchn_fdopen() won't work,
as any file descriptor state is lost across kexec().

Use a wrapper to replace the call of xenevtchn_fdopen() with the
really needed xenevtchn_open() when running on top of Mini-OS.

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:44:58 +02:00
1 parent e66629438f
commit 31a5512777
4 files changed
+14 -1

No files matched your search

+3
View File
@@ -29,6 +29,7 @@
#include <stdint.h>
#include <time.h>
#include <errno.h>
#include <xenevtchn.h>
#include "xenstore_lib.h"
#include "xenstore_state.h"
@@ -405,6 +406,8 @@ void handle_special_fds(void);
int get_socket_fd(void);
void set_socket_fd(int fd);
xenevtchn_handle *evtchn_fdopen(int fd);
#ifdef __MINIOS__
void mount_9pfs(void);
#endif
+1 -1
View File
@@ -1396,7 +1396,7 @@ void domain_init(int evtfd)
if (evtfd < 0)
xce_handle = xenevtchn_open(NULL, XENEVTCHN_NO_CLOEXEC);
else
xce_handle = xenevtchn_fdopen(NULL, evtfd, 0);
xce_handle = evtchn_fdopen(evtfd);
if (xce_handle == NULL)
barf_perror("Failed to open evtchn device");
+5
View File
@@ -85,6 +85,11 @@ void set_socket_fd(int fd)
{
}
xenevtchn_handle *evtchn_fdopen(int fd)
{
return xenevtchn_open(NULL, XENEVTCHN_NO_CLOEXEC);
}
static void mount_thread(void *p)
{
xenbus_event_queue events = NULL;
+5
View File
@@ -408,6 +408,11 @@ void set_socket_fd(int fd)
sock = fd;
}
xenevtchn_handle *evtchn_fdopen(int fd)
{
return xenevtchn_fdopen(NULL, fd, 0);
}
const char *xenstore_rundir(void)
{
return xenstore_daemon_rundir();
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.