提交 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"); ...@@ -70,10 +70,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_SEXPR "xen-sxpr"
#define LIBXL_NB_TOTAL_CPU_STAT_PARAM 1 #define LIBXL_NB_TOTAL_CPU_STAT_PARAM 1
#define HYPERVISOR_CAPABILITIES "/proc/xen/capabilities" #define HYPERVISOR_CAPABILITIES "/proc/xen/capabilities"
...@@ -2534,14 +2530,14 @@ libxlConnectDomainXMLFromNative(virConnectPtr conn, ...@@ -2534,14 +2530,14 @@ 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, XEN_CONFIG_FORMAT_XL)) {
if (!(conf = virConfReadMem(nativeConfig, strlen(nativeConfig), 0))) if (!(conf = virConfReadMem(nativeConfig, strlen(nativeConfig), 0)))
goto cleanup; goto cleanup;
if (!(def = xenParseXL(conf, if (!(def = xenParseXL(conf,
cfg->caps, cfg->caps,
driver->xmlopt))) driver->xmlopt)))
goto cleanup; 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))) if (!(conf = virConfReadMem(nativeConfig, strlen(nativeConfig), 0)))
goto cleanup; goto cleanup;
...@@ -2549,7 +2545,7 @@ libxlConnectDomainXMLFromNative(virConnectPtr conn, ...@@ -2549,7 +2545,7 @@ libxlConnectDomainXMLFromNative(virConnectPtr conn,
cfg->caps, cfg->caps,
driver->xmlopt))) driver->xmlopt)))
goto cleanup; goto cleanup;
} else if (STREQ(nativeFormat, LIBXL_CONFIG_FORMAT_SEXPR)) { } else if (STREQ(nativeFormat, XEN_CONFIG_FORMAT_SEXPR)) {
/* only support latest xend config format */ /* only support latest xend config format */
if (!(def = xenParseSxprString(nativeConfig, if (!(def = xenParseSxprString(nativeConfig,
NULL, NULL,
...@@ -2599,10 +2595,10 @@ libxlConnectDomainXMLToNative(virConnectPtr conn, const char * nativeFormat, ...@@ -2599,10 +2595,10 @@ libxlConnectDomainXMLToNative(virConnectPtr conn, const char * nativeFormat,
VIR_DOMAIN_DEF_PARSE_INACTIVE))) VIR_DOMAIN_DEF_PARSE_INACTIVE)))
goto cleanup; goto cleanup;
if (STREQ(nativeFormat, LIBXL_CONFIG_FORMAT_XL)) { if (STREQ(nativeFormat, XEN_CONFIG_FORMAT_XL)) {
if (!(conf = xenFormatXL(def, conn))) if (!(conf = xenFormatXL(def, conn)))
goto cleanup; goto cleanup;
} else if (STREQ(nativeFormat, LIBXL_CONFIG_FORMAT_XM)) { } else if (STREQ(nativeFormat, XEN_CONFIG_FORMAT_XM)) {
if (!(conf = xenFormatXM(conn, def))) if (!(conf = xenFormatXM(conn, def)))
goto cleanup; goto cleanup;
} else { } else {
......
...@@ -67,9 +67,6 @@ int xenRegister (void); ...@@ -67,9 +67,6 @@ int xenRegister (void);
# define MIN_XEN_GUEST_SIZE 64 /* 64 megabytes */ # 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 XEND_DOMAINS_DIR "/var/lib/xend/domains"
# define XEN_SCHED_SEDF_NPARAM 6 # define XEN_SCHED_SEDF_NPARAM 6
......
...@@ -27,6 +27,10 @@ ...@@ -27,6 +27,10 @@
# include "virconf.h" # include "virconf.h"
# include "domain_conf.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, int xenConfigGetString(virConfPtr conf,
const char *name, const char *name,
const char **value, const char **value,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册