]> xenbits.xensource.com Git - libvirt.git/commitdiff
conf: Isolate virDomainLiveConfigHelperMethod to libxl only
authorPeter Krempa <pkrempa@redhat.com>
Fri, 1 Jul 2016 14:27:31 +0000 (16:27 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 7 Jul 2016 06:57:05 +0000 (08:57 +0200)
Libxl is the last user and I don't have the toolchain prepared to
compile the libxl driver. Move it to the libxl driver to avoid having to
refactor the code.

src/conf/domain_conf.c
src/conf/domain_conf.h
src/libvirt_private.syms
src/libxl/libxl_driver.c

index f6ab45cd2f23096c7c7dd0804b4c036b247bcd1b..f5e405defe865c56448e0084561616751507e9ec 100644 (file)
@@ -2983,35 +2983,6 @@ virDomainObjUpdateModificationImpact(virDomainObjPtr vm,
 }
 
 
-/*
- * Helper method for --current, --live, and --config options, and check
- * whether domain is active or can get persistent domain configuration.
- *
- * Return 0 if success, also change the flags and get the persistent
- * domain configuration if needed. Return -1 on error.
- */
-int
-virDomainLiveConfigHelperMethod(virCapsPtr caps,
-                                virDomainXMLOptionPtr xmlopt,
-                                virDomainObjPtr dom,
-                                unsigned int *flags,
-                                virDomainDefPtr *persistentDef)
-{
-    if (virDomainObjUpdateModificationImpact(dom, flags) < 0)
-        return -1;
-
-    if (*flags & VIR_DOMAIN_AFFECT_CONFIG) {
-        if (!(*persistentDef = virDomainObjGetPersistentDef(caps, xmlopt, dom))) {
-            virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                           _("Get persistent config failed"));
-            return -1;
-        }
-    }
-
-    return 0;
-}
-
-
 /**
  * virDomainObjGetDefs:
  *
index 4ebafbe93bbeaf73315701ff358a98e0d6a4a29e..a1acebe9d4800b7caec33198a176982504f6d472 100644 (file)
@@ -2557,13 +2557,6 @@ int virDomainObjGetDefs(virDomainObjPtr vm,
                         virDomainDefPtr *persDef);
 virDomainDefPtr virDomainObjGetOneDef(virDomainObjPtr vm, unsigned int flags);
 
-int
-virDomainLiveConfigHelperMethod(virCapsPtr caps,
-                                virDomainXMLOptionPtr xmlopt,
-                                virDomainObjPtr dom,
-                                unsigned int *flags,
-                                virDomainDefPtr *persistentDef);
-
 virDomainDefPtr virDomainDefCopy(virDomainDefPtr src,
                                  virCapsPtr caps,
                                  virDomainXMLOptionPtr xmlopt,
index ccb4c5e8558f4b6651f38c599e267ab703d52b62..ad0af76a7bd1e4c2afe8b9388db3594f784f615e 100644 (file)
@@ -358,7 +358,6 @@ virDomainLifecycleCrashTypeFromString;
 virDomainLifecycleCrashTypeToString;
 virDomainLifecycleTypeFromString;
 virDomainLifecycleTypeToString;
-virDomainLiveConfigHelperMethod;
 virDomainLoaderDefFree;
 virDomainLoaderTypeFromString;
 virDomainLoaderTypeToString;
index 3189f1c598fb73a63e2c486ab5e55f2c9174571a..266116859a7005fceaefee805725467e177447a6 100644 (file)
@@ -1431,6 +1431,36 @@ libxlDomainGetMaxMemory(virDomainPtr dom)
     return ret;
 }
 
+
+/*
+ * Helper method for --current, --live, and --config options, and check
+ * whether domain is active or can get persistent domain configuration.
+ *
+ * Return 0 if success, also change the flags and get the persistent
+ * domain configuration if needed. Return -1 on error.
+ */
+static int
+virDomainLiveConfigHelperMethod(virCapsPtr caps,
+                                virDomainXMLOptionPtr xmlopt,
+                                virDomainObjPtr dom,
+                                unsigned int *flags,
+                                virDomainDefPtr *persistentDef)
+{
+    if (virDomainObjUpdateModificationImpact(dom, flags) < 0)
+        return -1;
+
+    if (*flags & VIR_DOMAIN_AFFECT_CONFIG) {
+        if (!(*persistentDef = virDomainObjGetPersistentDef(caps, xmlopt, dom))) {
+            virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                           _("Get persistent config failed"));
+            return -1;
+        }
+    }
+
+    return 0;
+}
+
+
 static int
 libxlDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
                           unsigned int flags)