提交 f1066d0d 编写于 作者: C Chunyan Liu 提交者: Jim Fehlig

extract XEN_CONFIG_FORMAT_XM/XL to xen_common.h

Unify XEN_CONFIG_FORMAT_x and LIBXL_CONFIG_FORMAT_x to
XEN_CONFIG_FORMAT_x, and move to xen_common.h.
Signed-off-by: NChunyan Liu <cyliu@suse.com>
上级 ef45eb9b
......@@ -70,10 +70,6 @@ VIR_LOG_INIT("libxl.libxl_driver");
#define LIBXL_DOM_REQ_CRASH 3
#define LIBXL_DOM_REQ_HALT 4
#define LIBXL_CONFIG_FORMAT_XL "xen-xl"
#define LIBXL_CONFIG_FORMAT_XM "xen-xm"
#define LIBXL_CONFIG_FORMAT_SEXPR "xen-sxpr"
#define LIBXL_NB_TOTAL_CPU_STAT_PARAM 1
#define HYPERVISOR_CAPABILITIES "/proc/xen/capabilities"
......@@ -2534,14 +2530,14 @@ libxlConnectDomainXMLFromNative(virConnectPtr conn,
if (virConnectDomainXMLFromNativeEnsureACL(conn) < 0)
goto cleanup;
if (STREQ(nativeFormat, LIBXL_CONFIG_FORMAT_XL)) {
if (STREQ(nativeFormat, XEN_CONFIG_FORMAT_XL)) {
if (!(conf = virConfReadMem(nativeConfig, strlen(nativeConfig), 0)))
goto cleanup;
if (!(def = xenParseXL(conf,
cfg->caps,
driver->xmlopt)))
goto cleanup;
} else if (STREQ(nativeFormat, LIBXL_CONFIG_FORMAT_XM)) {
} else if (STREQ(nativeFormat, XEN_CONFIG_FORMAT_XM)) {
if (!(conf = virConfReadMem(nativeConfig, strlen(nativeConfig), 0)))
goto cleanup;
......@@ -2549,7 +2545,7 @@ libxlConnectDomainXMLFromNative(virConnectPtr conn,
cfg->caps,
driver->xmlopt)))
goto cleanup;
} else if (STREQ(nativeFormat, LIBXL_CONFIG_FORMAT_SEXPR)) {
} else if (STREQ(nativeFormat, XEN_CONFIG_FORMAT_SEXPR)) {
/* only support latest xend config format */
if (!(def = xenParseSxprString(nativeConfig,
NULL,
......@@ -2599,10 +2595,10 @@ libxlConnectDomainXMLToNative(virConnectPtr conn, const char * nativeFormat,
VIR_DOMAIN_DEF_PARSE_INACTIVE)))
goto cleanup;
if (STREQ(nativeFormat, LIBXL_CONFIG_FORMAT_XL)) {
if (STREQ(nativeFormat, XEN_CONFIG_FORMAT_XL)) {
if (!(conf = xenFormatXL(def, conn)))
goto cleanup;
} else if (STREQ(nativeFormat, LIBXL_CONFIG_FORMAT_XM)) {
} else if (STREQ(nativeFormat, XEN_CONFIG_FORMAT_XM)) {
if (!(conf = xenFormatXM(conn, def)))
goto cleanup;
} else {
......
......@@ -67,9 +67,6 @@ int xenRegister (void);
# define MIN_XEN_GUEST_SIZE 64 /* 64 megabytes */
# define XEN_CONFIG_FORMAT_XM "xen-xm"
# define XEN_CONFIG_FORMAT_SEXPR "xen-sxpr"
# define XEND_DOMAINS_DIR "/var/lib/xend/domains"
# define XEN_SCHED_SEDF_NPARAM 6
......
......@@ -27,6 +27,10 @@
# include "virconf.h"
# include "domain_conf.h"
# define XEN_CONFIG_FORMAT_XL "xen-xl"
# define XEN_CONFIG_FORMAT_XM "xen-xm"
# define XEN_CONFIG_FORMAT_SEXPR "xen-sxpr"
int xenConfigGetString(virConfPtr conf,
const char *name,
const char **value,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册