Revert "libxl: Add support for parsing/formating Xen XL config"

This reverts commit 4f524212ce.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
This commit is contained in:
Jim Fehlig 2015-01-09 15:28:53 -07:00
parent 88e34a9479
commit 4d77c136f8
1 changed files with 8 additions and 24 deletions

View File

@ -48,7 +48,6 @@
#include "libxl_migration.h" #include "libxl_migration.h"
#include "xen_xm.h" #include "xen_xm.h"
#include "xen_sxpr.h" #include "xen_sxpr.h"
#include "xen_xl.h"
#include "virtypedparam.h" #include "virtypedparam.h"
#include "viruri.h" #include "viruri.h"
#include "virstring.h" #include "virstring.h"
@ -68,7 +67,6 @@ VIR_LOG_INIT("libxl.libxl_driver");
#define LIBXL_DOM_REQ_CRASH 3 #define LIBXL_DOM_REQ_CRASH 3
#define LIBXL_DOM_REQ_HALT 4 #define LIBXL_DOM_REQ_HALT 4
#define LIBXL_CONFIG_FORMAT_XL "xen-xl"
#define LIBXL_CONFIG_FORMAT_XM "xen-xm" #define LIBXL_CONFIG_FORMAT_XM "xen-xm"
#define LIBXL_CONFIG_FORMAT_SEXPR "xen-sxpr" #define LIBXL_CONFIG_FORMAT_SEXPR "xen-sxpr"
@ -2216,17 +2214,7 @@ libxlConnectDomainXMLFromNative(virConnectPtr conn,
if (virConnectDomainXMLFromNativeEnsureACL(conn) < 0) if (virConnectDomainXMLFromNativeEnsureACL(conn) < 0)
goto cleanup; goto cleanup;
if (STREQ(nativeFormat, LIBXL_CONFIG_FORMAT_XL)) { if (STREQ(nativeFormat, LIBXL_CONFIG_FORMAT_XM)) {
if (!(conf = virConfReadMem(nativeConfig, strlen(nativeConfig), 0)))
goto cleanup;
if (!(def = xenParseXL(conf,
cfg->caps,
cfg->verInfo->xen_version_major))) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("parsing xl config failed"));
goto cleanup;
}
} else if (STREQ(nativeFormat, LIBXL_CONFIG_FORMAT_XM)) {
if (!(conf = virConfReadMem(nativeConfig, strlen(nativeConfig), 0))) if (!(conf = virConfReadMem(nativeConfig, strlen(nativeConfig), 0)))
goto cleanup; goto cleanup;
@ -2281,24 +2269,20 @@ libxlConnectDomainXMLToNative(virConnectPtr conn, const char * nativeFormat,
if (virConnectDomainXMLToNativeEnsureACL(conn) < 0) if (virConnectDomainXMLToNativeEnsureACL(conn) < 0)
goto cleanup; goto cleanup;
if (STRNEQ(nativeFormat, LIBXL_CONFIG_FORMAT_XM)) {
virReportError(VIR_ERR_INVALID_ARG,
_("unsupported config type %s"), nativeFormat);
goto cleanup;
}
if (!(def = virDomainDefParseString(domainXml, if (!(def = virDomainDefParseString(domainXml,
cfg->caps, driver->xmlopt, cfg->caps, driver->xmlopt,
1 << VIR_DOMAIN_VIRT_XEN, 1 << VIR_DOMAIN_VIRT_XEN,
VIR_DOMAIN_XML_INACTIVE))) VIR_DOMAIN_XML_INACTIVE)))
goto cleanup; goto cleanup;
if (STREQ(nativeFormat, LIBXL_CONFIG_FORMAT_XL)) { if (!(conf = xenFormatXM(conn, def, cfg->verInfo->xen_version_major)))
if (!(conf = xenFormatXL(def, conn, cfg->verInfo->xen_version_major)))
goto cleanup;
} else if (STREQ(nativeFormat, LIBXL_CONFIG_FORMAT_XM)) {
if (!(conf = xenFormatXM(conn, def, cfg->verInfo->xen_version_major)))
goto cleanup;
} else {
virReportError(VIR_ERR_INVALID_ARG,
_("unsupported config type %s"), nativeFormat);
goto cleanup; goto cleanup;
}
if (VIR_ALLOC_N(ret, len) < 0) if (VIR_ALLOC_N(ret, len) < 0)
goto cleanup; goto cleanup;