mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-01 17:35:17 +00:00
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.
This commit is contained in:
parent
ef88140725
commit
f3d3be3d48
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user