{
id: Xenctrl.domid;
mfn: nativeint;
- remote_port: int;
interface: Xenmmap.mmap_interface;
eventchn: Event.t;
+ mutable remote_port: int;
mutable port: Xeneventchn.t option;
mutable bad_client: bool;
mutable io_credit: int; (* the rounds of ring process left to do, default is 0,
Event.notify dom.eventchn port
let bind_interdomain dom =
+ begin match dom.port with
+ | None -> ()
+ | Some port -> Event.unbind dom.eventchn port
+ end;
dom.port <- Some (Event.bind_interdomain dom.eventchn dom.id dom.remote_port);
debug "bound domain %d remote port %d to local port %s" dom.id dom.remote_port (string_of_port dom.port)
in
let dom =
if Domains.exist domains domid then
- Domains.find domains domid
+ let edom = Domains.find domains domid in
+ if (Domain.get_mfn edom) = mfn && (Connections.find_domain cons domid) != con then begin
+ (* Use XS_INTRODUCE for recreating the xenbus event-channel. *)
+ edom.remote_port <- port;
+ Domain.bind_interdomain edom;
+ end;
+ edom
else try
let ndom = Domains.create domains domid mfn port in
Connections.add_domain cons ndom;