mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 21:34:54 +03:00
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: Chunyan Liu <cyliu@suse.com>
This commit is contained in:
parent
ef45eb9bc7
commit
f1066d0d46
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user