]> xenbits.xensource.com Git - libvirt.git/commitdiff
Xen: xenconfig: remove xendConfigVersion from public functions
authorJim Fehlig <jfehlig@suse.com>
Sat, 5 Dec 2015 02:11:39 +0000 (19:11 -0700)
committerJim Fehlig <jfehlig@suse.com>
Fri, 18 Dec 2015 04:22:33 +0000 (21:22 -0700)
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@suse.com>
src/libxl/libxl_driver.c
src/xen/xen_driver.c
src/xen/xm_internal.c
src/xenconfig/xen_common.c
src/xenconfig/xen_common.h
src/xenconfig/xen_xl.c
src/xenconfig/xen_xl.h
src/xenconfig/xen_xm.c
src/xenconfig/xen_xm.h
tests/xlconfigtest.c
tests/xmconfigtest.c

index 4f82c017d056869d459a80106e4510e06becf787..301901558772213612e1ff2c86d567a0138d5b4e 100644 (file)
@@ -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 {
 
index 285a553ec0c6f61f2625855c08ec981569bd36e2..321a2507f65dd519648d437a28f352a57c2f11eb 100644 (file)
@@ -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;
 
index ee78fe9e22f534db75ddc2c59807e39c32711909..085b24adaef666836bd5b2313db868e7466f88b6 100644 (file)
@@ -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;
 
     /*
index 7932b3c892c9b1833697156c86837930a5316d6d..f3e7e1864f46a9f7a700ad0640422b02f7752874 100644 (file)
@@ -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;
index 0116703d345e5a510617d91fe37f8ff06858ebbc..3d9b03c9e08e581f05576a2be7538330de3fce45 100644 (file)
@@ -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__ */
index 98e345c8b86cf430747dfb0062baefd9a185571f..91cdff6839901aed97ae69a6e46d0d8db3455650 100644 (file)
@@ -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)
index 58dfcb5478e0a390d7fd187b65500e9563995a3c..dd963268e0988b52d3f1b0881be42b4bf78ab61a 100644 (file)
@@ -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__ */
index aac274d024464a023c934dd90db688a1e93e7e27..f3e2f719df0d7444a81f511b086ece8ff0c91a36 100644 (file)
@@ -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)
index 61f94db8ae31c1c9570878f55f970dcfba64e5a0..db3e3456ece6315d66e1df20dbf98ce65ab40eab 100644 (file)
 # 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__ */
index 31865ff64f2b30983e86048d5fdd5eddf7a73618..de7f8718f5b47d63bca192837556da803449f8f3 100644 (file)
@@ -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 |
index f2705eb0ce509cfa4e4a041ba7ff87c0888573ba..43a677592ddbd04b453bc9f9c8a678c91a0b789e 100644 (file)
@@ -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)))