diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index f6ab45cd2f..f5e405defe 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -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: * diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 4ebafbe93b..a1acebe9d4 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -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, diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index ccb4c5e855..ad0af76a7b 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -358,7 +358,6 @@ virDomainLifecycleCrashTypeFromString; virDomainLifecycleCrashTypeToString; virDomainLifecycleTypeFromString; virDomainLifecycleTypeToString; -virDomainLiveConfigHelperMethod; virDomainLoaderDefFree; virDomainLoaderTypeFromString; virDomainLoaderTypeToString; diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index 3189f1c598..266116859a 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -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)