[PATCH 16/16] remote: convert to typesafe virConf accessors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
---
 src/remote/remote_driver.c | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index e9904f8..29552aa 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -864,18 +864,9 @@ doRemoteOpen(virConnectPtr conn,
     /* Connect to the remote service. */
     switch (transport) {
     case trans_tls:
-        if (conf && !tls_priority) {
-            virConfValuePtr val = virConfGetValue(conf, "tls_priority");
-            if (val) {
-                if (val->type != VIR_CONF_STRING) {
-                    virReportError(VIR_ERR_INVALID_ARG, "%s",
-                                   _("Config file 'tls_priority' must be a string"));
-                    goto failed;
-                }
-                if (VIR_STRDUP(tls_priority, val->str) < 0)
-                    goto failed;
-            }
-        }
+        if (conf && !tls_priority &&
+            virConfGetValueString(conf, "tls_priority", &tls_priority) < 0)
+            goto failed;
 
 #ifdef WITH_GNUTLS
         priv->tls = virNetTLSContextNewClientPath(pkipath,
-- 
2.7.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]