[PATCH v2 07/10] Narrow down a parameter to function

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

 



Attaching to both live and config will soon be tested, so
testQemuHotplugCheckResult will be used on both def and newDef.

---
 tests/qemuhotplugtest.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c
index 0a5f068..d862a0e 100644
--- a/tests/qemuhotplugtest.c
+++ b/tests/qemuhotplugtest.c
@@ -175,7 +175,7 @@ testQemuHotplugUpdate(virDomainObjPtr vm,
 }
 
 static int
-testQemuHotplugCheckResult(virDomainObjPtr vm,
+testQemuHotplugCheckResult(virDomainDefPtr def,
                            const char *expected,
                            const char *expectedFile,
                            bool fail)
@@ -183,11 +183,11 @@ testQemuHotplugCheckResult(virDomainObjPtr vm,
     char *actual;
     int ret;
 
-    actual = virDomainDefFormat(vm->def, driver.caps,
+    actual = virDomainDefFormat(def, driver.caps,
                                 VIR_DOMAIN_DEF_FORMAT_SECURE);
     if (!actual)
         return -1;
-    vm->def->id = QEMU_HOTPLUG_TEST_DOMAIN_ID;
+    def->id = QEMU_HOTPLUG_TEST_DOMAIN_ID;
 
     if (STREQ(expected, actual)) {
         if (fail)
@@ -299,14 +299,14 @@ testQemuHotplug(const void *data)
             VIR_FREE(dev);
         }
         if (ret == 0 || fail)
-            ret = testQemuHotplugCheckResult(vm, result_xml,
+            ret = testQemuHotplugCheckResult(vm->def, result_xml,
                                              result_filename, fail);
         break;
 
     case DETACH:
         ret = testQemuHotplugDetach(vm, dev);
         if (ret == 0 || fail)
-            ret = testQemuHotplugCheckResult(vm, domain_xml,
+            ret = testQemuHotplugCheckResult(vm->def, domain_xml,
                                              domain_filename, fail);
         break;
 
-- 
2.7.4

--
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]