From 61aaed0d584e88a6e0e832e11e76336e1d42a6bf Mon Sep 17 00:00:00 2001 From: "kfraser@localhost.localdomain" Date: Fri, 19 Jan 2007 17:58:30 +0000 Subject: [PATCH] Allow XS_INTRODUCE to be used for rebinding the xenstore evtchn. Signed-off-by: Andrei Petrov --- tools/xenstore/xenstored_domain.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tools/xenstore/xenstored_domain.c b/tools/xenstore/xenstored_domain.c index 115a1f75da..68f0816230 100644 --- a/tools/xenstore/xenstored_domain.c +++ b/tools/xenstore/xenstored_domain.c @@ -343,13 +343,14 @@ void do_introduce(struct connection *conn, struct buffered_data *in) fire_watches(conn, "@introduceDomain", false); } else { - /* Check that the given details match the ones we have - previously recorded. */ - if (port != domain->remote_port || - mfn != domain->mfn) { - send_error(conn, EINVAL); - return; - } + int rc; + + /* Use XS_INTRODUCE for recreating the xenbus event-channel. */ + if (domain->port) + xc_evtchn_unbind(xce_handle, domain->port); + rc = xc_evtchn_bind_interdomain(xce_handle, domid, port); + domain->port = (rc == -1) ? 0 : rc; + domain->remote_port = port; } send_ack(conn, XS_INTRODUCE); -- 2.30.2