aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xenstore/xenstored_domain.c
diff options
context:
space:
mode:
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>2007-02-28 14:13:09 +0000
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>2007-02-28 14:13:09 +0000
commitc70b3e5890b00e3dff2407cc50aafd07ec17b6b3 (patch)
treee6794cfef59bc8e64dd8eec173250896f00ffca9 /tools/xenstore/xenstored_domain.c
parent96b0fdf67b7c0f8b1f261cc712af8723db3d9d3b (diff)
downloadxen-c70b3e5890b00e3dff2407cc50aafd07ec17b6b3.tar.gz
xen-c70b3e5890b00e3dff2407cc50aafd07ec17b6b3.tar.bz2
xen-c70b3e5890b00e3dff2407cc50aafd07ec17b6b3.zip
More PV save/restore fixes.
Related changesets: 14148:b67c253d1cdb4f502dec2 13519:b4a8000e76db6b4b27341 These three changesets must be applied as a set! Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'tools/xenstore/xenstored_domain.c')
-rw-r--r--tools/xenstore/xenstored_domain.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/tools/xenstore/xenstored_domain.c b/tools/xenstore/xenstored_domain.c
index 68f0816230..ba3507fdfc 100644
--- a/tools/xenstore/xenstored_domain.c
+++ b/tools/xenstore/xenstored_domain.c
@@ -298,6 +298,7 @@ void do_introduce(struct connection *conn, struct buffered_data *in)
unsigned int domid;
unsigned long mfn;
evtchn_port_t port;
+ int rc;
if (get_strings(in, vec, ARRAY_SIZE(vec)) < ARRAY_SIZE(vec)) {
send_error(conn, EINVAL);
@@ -341,18 +342,22 @@ void do_introduce(struct connection *conn, struct buffered_data *in)
talloc_steal(domain->conn, domain);
fire_watches(conn, "@introduceDomain", false);
- }
- else {
- int rc;
-
+ } else if (domain->mfn == mfn) {
/* 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;
+ } else {
+ send_error(conn, EINVAL);
+ return;
}
+ /* Rings must be quiesced. */
+ domain->interface->req_cons = domain->interface->req_prod = 0;
+ domain->interface->rsp_cons = domain->interface->rsp_prod = 0;
+
send_ack(conn, XS_INTRODUCE);
}