mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
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@suse.com> Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
This commit is contained in:
1 parent
0929658c71
commit
75c7d6a6c6
5 files changed
+19
-3
No files matched your search
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -862,9 +862,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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||