]> xenbits.xensource.com Git - libvirt.git/commitdiff
xenconfig: replace text 'xm' with 'xl' in xlconfigtest
authorJim Fehlig <jfehlig@suse.com>
Tue, 16 Feb 2016 02:42:27 +0000 (19:42 -0700)
committerJim Fehlig <jfehlig@suse.com>
Mon, 22 Feb 2016 18:46:50 +0000 (11:46 -0700)
While at it, improve a few comments. No functional change.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
tests/xlconfigtest.c

index 4b2f28fd31f61e4bdb6f98850e73507487581dca..aa53ed8f70931fb1a3d4874df3e1c3c2eb2c1192 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * xlconfigtest.c: Test backend for xl_internal config file handling
+ * xlconfigtest.c: Test xl.cfg(5) <-> domXML config conversions
  *
  * Copyright (C) 2007, 2010-2011, 2014 Red Hat, Inc.
  * Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany.
 
 static virCapsPtr caps;
 static virDomainXMLOptionPtr xmlopt;
+
 /*
- * parses the xml, creates a domain def and compare with equivalent xm config
+ * Parses domXML to virDomainDef object, which is then converted to xl.cfg(5)
+ * config and compared with expected config.
  */
 static int
-testCompareParseXML(const char *xmcfg, const char *xml)
+testCompareParseXML(const char *xlcfg, const char *xml)
 {
-    char *gotxmcfgData = NULL;
+    char *gotxlcfgData = NULL;
     virConfPtr conf = NULL;
     virConnectPtr conn = NULL;
     int wrote = 4096;
     int ret = -1;
     virDomainDefPtr def = NULL;
 
-    if (VIR_ALLOC_N(gotxmcfgData, wrote) < 0)
+    if (VIR_ALLOC_N(gotxlcfgData, wrote) < 0)
         goto fail;
 
     conn = virGetConnect();
@@ -73,17 +75,17 @@ testCompareParseXML(const char *xmcfg, const char *xml)
     if (!(conf = xenFormatXL(def, conn)))
         goto fail;
 
-    if (virConfWriteMem(gotxmcfgData, &wrote, conf) < 0)
+    if (virConfWriteMem(gotxlcfgData, &wrote, conf) < 0)
         goto fail;
-    gotxmcfgData[wrote] = '\0';
+    gotxlcfgData[wrote] = '\0';
 
-    if (virtTestCompareToFile(gotxmcfgData, xmcfg) < 0)
+    if (virtTestCompareToFile(gotxlcfgData, xlcfg) < 0)
         goto fail;
 
     ret = 0;
 
  fail:
-    VIR_FREE(gotxmcfgData);
+    VIR_FREE(gotxlcfgData);
     if (conf)
         virConfFree(conf);
     virDomainDefFree(def);
@@ -91,13 +93,15 @@ testCompareParseXML(const char *xmcfg, const char *xml)
 
     return ret;
 }
+
 /*
- * parses the xl config, develops domain def and compares with equivalent xm config
+ * Parses xl.cfg(5) config to virDomainDef object, which is then converted to
+ * domXML and compared to expected XML.
  */
 static int
-testCompareFormatXML(const char *xmcfg, const char *xml)
+testCompareFormatXML(const char *xlcfg, const char *xml)
 {
-    char *xmcfgData = NULL;
+    char *xlcfgData = NULL;
     char *gotxml = NULL;
     virConfPtr conf = NULL;
     int ret = -1;
@@ -107,10 +111,10 @@ testCompareFormatXML(const char *xmcfg, const char *xml)
     conn = virGetConnect();
     if (!conn) goto fail;
 
-    if (virtTestLoadFile(xmcfg, &xmcfgData) < 0)
+    if (virtTestLoadFile(xlcfg, &xlcfgData) < 0)
         goto fail;
 
-    if (!(conf = virConfReadMem(xmcfgData, strlen(xmcfgData), 0)))
+    if (!(conf = virConfReadMem(xlcfgData, strlen(xlcfgData), 0)))
         goto fail;
 
     if (!(def = xenParseXL(conf, caps, xmlopt)))
@@ -128,7 +132,7 @@ testCompareFormatXML(const char *xmcfg, const char *xml)
  fail:
     if (conf)
         virConfFree(conf);
-    VIR_FREE(xmcfgData);
+    VIR_FREE(xlcfgData);
     VIR_FREE(gotxml);
     virDomainDefFree(def);
     virObjectUnref(conn);