[libvirt PATCH 06/10] virDomainChrSourceDefParseLog: Use virXMLProp*

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

 



Signed-off-by: Tim Wiederhake <twiederh@xxxxxxxxxx>
---
 src/conf/domain_conf.c | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index d10d697884..c97a062d1f 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -11713,20 +11713,11 @@ static int
 virDomainChrSourceDefParseLog(virDomainChrSourceDef *def,
                               xmlNodePtr log)
 {
-    g_autofree char *append = NULL;
-
     def->logfile = virXMLPropString(log, "file");
 
-    if ((append = virXMLPropString(log, "append"))) {
-        int value;
-        if ((value = virTristateSwitchTypeFromString(append)) <= 0) {
-            virReportError(VIR_ERR_INTERNAL_ERROR,
-                           _("Invalid append attribute value '%s'"),
-                           append);
-            return -1;
-        }
-        def->logappend = value;
-    }
+    if (virXMLPropTristateSwitch(log, "append", VIR_XML_PROP_NONE,
+                                 &def->logappend) < 0)
+        return -1;
 
     return 0;
 }
-- 
2.26.3




[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