[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH 8/9] xenstored: rebind event channels after live update in stubdom
After performing a live update in stubdom environment some information about inter-domain event channels is lost. In order to set this information again, call xenevtchn_bind() from new_domain() in the restore case. Signed-off-by: Juergen Gross <jgross@xxxxxxxx> --- tools/xenstored/core.c | 1 - tools/xenstored/core.h | 3 +++ tools/xenstored/domain.c | 8 ++++++-- tools/xenstored/minios.c | 5 +++++ tools/xenstored/posix.c | 5 +++++ 5 files changed, 19 insertions(+), 3 deletions(-) diff --git a/tools/xenstored/core.c b/tools/xenstored/core.c index 37e4dd5a5b..09c838d6e8 100644 --- a/tools/xenstored/core.c +++ b/tools/xenstored/core.c @@ -49,7 +49,6 @@ #include "control.h" #include "lu.h" -extern xenevtchn_handle *xce_handle; /* in domain.c */ static int xce_pollfd_idx = -1; struct pollfd *poll_fds; static unsigned int current_array_size; diff --git a/tools/xenstored/core.h b/tools/xenstored/core.h index bef24a688c..3f7426fbe3 100644 --- a/tools/xenstored/core.h +++ b/tools/xenstored/core.h @@ -394,6 +394,8 @@ static inline bool domain_is_unprivileged(const struct connection *conn) return conn && domid_is_unprivileged(conn->id); } +extern xenevtchn_handle *xce_handle; /* in domain.c */ + /* Return the event channel used by xenbus. */ evtchn_port_t get_xenbus_evtchn(void); void early_init(bool live_update, bool dofork, const char *pidfile); @@ -407,6 +409,7 @@ int get_socket_fd(void); void set_socket_fd(int fd); xenevtchn_handle *evtchn_fdopen(int fd); +int evtchn_rebind(int port); #ifdef __MINIOS__ void mount_9pfs(void); diff --git a/tools/xenstored/domain.c b/tools/xenstored/domain.c index e0c2342edb..ca0744d6bb 100644 --- a/tools/xenstored/domain.c +++ b/tools/xenstored/domain.c @@ -855,9 +855,13 @@ static int new_domain(struct domain *domain, int port, bool restore) wrl_domain_new(domain); - if (restore) + if (restore) { + if (evtchn_rebind(port)) { + errno = ENOMEM; + return errno; + } domain->port = port; - else { + } else { /* Tell kernel we're interested in this event. */ rc = xenevtchn_bind_interdomain(xce_handle, domain->domid, port); diff --git a/tools/xenstored/minios.c b/tools/xenstored/minios.c index aa1f03fd6b..ec5faebaf3 100644 --- a/tools/xenstored/minios.c +++ b/tools/xenstored/minios.c @@ -90,6 +90,11 @@ xenevtchn_handle *evtchn_fdopen(int fd) return xenevtchn_open(NULL, XENEVTCHN_NO_CLOEXEC); } +int evtchn_rebind(int port) +{ + return xenevtchn_bind(xce_handle, port); +} + static void mount_thread(void *p) { xenbus_event_queue events = NULL; diff --git a/tools/xenstored/posix.c b/tools/xenstored/posix.c index ebdec82215..97561701ae 100644 --- a/tools/xenstored/posix.c +++ b/tools/xenstored/posix.c @@ -413,6 +413,11 @@ xenevtchn_handle *evtchn_fdopen(int fd) return xenevtchn_fdopen(NULL, fd, 0); } +int evtchn_rebind(int port) +{ + return 0; +} + const char *xenstore_rundir(void) { return xenstore_daemon_rundir(); -- 2.43.0
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |