[PATCH 08/16] Xen: xenconfig: remove xendConfigVersion from public functions

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

 



Remove use of xendConfigVersion in the xm and xl config formatter/parsers
in src/xenconfig/. Adjust callers in the xen and libxl drivers accordingly.

Signed-off-by: Jim Fehlig <jfehlig@xxxxxxxx>
---
 src/libxl/libxl_driver.c   |  8 +++-----
 src/xen/xen_driver.c       |  5 ++---
 src/xen/xm_internal.c      |  7 +++----
 src/xenconfig/xen_common.c |  6 ++----
 src/xenconfig/xen_common.h |  7 +++----
 src/xenconfig/xen_xl.c     |  9 ++++-----
 src/xenconfig/xen_xl.h     |  7 +++----
 src/xenconfig/xen_xm.c     | 25 +++++++++----------------
 src/xenconfig/xen_xm.h     |  5 ++---
 tests/xlconfigtest.c       |  4 ++--
 tests/xmconfigtest.c       |  5 ++---
 11 files changed, 35 insertions(+), 53 deletions(-)

diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index a42647a..fd92fac 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -2595,15 +2595,13 @@ libxlConnectDomainXMLFromNative(virConnectPtr conn,
             goto cleanup;
         if (!(def = xenParseXL(conf,
                                cfg->caps,
-                               driver->xmlopt,
-                               cfg->verInfo->xen_version_major)))
+                               driver->xmlopt)))
             goto cleanup;
     } else if (STREQ(nativeFormat, LIBXL_CONFIG_FORMAT_XM)) {
         if (!(conf = virConfReadMem(nativeConfig, strlen(nativeConfig), 0)))
             goto cleanup;
 
         if (!(def = xenParseXM(conf,
-                               cfg->verInfo->xen_version_major,
                                cfg->caps,
                                driver->xmlopt)))
             goto cleanup;
@@ -2659,10 +2657,10 @@ libxlConnectDomainXMLToNative(virConnectPtr conn, const char * nativeFormat,
         goto cleanup;
 
     if (STREQ(nativeFormat, LIBXL_CONFIG_FORMAT_XL)) {
-        if (!(conf = xenFormatXL(def, conn, cfg->verInfo->xen_version_major)))
+        if (!(conf = xenFormatXL(def, conn)))
             goto cleanup;
     } else if (STREQ(nativeFormat, LIBXL_CONFIG_FORMAT_XM)) {
-        if (!(conf = xenFormatXM(conn, def, cfg->verInfo->xen_version_major)))
+        if (!(conf = xenFormatXM(conn, def)))
             goto cleanup;
     } else {
 
diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c
index 285a553..321a250 100644
--- a/src/xen/xen_driver.c
+++ b/src/xen/xen_driver.c
@@ -1645,8 +1645,7 @@ xenUnifiedConnectDomainXMLFromNative(virConnectPtr conn,
         if (!conf)
             goto cleanup;
 
-        def = xenParseXM(conf, priv->xendConfigVersion,
-                         priv->caps, priv->xmlopt);
+        def = xenParseXM(conf, priv->caps, priv->xmlopt);
     } else if (STREQ(format, XEN_CONFIG_FORMAT_SEXPR)) {
         if (xenGetDomIdFromSxprString(config, priv->xendConfigVersion, &id) < 0)
             goto cleanup;
@@ -1700,7 +1699,7 @@ xenUnifiedConnectDomainXMLToNative(virConnectPtr conn,
 
     if (STREQ(format, XEN_CONFIG_FORMAT_XM)) {
         int len = MAX_CONFIG_SIZE;
-        conf = xenFormatXM(conn, def, priv->xendConfigVersion);
+        conf = xenFormatXM(conn, def);
         if (!conf)
             goto cleanup;
 
diff --git a/src/xen/xm_internal.c b/src/xen/xm_internal.c
index ee78fe9..085b24a 100644
--- a/src/xen/xm_internal.c
+++ b/src/xen/xm_internal.c
@@ -139,7 +139,7 @@ xenXMConfigReadFile(virConnectPtr conn, const char *filename)
     if (!(conf = virConfReadFile(filename, 0)))
         return NULL;
 
-    def = xenParseXM(conf, priv->xendConfigVersion, priv->caps, priv->xmlopt);
+    def = xenParseXM(conf, priv->caps, priv->xmlopt);
     virConfFree(conf);
 
     return def;
@@ -151,10 +151,9 @@ xenXMConfigSaveFile(virConnectPtr conn,
                     virDomainDefPtr def)
 {
     virConfPtr conf;
-    xenUnifiedPrivatePtr priv = conn->privateData;
     int ret;
 
-    if (!(conf = xenFormatXM(conn, def, priv->xendConfigVersion)))
+    if (!(conf = xenFormatXM(conn, def)))
         return -1;
 
     ret = virConfWriteFile(filename, conf);
@@ -972,7 +971,7 @@ xenXMDomainDefineXML(virConnectPtr conn, virDomainDefPtr def)
         return -1;
     }
 
-    if (!(conf = xenFormatXM(conn, def, priv->xendConfigVersion)))
+    if (!(conf = xenFormatXM(conn, def)))
         goto error;
 
     /*
diff --git a/src/xenconfig/xen_common.c b/src/xenconfig/xen_common.c
index 7932b3c..f3e7e18 100644
--- a/src/xenconfig/xen_common.c
+++ b/src/xenconfig/xen_common.c
@@ -1017,8 +1017,7 @@ xenParseGeneralMeta(virConfPtr conf, virDomainDefPtr def, virCapsPtr caps)
 int
 xenParseConfigCommon(virConfPtr conf,
                      virDomainDefPtr def,
-                     virCapsPtr caps,
-                     int xendConfigVersion ATTRIBUTE_UNUSED)
+                     virCapsPtr caps)
 {
     if (xenParseGeneralMeta(conf, def, caps) < 0)
         return -1;
@@ -1761,8 +1760,7 @@ xenFormatVif(virConfPtr conf,
 int
 xenFormatConfigCommon(virConfPtr conf,
                       virDomainDefPtr def,
-                      virConnectPtr conn,
-                      int xendConfigVersion ATTRIBUTE_UNUSED)
+                      virConnectPtr conn)
 {
     if (xenFormatGeneralMeta(conf, def) < 0)
         return -1;
diff --git a/src/xenconfig/xen_common.h b/src/xenconfig/xen_common.h
index 0116703..3d9b03c 100644
--- a/src/xenconfig/xen_common.h
+++ b/src/xenconfig/xen_common.h
@@ -54,12 +54,11 @@ int xenConfigCopyStringOpt(virConfPtr conf,
 
 int xenParseConfigCommon(virConfPtr conf,
                          virDomainDefPtr def,
-                         virCapsPtr caps,
-                         int xendConfigVersion);
+                         virCapsPtr caps);
 
 int xenFormatConfigCommon(virConfPtr conf,
                           virDomainDefPtr def,
-                          virConnectPtr conn,
-                          int xendConfigVersion);
+                          virConnectPtr conn);
+
 
 #endif /* __VIR_XEN_COMMON_H__ */
diff --git a/src/xenconfig/xen_xl.c b/src/xenconfig/xen_xl.c
index 98e345c..91cdff6 100644
--- a/src/xenconfig/xen_xl.c
+++ b/src/xenconfig/xen_xl.c
@@ -446,8 +446,7 @@ xenParseXLInputDevs(virConfPtr conf, virDomainDefPtr def)
 virDomainDefPtr
 xenParseXL(virConfPtr conf,
            virCapsPtr caps,
-           virDomainXMLOptionPtr xmlopt,
-           int xendConfigVersion)
+           virDomainXMLOptionPtr xmlopt)
 {
     virDomainDefPtr def = NULL;
 
@@ -457,7 +456,7 @@ xenParseXL(virConfPtr conf,
     def->virtType = VIR_DOMAIN_VIRT_XEN;
     def->id = -1;
 
-    if (xenParseConfigCommon(conf, def, caps, xendConfigVersion) < 0)
+    if (xenParseConfigCommon(conf, def, caps) < 0)
         goto cleanup;
 
     if (xenParseXLOS(conf, def, caps) < 0)
@@ -828,14 +827,14 @@ xenFormatXLInputDevs(virConfPtr conf, virDomainDefPtr def)
 
 
 virConfPtr
-xenFormatXL(virDomainDefPtr def, virConnectPtr conn, int xendConfigVersion)
+xenFormatXL(virDomainDefPtr def, virConnectPtr conn)
 {
     virConfPtr conf = NULL;
 
     if (!(conf = virConfNew()))
         goto cleanup;
 
-    if (xenFormatConfigCommon(conf, def, conn, xendConfigVersion) < 0)
+    if (xenFormatConfigCommon(conf, def, conn) < 0)
         goto cleanup;
 
     if (xenFormatXLOS(conf, def) < 0)
diff --git a/src/xenconfig/xen_xl.h b/src/xenconfig/xen_xl.h
index 58dfcb5..dd96326 100644
--- a/src/xenconfig/xen_xl.h
+++ b/src/xenconfig/xen_xl.h
@@ -29,9 +29,8 @@
 
 virDomainDefPtr xenParseXL(virConfPtr conn,
                            virCapsPtr caps,
-                           virDomainXMLOptionPtr xmlopt,
-                           int xendConfigVersion);
-virConfPtr xenFormatXL(virDomainDefPtr def,
-                       virConnectPtr, int xendConfigVersion);
+                           virDomainXMLOptionPtr xmlopt);
+
+virConfPtr xenFormatXL(virDomainDefPtr def, virConnectPtr);
 
 #endif /* __VIR_XEN_XL_H__ */
diff --git a/src/xenconfig/xen_xm.c b/src/xenconfig/xen_xm.c
index aac274d..f3e2f71 100644
--- a/src/xenconfig/xen_xm.c
+++ b/src/xenconfig/xen_xm.c
@@ -104,8 +104,7 @@ xenParseXMOS(virConfPtr conf, virDomainDefPtr def)
 
 
 static int
-xenParseXMDisk(virConfPtr conf, virDomainDefPtr def,
-               int xendConfigVersion ATTRIBUTE_UNUSED)
+xenParseXMDisk(virConfPtr conf, virDomainDefPtr def)
 {
     virDomainDiskDefPtr disk = NULL;
     int hvm = def->os.type == VIR_DOMAIN_OSTYPE_HVM;
@@ -281,9 +280,7 @@ xenParseXMDisk(virConfPtr conf, virDomainDefPtr def,
 
 static int
 xenFormatXMDisk(virConfValuePtr list,
-                virDomainDiskDefPtr disk,
-                int hvm ATTRIBUTE_UNUSED,
-                int xendConfigVersion ATTRIBUTE_UNUSED)
+                virDomainDiskDefPtr disk)
 {
     virBuffer buf = VIR_BUFFER_INITIALIZER;
     virConfValuePtr val, tmp;
@@ -362,11 +359,10 @@ xenFormatXMDisk(virConfValuePtr list,
 
 
 static int
-xenFormatXMDisks(virConfPtr conf, virDomainDefPtr def, int xendConfigVersion)
+xenFormatXMDisks(virConfPtr conf, virDomainDefPtr def)
 {
     virConfValuePtr diskVal = NULL;
     size_t i = 0;
-    int hvm = def->os.type == VIR_DOMAIN_OSTYPE_HVM;
 
     if (VIR_ALLOC(diskVal) < 0)
         goto cleanup;
@@ -378,8 +374,7 @@ xenFormatXMDisks(virConfPtr conf, virDomainDefPtr def, int xendConfigVersion)
         if (def->disks[i]->device == VIR_DOMAIN_DISK_DEVICE_FLOPPY)
             continue;
 
-        if (xenFormatXMDisk(diskVal, def->disks[i],
-                            hvm, xendConfigVersion) < 0)
+        if (xenFormatXMDisk(diskVal, def->disks[i]) < 0)
             goto cleanup;
     }
 
@@ -436,7 +431,6 @@ xenParseXMInputDevs(virConfPtr conf, virDomainDefPtr def)
  */
 virDomainDefPtr
 xenParseXM(virConfPtr conf,
-           int xendConfigVersion,
            virCapsPtr caps,
            virDomainXMLOptionPtr xmlopt)
 {
@@ -448,13 +442,13 @@ xenParseXM(virConfPtr conf,
     def->virtType = VIR_DOMAIN_VIRT_XEN;
     def->id = -1;
 
-    if (xenParseConfigCommon(conf, def, caps, xendConfigVersion) < 0)
+    if (xenParseConfigCommon(conf, def, caps) < 0)
         goto cleanup;
 
     if (xenParseXMOS(conf, def) < 0)
          goto cleanup;
 
-    if (xenParseXMDisk(conf, def, xendConfigVersion) < 0)
+    if (xenParseXMDisk(conf, def) < 0)
          goto cleanup;
 
     if (xenParseXMInputDevs(conf, def) < 0)
@@ -584,21 +578,20 @@ verify(MAX_VIRT_CPUS <= sizeof(1UL) * CHAR_BIT);
  */
 virConfPtr
 xenFormatXM(virConnectPtr conn,
-            virDomainDefPtr def,
-            int xendConfigVersion)
+            virDomainDefPtr def)
 {
     virConfPtr conf = NULL;
 
     if (!(conf = virConfNew()))
         goto cleanup;
 
-    if (xenFormatConfigCommon(conf, def, conn, xendConfigVersion) < 0)
+    if (xenFormatConfigCommon(conf, def, conn) < 0)
         goto cleanup;
 
     if (xenFormatXMOS(conf, def) < 0)
         goto cleanup;
 
-    if (xenFormatXMDisks(conf, def, xendConfigVersion) < 0)
+    if (xenFormatXMDisks(conf, def) < 0)
         goto cleanup;
 
     if (xenFormatXMInputDevs(conf, def) < 0)
diff --git a/src/xenconfig/xen_xm.h b/src/xenconfig/xen_xm.h
index 61f94db..db3e345 100644
--- a/src/xenconfig/xen_xm.h
+++ b/src/xenconfig/xen_xm.h
@@ -30,10 +30,9 @@
 # include "virconf.h"
 # include "domain_conf.h"
 
-virConfPtr xenFormatXM(virConnectPtr conn, virDomainDefPtr def,
-                       int xendConfigVersion);
+virConfPtr xenFormatXM(virConnectPtr conn, virDomainDefPtr def);
 
-virDomainDefPtr xenParseXM(virConfPtr conf, int xendConfigVersion,
+virDomainDefPtr xenParseXM(virConfPtr conf,
                            virCapsPtr caps, virDomainXMLOptionPtr xmlopt);
 
 #endif /* __VIR_XEN_XM_H__ */
diff --git a/tests/xlconfigtest.c b/tests/xlconfigtest.c
index 31865ff..de7f871 100644
--- a/tests/xlconfigtest.c
+++ b/tests/xlconfigtest.c
@@ -70,7 +70,7 @@ testCompareParseXML(const char *xmcfg, const char *xml)
         goto fail;
     }
 
-    if (!(conf = xenFormatXL(def, conn, 4)))
+    if (!(conf = xenFormatXL(def, conn)))
         goto fail;
 
     if (virConfWriteMem(gotxmcfgData, &wrote, conf) < 0)
@@ -113,7 +113,7 @@ testCompareFormatXML(const char *xmcfg, const char *xml)
     if (!(conf = virConfReadMem(xmcfgData, strlen(xmcfgData), 0)))
         goto fail;
 
-    if (!(def = xenParseXL(conf, caps, xmlopt, 4)))
+    if (!(def = xenParseXL(conf, caps, xmlopt)))
         goto fail;
 
     if (!(gotxml = virDomainDefFormat(def, VIR_DOMAIN_XML_INACTIVE |
diff --git a/tests/xmconfigtest.c b/tests/xmconfigtest.c
index f2705eb..43a6775 100644
--- a/tests/xmconfigtest.c
+++ b/tests/xmconfigtest.c
@@ -73,7 +73,7 @@ testCompareParseXML(const char *xmcfg, const char *xml)
         goto fail;
     }
 
-    if (!(conf = xenFormatXM(conn, def, 4)))
+    if (!(conf = xenFormatXM(conn, def)))
         goto fail;
 
     if (virConfWriteMem(gotxmcfgData, &wrote, conf) < 0)
@@ -120,8 +120,7 @@ testCompareFormatXML(const char *xmcfg, const char *xml)
     if (!(conf = virConfReadMem(xmcfgData, strlen(xmcfgData), 0)))
         goto fail;
 
-    if (!(def = xenParseXM(conf, priv.xendConfigVersion,
-                           caps, xmlopt)))
+    if (!(def = xenParseXM(conf, caps, xmlopt)))
         goto fail;
 
     if (!(gotxml = virDomainDefFormat(def, VIR_DOMAIN_DEF_FORMAT_SECURE)))
-- 
2.1.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



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