mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
test: Reuse virDomainObjGetOneDef in testDomainGetVcpusFlags
The test driver copies the domain definition correctly so we can reuse the helper.
This commit is contained in:
parent
e7d3ff8464
commit
0cce10714f
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user