From: Peter Krempa Date: Tue, 16 Jun 2015 08:10:59 +0000 (+0200) Subject: test: Reuse virDomainObjGetOneDef in testDomainGetVcpusFlags X-Git-Tag: v1.2.17-rc1~77 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0cce10714faa78d963de2d10f7560241d8729c08;p=thirdparty%2Flibvirt.git test: Reuse virDomainObjGetOneDef in testDomainGetVcpusFlags The test driver copies the domain definition correctly so we can reuse the helper. --- diff --git a/src/test/test_driver.c b/src/test/test_driver.c index d1f0af3a95..c0ef459d91 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -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: