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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]