[libvirt] [PATCH 1/8] test: Reuse virDomainObjGetOneDef in testDomainGetVcpusFlags

Peter Krempa pkrempa at redhat.com
Tue Jun 16 17:43:13 UTC 2015


The test driver copies the domain definition correctly so we can reuse
the helper.
---
 src/test/test_driver.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index d1f0af3..c0ef459 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:
-- 
2.4.1




More information about the libvir-list mailing list