Allow XS_INTRODUCE to be used for rebinding the xenstore evtchn.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Fri, 19 Jan 2007 17:58:30 +0000 (17:58 +0000)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Fri, 19 Jan 2007 17:58:30 +0000 (17:58 +0000)
Signed-off-by: Andrei Petrov <andrei.petrov@xensource.com>
tools/xenstore/xenstored_domain.c

index 115a1f75dae93780c3f38ac7eba556e9c37f969f..68f08162302c5bc0ff54a1275ccd7d6651e4ed07 100644 (file)
@@ -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);