提交 0cce1071 编写于 作者: P Peter Krempa

test: Reuse virDomainObjGetOneDef in testDomainGetVcpusFlags

The test driver copies the domain definition correctly so we can reuse
the helper.
上级 e7d3ff84
......@@ -2576,13 +2576,9 @@ testDomainGetVcpusFlags(virDomainPtr domain, unsigned int flags)
goto cleanup;
}
if (virDomainLiveConfigHelperMethod(privconn->caps, privconn->xmlopt,
vm, &flags, &def) < 0)
if (!(def = virDomainObjGetOneDef(vm, flags)))
goto cleanup;
if (flags & VIR_DOMAIN_AFFECT_LIVE)
def = vm->def;
ret = (flags & VIR_DOMAIN_VCPU_MAXIMUM) ? def->maxvcpus : def->vcpus;
cleanup:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册