]> xenbits.xensource.com Git - xen.git/commitdiff
oxenstored: save remote evtchn port, not local port
authorJonathan Davies <jonathan.davies@citrix.com>
Fri, 7 Apr 2017 13:27:20 +0000 (14:27 +0100)
committerWei Liu <wei.liu2@citrix.com>
Mon, 10 Apr 2017 13:46:25 +0000 (14:46 +0100)
Previously, Domain.dump output the number of the local port
corresponding to each domain's event-channel. However, when oxenstored
exits, it closes /dev/xen/evtchn which causes the kernel to close the
local port (evtchn_release), so this port is no longer useful.

Instead, store the remote port. This can be used to reconnect the
event-channel by binding the original remote port to a fresh local port.

Indeed, the logic for parsing the stored state already expects a remote
port as it passes the parsed port number to Domain.make (via
Domains.create), which takes a remote port.

Signed-off-by: Jonathan Davies <jonathan.davies@citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Christian Lindig <christian.lindig@citrix.com>
Release-acked-by: Julien Grall <julien.grall@arm.com>
tools/ocaml/xenstored/domain.ml

index 4515650d5164f769fc513bccbf4bd6d102f4049c..eda2ea91aff6e10ee1f5e16ac8ee53021a92143e 100644 (file)
@@ -62,7 +62,7 @@ let string_of_port = function
 | Some x -> string_of_int (Xeneventchn.to_int x)
 
 let dump d chan =
-       fprintf chan "dom,%d,%nd,%s\n" d.id d.mfn (string_of_port d.port)
+       fprintf chan "dom,%d,%nd,%d\n" d.id d.mfn d.remote_port
 
 let notify dom = match dom.port with
 | None ->