Xen: xenconfig: remove xendConfigVersion from public functions

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>
This commit is contained in:
Jim Fehlig 2015-12-04 19:11:39 -07:00
parent 0f58db3092
commit 7d7c08be1c
11 changed files with 35 additions and 53 deletions

View 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 {

View 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;

View 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;
/*

View 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;

View 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__ */

View 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)

View 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__ */

View 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)

View File

@ -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__ */

View 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 |

View 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)))