]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
remote: convert to typesafe virConf accessors
authorDaniel P. Berrange <berrange@redhat.com>
Fri, 8 Jul 2016 12:53:55 +0000 (13:53 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Tue, 12 Jul 2016 08:58:22 +0000 (09:58 +0100)
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
src/remote/remote_driver.c

index e9904f8cd1c0214590b2e269afc562f6244d925e..29552aa27bd8542254250749b61bec40ca175d63 100644 (file)
@@ -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,