From 876a7628e92c9bb7980af31fd50a19b305e1a625 Mon Sep 17 00:00:00 2001
From: Pino Toscano <ptoscano@redhat.com>
Date: Wed, 19 Sep 2018 19:16:20 +0200
Subject: [PATCH] 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.
---
 examples/domain_events.ml        | 2 +-
 examples/get_all_domain_stats.ml | 2 +-
 examples/get_cpu_stats.ml        | 2 +-
 examples/list_domains.ml         | 2 +-
 examples/node_info.ml            | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

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
-- 
1.8.3.1