mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06: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;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virDomainLiveConfigHelperMethod(privconn->caps, privconn->xmlopt,
|
if (!(def = virDomainObjGetOneDef(vm, flags)))
|
||||||
vm, &flags, &def) < 0)
|
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (flags & VIR_DOMAIN_AFFECT_LIVE)
|
|
||||||
def = vm->def;
|
|
||||||
|
|
||||||
ret = (flags & VIR_DOMAIN_VCPU_MAXIMUM) ? def->maxvcpus : def->vcpus;
|
ret = (flags & VIR_DOMAIN_VCPU_MAXIMUM) ? def->maxvcpus : def->vcpus;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
|
Loading…
Reference in New Issue
Block a user