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

[RFCv2 33/46] conf: Replace virDomainGraphicsDefParseXMLDesktop(hardcoded) with virDomainGraphicsDesktopDefParseXML(generated)



Signed-off-by: Shi Lei <shi_lei massclouds com>
---
 src/conf/domain_conf.c | 24 +-----------------------
 src/conf/domain_conf.h |  6 +++---
 2 files changed, 4 insertions(+), 26 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 7709d71..ad129e9 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -14431,28 +14431,6 @@ virDomainGraphicsRDPDefParseXMLHook(xmlNodePtr node G_GNUC_UNUSED,
 }
 
 
-static int
-virDomainGraphicsDefParseXMLDesktop(virDomainGraphicsDefPtr def,
-                                    xmlNodePtr node)
-{
-    g_autofree char *fullscreen = virXMLPropString(node, "fullscreen");
-
-    if (fullscreen != NULL) {
-        if (virStringParseYesNo(fullscreen, &def->data.desktop.fullscreen) < 0) {
-            virReportError(VIR_ERR_INTERNAL_ERROR,
-                           _("unknown fullscreen value '%s'"), fullscreen);
-            return -1;
-        }
-    } else {
-        def->data.desktop.fullscreen = false;
-    }
-
-    def->data.desktop.display = virXMLPropString(node, "display");
-
-    return 0;
-}
-
-
 static int
 virDomainGraphicsDefParseXMLSpice(virDomainGraphicsDefPtr def,
                                   xmlNodePtr node,
@@ -14826,7 +14804,7 @@ virDomainGraphicsDefParseXML(virDomainXMLOptionPtr xmlopt,
             goto error;
         break;
     case VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP:
-        if (virDomainGraphicsDefParseXMLDesktop(def, node) < 0)
+        if (virDomainGraphicsDesktopDefParseXML(node, &def->data.desktop, NULL, def, NULL) < 0)
             goto error;
         break;
     case VIR_DOMAIN_GRAPHICS_TYPE_SPICE:
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 1444257..ec08bdd 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1703,9 +1703,9 @@ struct _virDomainGraphicsRDPDef {   /* genparse:withhook, genformat:separate */
     char *_listen;                  /* xmlattr:listen, formathook */
 };
 
-struct _virDomainGraphicsDesktopDef {
-    char *display;
-    bool fullscreen;
+struct _virDomainGraphicsDesktopDef {   /* genparse */
+    char *display;                      /* xmlattr */
+    bool fullscreen;                    /* xmlattr */
 };
 
 struct _virDomainGraphicsSpiceDef {
-- 
2.25.1



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