From: Pino Toscano Date: Wed, 19 Sep 2018 17:16:20 +0000 (+0200) Subject: examples: switch from C.connect_readonly to connect_auth_readonly X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=876a7628e92c9bb7980af31fd50a19b305e1a625;p=ocaml-libvirt.git examples: switch from C.connect_readonly to connect_auth_readonly This way it is possible to connect to URIs that require some kind of authentication. --- diff --git a/examples/domain_events.ml b/examples/domain_events.ml index 03cecd9..b180676 100644 --- a/examples/domain_events.ml +++ b/examples/domain_events.ml @@ -62,7 +62,7 @@ let () = Some (Sys.argv.(1)) else None in - let conn = C.connect_readonly ?name () in + let conn = C.connect_auth_readonly ?name (C.get_auth_default ()) in let spinner = [| '|'; '/'; '-'; '\\' |] in diff --git a/examples/get_all_domain_stats.ml b/examples/get_all_domain_stats.ml index be91f77..68b7160 100644 --- a/examples/get_all_domain_stats.ml +++ b/examples/get_all_domain_stats.ml @@ -39,7 +39,7 @@ let () = exit 1 ); - let conn = C.connect_readonly () in + let conn = C.connect_auth_readonly (C.get_auth_default ()) in let what = [ D.StatsState; diff --git a/examples/get_cpu_stats.ml b/examples/get_cpu_stats.ml index 814c85e..27e1306 100644 --- a/examples/get_cpu_stats.ml +++ b/examples/get_cpu_stats.ml @@ -17,7 +17,7 @@ let () = ); let domname = Sys.argv.(1) in - let conn = C.connect_readonly () in + let conn = C.connect_auth_readonly (C.get_auth_default ()) in (* let nr_pcpus = diff --git a/examples/list_domains.ml b/examples/list_domains.ml index 5cd93c7..87ccd8c 100644 --- a/examples/list_domains.ml +++ b/examples/list_domains.ml @@ -26,7 +26,7 @@ let () = Some (Sys.argv.(1)) else None in - let conn = C.connect_readonly ?name () in + let conn = C.connect_auth_readonly ?name (C.get_auth_default ()) in (* List all domains (running and inactive). *) let domains = D.get_domains_and_infos conn [D.ListAll] in diff --git a/examples/node_info.ml b/examples/node_info.ml index c52615e..16ddf22 100644 --- a/examples/node_info.ml +++ b/examples/node_info.ml @@ -15,7 +15,7 @@ let () = Some (Sys.argv.(1)) else None in - let conn = C.connect_readonly ?name () in + let conn = C.connect_auth_readonly ?name (C.get_auth_default ()) in (* Get node_info, hostname, etc. *) let node_info = C.get_node_info conn in