提交 c6439104 编写于 作者: J Ján Tomko

Use virDomainObjGetDefs in lxcDomainGetSchedulerParametersFlags

On LXC domain startup we have already called virDomainObjSetDefTransient
to fill vm->newDef.

There is no need to call virDomainLiveConfigHelperMethod which has the
ability to fill newDef if it's NULL.
上级 1ca45c8f
......@@ -2086,9 +2086,8 @@ lxcDomainGetSchedulerParametersFlags(virDomainPtr dom,
int *nparams,
unsigned int flags)
{
virLXCDriverPtr driver = dom->conn->privateData;
virCapsPtr caps = NULL;
virDomainObjPtr vm = NULL;
virDomainDefPtr def;
virDomainDefPtr persistentDef;
unsigned long long shares = 0;
unsigned long long period = 0;
......@@ -2117,14 +2116,10 @@ lxcDomainGetSchedulerParametersFlags(virDomainPtr dom,
if (*nparams > 1)
cpu_bw_status = virCgroupSupportsCpuBW(priv->cgroup);
if (!(caps = virLXCDriverGetCapabilities(driver, false)))
goto cleanup;
if (virDomainLiveConfigHelperMethod(caps, driver->xmlopt,
vm, &flags, &persistentDef) < 0)
if (virDomainObjGetDefs(vm, flags, &def, &persistentDef) < 0)
goto cleanup;
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
if (persistentDef) {
shares = persistentDef->cputune.shares;
if (*nparams > 1) {
period = persistentDef->cputune.period;
......@@ -2178,7 +2173,6 @@ lxcDomainGetSchedulerParametersFlags(virDomainPtr dom,
cleanup:
virDomainObjEndAPI(&vm);
virObjectUnref(caps);
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册