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

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

 



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

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index b4928a94c2..756a35f33b 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -13077,7 +13077,6 @@ virDomainGraphicsDefParseXMLVNC(virDomainGraphicsDefPtr def,
     g_autofree char *websocketGenerated = virXMLPropString(node, "websocketGenerated");
     g_autofree char *sharePolicy = virXMLPropString(node, "sharePolicy");
     g_autofree char *autoport = virXMLPropString(node, "autoport");
-    g_autofree char *powerControl = virXMLPropString(node, "powerControl");
     xmlNodePtr audioNode;
     VIR_XPATH_NODE_AUTORESTORE(ctxt)
 
@@ -13136,15 +13135,8 @@ virDomainGraphicsDefParseXMLVNC(virDomainGraphicsDefPtr def,
         }
     }
 
-    if (powerControl) {
-        int powerControlVal = virTristateBoolTypeFromString(powerControl);
-        if (powerControlVal < 0) {
-            virReportError(VIR_ERR_INTERNAL_ERROR,
-                           _("cannot parse vnc power control '%s'"), powerControl);
-            return -1;
-        }
-        def->data.vnc.powerControl = powerControlVal;
-    }
+    if ((virXMLPropYesNo(node, "powerControl", &def->data.vnc.powerControl)) < 0)
+        return -1;
 
     def->data.vnc.keymap = virXMLPropString(node, "keymap");
 
-- 
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