diff -r 9e71f6b54bfc ocaml/xiu/xiu.ml --- a/ocaml/xiu/xiu.ml Wed Aug 04 20:42:21 2010 +0100 +++ b/ocaml/xiu/xiu.ml Thu Aug 05 11:18:01 2010 +0100 @@ -349,6 +349,12 @@ xs.Xs.unwatch (sprintf "/local/domain/%d/device" dom) "frontend"; xs.Xs.unwatch (sprintf "/local/domain/0/device-model/%d" dom) "devicemodel" in + let write_vnc_port dom = + let port = sprintf "%d" (5900 + dom) in + xs.Xs.write (sprintf "/local/domain/%d/serial/0/vnc-port" dom) port; (* PV *) + xs.Xs.write (sprintf "/local/domain/%d/console/vnc-port" dom) port (* HVM *) + in + (* diff old list and new list *) let currents = Hashtbl.fold (fun k v acc -> k :: acc) domains [] in @@ -359,6 +365,7 @@ List.iter (fun old -> remove_watch_for_olddomain old) disappeared; List.iter (fun n -> add_watch_for_newdomain n) news; + List.iter write_vnc_port news; olds := currents; () in