-(* Callback function to open a connection.
- * This should be a lot more sophisticated. XXX
- *)
-let open_connection () =
- let title = "Open connection to hypervisor" in
- let uri =
- GToolbox.input_string ~title ~text:"xen:///" ~ok:"Open" "Connection:" in
- match uri with
- | None -> ()
- | Some uri ->
- (* If this fails, let the exception escape and be printed
- * in the global exception handler.
- *)
- let conn = C.connect ~name:uri () in
-
- let node_info = C.get_node_info conn in
- let hostname =
- try Some (C.get_hostname conn)
- with
- | Libvirt.Not_supported "virConnectGetHostname"
- | Libvirt.Virterror _ -> None in
-
- (* Add it to our list of connections. *)
- let conn_id = add_conn conn in
- Hashtbl.add static_conn_info conn_id (node_info, hostname, uri)
-