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

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



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


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