]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
extract XEN_CONFIG_FORMAT_XM/XL to xen_common.h
authorChunyan Liu <cyliu@suse.com>
Tue, 17 May 2016 09:34:44 +0000 (17:34 +0800)
committerJim Fehlig <jfehlig@suse.com>
Tue, 17 May 2016 20:09:11 +0000 (14:09 -0600)
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>
src/libxl/libxl_driver.c
src/xen/xen_driver.h
src/xenconfig/xen_common.h

index 062d6f8b306541b7fdf55d5abc3e4dab0c8d37ea..2c19ddb36fb1fa373d0b6599e253295cc1f5da6a 100644 (file)
@@ -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 {
index 8578324d4ccc055f3925d6b25a13d3a9cd2f73ca..5015b31c769387b554b1349ac194fc4e292488ad 100644 (file)
@@ -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
index 9ddf21041d789392080f6674b03a0087628a00bb..d8b8478510d50d844bd0d627446dcf0db559bad1 100644 (file)
 # 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,