[libvirt PATCH 14/38] domain_conf: Use virXMLProp(OnOff|YesNo) in virDomainChrSourceDefParseFile

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

 



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

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 1cec2edde7..d9330f9ee7 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -11808,17 +11808,13 @@ static int
 virDomainChrSourceDefParseFile(virDomainChrSourceDefPtr def,
                                xmlNodePtr source)
 {
-    g_autofree char *append = NULL;
-
-    def->data.file.path = virXMLPropString(source, "path");
+    virTristateSwitch append = VIR_TRISTATE_SWITCH_ABSENT;
 
-    if ((append = virXMLPropString(source, "append")) &&
-        (def->data.file.append = virTristateSwitchTypeFromString(append)) <= 0) {
-        virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Invalid append attribute value '%s'"),
-                       append);
+    if (virXMLPropOnOff(source, "append", &append) < 0)
         return -1;
-    }
+
+    def->data.file.path = virXMLPropString(source, "path");
+    def->data.file.append = append;
 
     return 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