[PATCH 27/35] qemu: Refactor qemuDomainGetIOThreadInfo by reusing virDomainObjGetDefs

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

 



---
 src/qemu/qemu_driver.c | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 5969f5c..b799d6e 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -5756,7 +5756,6 @@ qemuDomainGetIOThreadInfo(virDomainPtr dom,
 {
     virQEMUDriverPtr driver = dom->conn->privateData;
     virDomainObjPtr vm;
-    virCapsPtr caps = NULL;
     virDomainDefPtr targetDef = NULL;
     int ret = -1;

@@ -5769,27 +5768,16 @@ qemuDomainGetIOThreadInfo(virDomainPtr dom,
     if (virDomainGetIOThreadInfoEnsureACL(dom->conn, vm->def) < 0)
         goto cleanup;

-    if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
+    if (virDomainObjGetDefs(vm, flags, NULL, &targetDef) < 0)
         goto cleanup;

-    if (virDomainLiveConfigHelperMethod(caps, driver->xmlopt, vm, &flags,
-                                        &targetDef) < 0)
-        goto cleanup;
-
-    if (flags & VIR_DOMAIN_AFFECT_LIVE)
-        targetDef = vm->def;
-
-    /* Coverity didn't realize that targetDef must be set if we got here.  */
-    sa_assert(targetDef);
-
-    if (flags & VIR_DOMAIN_AFFECT_LIVE)
+    if (!targetDef)
         ret = qemuDomainGetIOThreadsLive(driver, vm, info);
     else
         ret = qemuDomainGetIOThreadsConfig(targetDef, info);

  cleanup:
     virDomainObjEndAPI(&vm);
-    virObjectUnref(caps);
     return ret;
 }

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