mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
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:
1 parent
e66629438f
commit
31a5512777
4 files changed
+14
-1
No files matched your search
@@ -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
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||