[libvirt PATCH 33/38] backup_conf: Use virXMLProp(OnOff|YesNo) in virDomainBackupDefParse

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

 



Signed-off-by: Tim Wiederhake <twiederh@xxxxxxxxxx>
---
 src/conf/backup_conf.c | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

diff --git a/src/conf/backup_conf.c b/src/conf/backup_conf.c
index 8560f3bf2e..3a1863d2c3 100644
--- a/src/conf/backup_conf.c
+++ b/src/conf/backup_conf.c
@@ -234,8 +234,6 @@ virDomainBackupDefParse(xmlXPathContextPtr ctxt,
     def->incremental = virXPathString("string(./incremental)", ctxt);
 
     if ((node = virXPathNode("./server", ctxt))) {
-        g_autofree char *tls = NULL;
-
         if (def->type != VIR_DOMAIN_BACKUP_TYPE_PULL) {
             virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
                            _("use of <server> requires pull mode backup"));
@@ -261,18 +259,8 @@ virDomainBackupDefParse(xmlXPathContextPtr ctxt,
             return NULL;
         }
 
-        if ((tls = virXMLPropString(node, "tls"))) {
-            int tmp;
-
-            if ((tmp = virTristateBoolTypeFromString(tls)) <= 0) {
-                virReportError(VIR_ERR_XML_ERROR,
-                               _("unknown value '%s' of 'tls' attribute"),\
-                               tls);
-                return NULL;
-            }
-
-            def->tls = tmp;
-        }
+        if (virXMLPropYesNo(node, "tls", &def->tls) < 0)
+            return NULL;
     }
 
     if ((n = virXPathNodeSet("./disks/*", ctxt, &nodes)) < 0)
-- 
2.26.2




[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]

  Powered by Linux