diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index 062d6f8b306541b7fdf55d5abc3e4dab0c8d37ea..2c19ddb36fb1fa373d0b6599e253295cc1f5da6a 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -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 { diff --git a/src/xen/xen_driver.h b/src/xen/xen_driver.h index 8578324d4ccc055f3925d6b25a13d3a9cd2f73ca..5015b31c769387b554b1349ac194fc4e292488ad 100644 --- a/src/xen/xen_driver.h +++ b/src/xen/xen_driver.h @@ -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 diff --git a/src/xenconfig/xen_common.h b/src/xenconfig/xen_common.h index 9ddf21041d789392080f6674b03a0087628a00bb..d8b8478510d50d844bd0d627446dcf0db559bad1 100644 --- a/src/xenconfig/xen_common.h +++ b/src/xenconfig/xen_common.h @@ -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,