test: Reuse virDomainObjGetOneDef in testDomainGetVcpusFlags

The test driver copies the domain definition correctly so we can reuse
the helper.
This commit is contained in:
Peter Krempa 2015-06-16 10:10:59 +02:00
parent e7d3ff8464
commit 0cce10714f

View File

@ -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: