]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
test: Reuse virDomainObjGetOneDef in testDomainGetVcpusFlags
authorPeter Krempa <pkrempa@redhat.com>
Tue, 16 Jun 2015 08:10:59 +0000 (10:10 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 22 Jun 2015 12:24:56 +0000 (14:24 +0200)
The test driver copies the domain definition correctly so we can reuse
the helper.

src/test/test_driver.c

index d1f0af3a952f47a26e0d83d334176e16dcd6f2e0..c0ef459d91e1291dc38c5cd8dbf6e251612618a6 100644 (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: