提交 f3d3be3d 编写于 作者: P Peter Krempa

conf: Isolate virDomainLiveConfigHelperMethod to libxl only

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.
上级 ef881407
......@@ -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:
*
......
......@@ -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,
......
......@@ -358,7 +358,6 @@ virDomainLifecycleCrashTypeFromString;
virDomainLifecycleCrashTypeToString;
virDomainLifecycleTypeFromString;
virDomainLifecycleTypeToString;
virDomainLiveConfigHelperMethod;
virDomainLoaderDefFree;
virDomainLoaderTypeFromString;
virDomainLoaderTypeToString;
......
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册